mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-16 15:40:12 +01:00
refactor(web): consolidate inline JavaScript to TypeScript modules
Migrated app.js and components.js to TypeScript. Extracted inline scripts from base.html to cardHover.ts and cardImages.ts modules for better maintainability and code reuse.
This commit is contained in:
parent
ed381dfdce
commit
9379732eec
8 changed files with 1050 additions and 634 deletions
|
|
@ -1,5 +1,24 @@
|
|||
/* Core app enhancements: tokens, toasts, shortcuts, state, skeletons */
|
||||
import type { StateManager, TelemetryManager, ToastOptions, SkeletonManager } from './types.js';
|
||||
// Type definitions moved inline to avoid module system
|
||||
interface StateManager {
|
||||
get(key: string, def?: any): any;
|
||||
set(key: string, val: any): void;
|
||||
inHash(obj: Record<string, any>): void;
|
||||
readHash(): URLSearchParams;
|
||||
}
|
||||
|
||||
interface ToastOptions {
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
interface TelemetryManager {
|
||||
send(eventName: string, data?: Record<string, any>): void;
|
||||
}
|
||||
|
||||
interface SkeletonManager {
|
||||
show(context?: HTMLElement | Document): void;
|
||||
hide(context?: HTMLElement | Document): void;
|
||||
}
|
||||
|
||||
(function(){
|
||||
// Design tokens fallback (in case CSS variables missing in older browsers)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue