1 |
|
2 | import { Reference } from '@glimmer/reference';
|
3 | import { InternalComponentCapability, InternalComponentManager } from './managers';
|
4 | import { Dict } from './core';
|
5 | import { CompilableProgram } from './template';
|
6 | import { ProgramSymbolTable } from './tier1/symbol-table';
|
7 | import { ScopeSlot } from './runtime';
|
8 |
|
9 | export type ComponentDefinitionState = object;
|
10 | export type ComponentInstanceState = unknown;
|
11 |
|
12 | export interface ComponentDefinition<
|
13 | D extends ComponentDefinitionState = ComponentDefinitionState,
|
14 | I = ComponentInstanceState,
|
15 | M extends InternalComponentManager<I, D> = InternalComponentManager<I, D>
|
16 | > {
|
17 | resolvedName: string | null;
|
18 | handle: number;
|
19 | state: D;
|
20 | manager: M;
|
21 | capabilities: InternalComponentCapability;
|
22 | compilable: CompilableProgram | null;
|
23 | }
|
24 |
|
25 | export interface ComponentInstance<
|
26 | D extends ComponentDefinitionState = ComponentDefinitionState,
|
27 | I = ComponentInstanceState,
|
28 | M extends InternalComponentManager<I, D> = InternalComponentManager<I, D>
|
29 | > {
|
30 | definition: ComponentDefinition<D, I>;
|
31 | manager: M;
|
32 | capabilities: InternalComponentCapability;
|
33 | state: I;
|
34 | handle: number;
|
35 | table: ProgramSymbolTable;
|
36 | lookup: Record<string, ScopeSlot> | null;
|
37 | }
|
38 |
|
39 | export interface PreparedArguments {
|
40 | positional: ReadonlyArray<Reference>;
|
41 | named: Dict<Reference>;
|
42 | }
|