aboutsummaryrefslogtreecommitdiff
path: root/src/core/model.ts
blob: f2508396cabd6690ff06df1ae86b14fce674f766 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import type { I18n, MessageKey } from '../i18n';

export interface ModelContext {
  i18n: I18n;
}

export interface ModelInstance {
  /** Release animation frames, GPU resources, observers, and event listeners. */
  dispose(): void;
}

export interface ModelDefinition {
  id: string;
  titleKey: MessageKey;
  mount(host: HTMLElement, context: ModelContext): ModelInstance | Promise<ModelInstance>;
}