1 | import { Nullable, Reference, ReferenceSymbol } from "@glimmer/interfaces";
|
2 | declare const REFERENCE: ReferenceSymbol;
|
3 |
|
4 | interface ReferenceEnvironment {
|
5 | getProp(obj: unknown, path: string): unknown;
|
6 | setProp(obj: unknown, path: string, value: unknown): unknown;
|
7 | }
|
8 | declare function createPrimitiveRef<T extends string | symbol | number | boolean | null | undefined>(value: T): Reference<T>;
|
9 | declare const UNDEFINED_REFERENCE: Reference<any>;
|
10 | declare const NULL_REFERENCE: Reference<any>;
|
11 | declare const TRUE_REFERENCE: Reference<true>;
|
12 | declare const FALSE_REFERENCE: Reference<false>;
|
13 | declare function createConstRef<T>(value: T, debugLabel: false | string): Reference<T>;
|
14 | declare function createUnboundRef<T>(value: T, debugLabel: false | string): Reference<T>;
|
15 | declare function createComputeRef<T = unknown>(compute: () => T, update?: Nullable<(value: T) => void>, debugLabel?: false | string): Reference<T>;
|
16 | declare function createReadOnlyRef(ref: Reference): Reference;
|
17 | declare function isInvokableRef(ref: Reference): boolean;
|
18 | declare function createInvokableRef(inner: Reference): Reference;
|
19 | declare function isConstRef(_ref: Reference): boolean;
|
20 | declare function isUpdatableRef(_ref: Reference): boolean;
|
21 | declare function valueForRef<T>(_ref: Reference<T>): T;
|
22 | declare function updateRef(_ref: Reference, value: unknown): void;
|
23 | declare function childRefFor(_parentRef: Reference, path: string): Reference;
|
24 | declare function childRefFromParts(root: Reference, parts: string[]): Reference;
|
25 | declare let createDebugAliasRef: undefined | ((debugLabel: string, inner: Reference) => Reference);
|
26 | interface IterationItem<T, U> {
|
27 | key: unknown;
|
28 | value: T;
|
29 | memo: U;
|
30 | }
|
31 | interface AbstractIterator<T, U, V extends IterationItem<T, U>> {
|
32 | isEmpty(): boolean;
|
33 | next(): Nullable<V>;
|
34 | }
|
35 | type OpaqueIterationItem = IterationItem<unknown, unknown>;
|
36 | type OpaqueIterator = AbstractIterator<unknown, unknown, OpaqueIterationItem>;
|
37 | interface IteratorDelegate {
|
38 | isEmpty(): boolean;
|
39 | next(): {
|
40 | value: unknown;
|
41 | memo: unknown;
|
42 | } | null;
|
43 | }
|
44 | type KeyFor = (item: unknown, index: unknown) => unknown;
|
45 | declare function createIteratorRef(listRef: Reference, key: string): Reference<ArrayIterator | IteratorWrapper>;
|
46 | declare function createIteratorItemRef(_value: unknown): Reference<unknown>;
|
47 | declare class IteratorWrapper implements OpaqueIterator {
|
48 | private inner;
|
49 | private keyFor;
|
50 | constructor(inner: IteratorDelegate, keyFor: KeyFor);
|
51 | isEmpty(): boolean;
|
52 | next(): OpaqueIterationItem;
|
53 | }
|
54 | declare class ArrayIterator implements OpaqueIterator {
|
55 | private iterator;
|
56 | private keyFor;
|
57 | private current;
|
58 | private pos;
|
59 | constructor(iterator: unknown[] | readonly unknown[], keyFor: KeyFor);
|
60 | isEmpty(): boolean;
|
61 | next(): Nullable<IterationItem<unknown, number>>;
|
62 | }
|
63 | export { AbstractIterator, createIteratorItemRef, createIteratorRef, IterationItem, IteratorDelegate, OpaqueIterationItem, OpaqueIterator, childRefFor, childRefFromParts, createComputeRef, createConstRef, createDebugAliasRef, createInvokableRef, createPrimitiveRef, createReadOnlyRef, createUnboundRef, FALSE_REFERENCE, isConstRef, isInvokableRef, isUpdatableRef, NULL_REFERENCE, REFERENCE, Reference, ReferenceEnvironment, TRUE_REFERENCE, UNDEFINED_REFERENCE, updateRef, valueForRef };
|
64 |
|
\ | No newline at end of file |