1 | import type { Nullable } from './core.js';
|
2 |
|
3 | export type ConstantReference = 0;
|
4 | export type ComputeReference = 1;
|
5 | export type UnboundReference = 2;
|
6 | export type InvokableReference = 3;
|
7 |
|
8 | export interface ReferenceTypes {
|
9 | readonly Constant: ConstantReference;
|
10 | readonly Compute: ComputeReference;
|
11 | readonly Unbound: UnboundReference;
|
12 | readonly Invokable: InvokableReference;
|
13 | }
|
14 |
|
15 | export type ReferenceType =
|
16 | | ConstantReference
|
17 | | ComputeReference
|
18 | | UnboundReference
|
19 | | InvokableReference;
|
20 |
|
21 | declare const REFERENCE: unique symbol;
|
22 | export type ReferenceSymbol = typeof REFERENCE;
|
23 |
|
24 | export interface Reference<T = unknown> {
|
25 | [REFERENCE]: ReferenceType;
|
26 | debugLabel?: string | undefined;
|
27 | compute: Nullable<() => T>;
|
28 | children: null | Map<string | Reference, Reference>;
|
29 | }
|