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