UNPKG

1.39 kBTypeScriptView Raw
1import { SimpleDocument } from '@simple-dom/interface';
2import { ComponentDefinitionState, ComponentInstance, ComponentInstanceState } from '../components';
3import { Option } from '../core';
4import { GlimmerTreeChanges, GlimmerTreeConstruction } from '../dom/changes';
5import { DebugRenderTree } from './debug-render-tree';
6import { Owner } from './owner';
7import { ModifierInstance } from './modifier';
8import { WithCreateInstance } from '../..';
9
10export interface EnvironmentOptions {
11 document?: SimpleDocument;
12 appendOperations?: GlimmerTreeConstruction;
13 updateOperations?: GlimmerTreeChanges;
14}
15
16export interface Transaction {}
17
18declare const TransactionSymbol: unique symbol;
19export type TransactionSymbol = typeof TransactionSymbol;
20
21export type ComponentInstanceWithCreate = ComponentInstance<
22 ComponentDefinitionState,
23 ComponentInstanceState,
24 WithCreateInstance
25>;
26
27export interface Environment {
28 [TransactionSymbol]: Option<Transaction>;
29
30 didCreate(component: ComponentInstanceWithCreate): void;
31 didUpdate(component: ComponentInstanceWithCreate): void;
32
33 scheduleInstallModifier(modifier: ModifierInstance): void;
34 scheduleUpdateModifier(modifier: ModifierInstance): void;
35
36 begin(): void;
37 commit(): void;
38
39 getDOM(): GlimmerTreeChanges;
40 getAppendOperations(): GlimmerTreeConstruction;
41
42 isInteractive: boolean;
43 debugRenderTree?: DebugRenderTree;
44}