doxum 0.1.23 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -102
- package/dist/advanced.cjs +237 -2
- package/dist/advanced.cjs.map +1 -0
- package/dist/advanced.d.cts +90 -2
- package/dist/advanced.d.ts +90 -2
- package/dist/advanced.js +236 -1
- package/dist/advanced.js.map +1 -0
- package/dist/{contract-ULPQmiEs.d.ts → contract-CNR6BS75.d.cts} +216 -30
- package/dist/{contract-SYJFP0lM.d.cts → contract-COgxO5sv.d.ts} +216 -30
- package/dist/definition-CDOuvb5C.d.cts +111 -0
- package/dist/definition-xgk3YNBp.d.ts +111 -0
- package/dist/{driver-yFfvDMX5.js → driver-B5vdPohL.js} +59 -3
- package/dist/driver-B5vdPohL.js.map +1 -0
- package/dist/{driver-BD3DQOW6.cjs → driver-BL91gn7_.cjs} +107 -9
- package/dist/driver-BL91gn7_.cjs.map +1 -0
- package/dist/index.cjs +1637 -703
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -33
- package/dist/index.d.ts +65 -33
- package/dist/index.js +1432 -497
- package/dist/index.js.map +1 -1
- package/dist/local-sync.cjs +69 -103
- package/dist/local-sync.cjs.map +1 -1
- package/dist/local-sync.d.cts +14 -26
- package/dist/local-sync.d.ts +14 -26
- package/dist/local-sync.js +68 -96
- package/dist/local-sync.js.map +1 -1
- package/dist/react.cjs +4 -5
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +6 -8
- package/dist/react.d.ts +6 -8
- package/dist/react.js +4 -5
- package/dist/react.js.map +1 -1
- package/dist/record-B2yRhYsc.js +28 -0
- package/dist/record-B2yRhYsc.js.map +1 -0
- package/dist/record-ChYUi8PP.cjs +45 -0
- package/dist/record-ChYUi8PP.cjs.map +1 -0
- package/dist/scheduler--137L3j-.js +500 -0
- package/dist/scheduler--137L3j-.js.map +1 -0
- package/dist/scheduler-D4VthaaK.cjs +589 -0
- package/dist/scheduler-D4VthaaK.cjs.map +1 -0
- package/package.json +6 -3
- package/skills/doxum-runtime/SKILL.md +32 -7
- package/skills/doxum-runtime/agents/openai.yaml +1 -1
- package/skills/doxum-runtime/references/api.en.md +249 -0
- package/skills/doxum-runtime/references/api.zh-CN.md +242 -0
- package/skills/doxum-runtime/references/guide.en.md +18 -8
- package/skills/doxum-runtime/references/guide.zh-CN.md +14 -6
- package/skills/doxum-runtime/references/invariants.en.md +29 -5
- package/skills/doxum-runtime/references/invariants.zh-CN.md +24 -6
- package/skills/doxum-runtime/references/patterns.en.md +78 -18
- package/skills/doxum-runtime/references/patterns.zh-CN.md +76 -18
- package/skills/doxum-runtime/references/projections.en.md +209 -119
- package/skills/doxum-runtime/references/projections.zh-CN.md +200 -101
- package/dist/advanced-CLJCWkHa.d.cts +0 -176
- package/dist/advanced-CRNHfJBu.js +0 -1224
- package/dist/advanced-CRNHfJBu.js.map +0 -1
- package/dist/advanced-Cle5g3B4.cjs +0 -1517
- package/dist/advanced-Cle5g3B4.cjs.map +0 -1
- package/dist/advanced-d6J61er9.d.ts +0 -176
- package/dist/context-BcLKGfq8.cjs +0 -149
- package/dist/context-BcLKGfq8.cjs.map +0 -1
- package/dist/context-DFEaDUv5.js +0 -84
- package/dist/context-DFEaDUv5.js.map +0 -1
- package/dist/driver-BD3DQOW6.cjs.map +0 -1
- package/dist/driver-yFfvDMX5.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as table, A as ParseError, B as DocumentListConfig, C as Read, D as ChangeSet, E as Change, F as CollectionPath, G as ReadonlyValue, H as DocumentTreeValue, I as PathValueOf, J as field, K as Schema, L as SchemaPath, M as parse, N as CollectionEntry, O as MemberChange, P as CollectionId, Q as optional, R as DocumentAddress, S as Draft, T as snapshot, U as Infer, V as DocumentTreeNode, W as ObjectSchema, X as map, Y as list, Z as object, _ as Unsubscribe, a as DocumentProblem, b as CollectionImpact, c as HistoryState, d as OperationResult, et as tree, f as ReadonlyDocument, g as Readable, h as TransactionResult, i as DocumentDisposedError, j as ParseIssue, k as ValueTransition, l as LocalHistory, m as TransactionRejected, n as DocumentCommit, o as DocumentReentrancyError, p as Synchronous, q as Validator, r as DocumentDiagnostic, s as DocumentRuntime, t as CommitSource, tt as variant, u as ObserverError, v as MutationIssue, w as replace, x as DocumentImpact, y as MutationIssueCode, z as DocumentAnchor } from "./contract-CNR6BS75.cjs";
|
|
2
|
+
import { a as Projection, d as ExternalCollectionRead, f as ExternalCollectionSource, g as ProjectionError, h as ProjectionDisposedError, i as KeyedProjection, m as ExternalValueSource, n as CollectionInputDraft, p as ExternalValueEvent, r as Input, t as CollectionInput, u as ExternalCollectionEvent } from "./definition-CDOuvb5C.cjs";
|
|
3
3
|
|
|
4
4
|
//#region core/src/runtime.d.ts
|
|
5
|
-
declare const createDocument: <S extends
|
|
5
|
+
declare const createDocument: <S extends ObjectSchema<object>>(input: {
|
|
6
6
|
readonly schema: S;
|
|
7
7
|
readonly initial: Infer<S>;
|
|
8
8
|
readonly history?: {
|
|
@@ -10,49 +10,81 @@ declare const createDocument: <S extends ObjectNode>(input: {
|
|
|
10
10
|
} | false;
|
|
11
11
|
}) => DocumentRuntime<S>;
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region core/src/runtime/readable.d.ts
|
|
14
|
-
declare const asReadable: <TSchema extends ObjectNode>(runtime: DocumentRuntime<TSchema>) => DocumentReadable<TSchema>;
|
|
15
|
-
//#endregion
|
|
16
13
|
//#region core/src/runtime/select.d.ts
|
|
17
|
-
type DocumentSelector<TSchema extends
|
|
18
|
-
declare const read: <TSchema extends
|
|
19
|
-
declare const select: <TSchema extends
|
|
14
|
+
type DocumentSelector<TSchema extends ObjectSchema<object>, TResult> = (read: Read<TSchema>) => TResult;
|
|
15
|
+
declare const read: <TSchema extends ObjectSchema<object>, TResult>(document: ReadonlyDocument<TSchema>, selector: DocumentSelector<TSchema, TResult>) => TResult;
|
|
16
|
+
declare const select: <TSchema extends ObjectSchema<object>, TResult>(document: ReadonlyDocument<TSchema>, selector: DocumentSelector<TSchema, TResult>, equality?: (previous: TResult, next: TResult) => boolean) => Readable<TResult>;
|
|
20
17
|
//#endregion
|
|
21
|
-
//#region core/src/projection/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
//#region core/src/projection/input.d.ts
|
|
19
|
+
declare const input: (<T>(initial: T, equality?: (previous: T, next: T) => boolean) => Input<T>) & {
|
|
20
|
+
collection: <K extends string, V>(initial?: ReadonlyMap<K, V>, equality?: (previous: V, next: V) => boolean) => CollectionInput<K, V>;
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region core/src/projection/observe.d.ts
|
|
24
|
+
/** Establish a lazy reactive boundary from a document, readable, or external source. */
|
|
25
|
+
declare function observe<S extends ObjectSchema<object>>(document: ReadonlyDocument<S>): Projection<Infer<S>>;
|
|
26
|
+
declare function observe<T>(source: ExternalValueSource<T>): Projection<T>;
|
|
27
|
+
declare function observe<K extends string, V>(source: ExternalCollectionSource<K, V>): KeyedProjection<K, V>;
|
|
28
|
+
declare function observe<T>(readable: Readable<T>): Projection<T>;
|
|
29
|
+
declare function observe<S extends ObjectSchema<object>, P extends CollectionPath>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P): KeyedProjection<CollectionId<P>, ReadonlyValue<CollectionEntry<P>>>;
|
|
30
|
+
declare function observe<S extends ObjectSchema<object>, P>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P): Projection<PathValueOf<P>>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region core/src/projection/derive.d.ts
|
|
33
|
+
type ProjectionDependencies = Readonly<Record<string, Projection<unknown>>>;
|
|
34
|
+
type ProjectionValues<D extends ProjectionDependencies> = { readonly [K in keyof D]: D[K] extends Projection<infer T> ? T : never };
|
|
35
|
+
type Equality<T> = (previous: T, next: T) => boolean;
|
|
36
|
+
/** A declared dynamic lookup from one driver entry to one key in another keyed projection. */
|
|
37
|
+
type KeyedDependency<DriverKey extends string, DriverValue, SourceKey extends string = string, SourceValue = unknown> = {
|
|
38
|
+
readonly source: KeyedProjection<SourceKey, SourceValue>;
|
|
39
|
+
readonly key: (value: DriverValue, key: DriverKey) => Synchronous<SourceKey | undefined>;
|
|
27
40
|
};
|
|
41
|
+
type KeyedDeriveDependency<K extends string, V> = (Projection<unknown> & {
|
|
42
|
+
readonly source?: never;
|
|
43
|
+
readonly key?: never;
|
|
44
|
+
}) | KeyedDependency<K, V, string, unknown>;
|
|
45
|
+
type KeyedDeriveDependencies<K extends string, V, D extends object> = { readonly [P in keyof D]: P extends string ? KeyedDeriveDependency<K, V> : never };
|
|
46
|
+
type KeyedDependencyValues<D extends Readonly<Record<string, unknown>>> = { readonly [P in keyof D]: D[P] extends {
|
|
47
|
+
readonly source: KeyedProjection<infer _K extends string, infer V>;
|
|
48
|
+
} ? V | undefined : D[P] extends Projection<infer T> ? T : never };
|
|
49
|
+
declare function createValueDerive<const D extends ProjectionDependencies, T>(dependencies: D, compute: (values: ProjectionValues<D>) => Synchronous<T>, equality?: Equality<T>): Projection<T>;
|
|
50
|
+
declare function createKeyedDerive<K extends string, V, T>(source: KeyedProjection<K, V>, select: (value: V, key: K) => Synchronous<T>, equality?: Equality<T>): KeyedProjection<K, T>;
|
|
51
|
+
declare function createKeyedDerive<K extends string, V, const D extends object & KeyedDeriveDependencies<K, V, D>, T>(source: KeyedProjection<K, V>, dependencies: D, select: (value: V, key: K, dependencies: KeyedDependencyValues<D>) => Synchronous<T>, equality?: Equality<T>): KeyedProjection<K, T>;
|
|
52
|
+
declare const derive: typeof createValueDerive & {
|
|
53
|
+
keyed: typeof createKeyedDerive;
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region core/src/projection/runtime.d.ts
|
|
28
57
|
type ProjectionRuntime = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
update<K extends string, V>(input:
|
|
34
|
-
batch<T>(run: () => T
|
|
35
|
-
batch<T>(options: {
|
|
58
|
+
read<T>(projection: Projection<T>): T;
|
|
59
|
+
select<T>(projection: Projection<T>): Readable<T>;
|
|
60
|
+
select<T, R>(projection: Projection<T>, selector: (value: T) => R, equality?: (previous: R, next: R) => boolean): Readable<R>;
|
|
61
|
+
update<T>(input: Input<T>, value: T): void;
|
|
62
|
+
update<K extends string, V>(input: CollectionInput<K, V>, run: (draft: CollectionInputDraft<K, V>) => void): void;
|
|
63
|
+
batch<T>(run: () => T, options?: {
|
|
36
64
|
readonly cause?: unknown;
|
|
37
|
-
}
|
|
65
|
+
}): T;
|
|
38
66
|
scope(): ProjectionScope;
|
|
39
67
|
dispose(): void;
|
|
40
68
|
};
|
|
69
|
+
type ProjectionOwnershipTree = {
|
|
70
|
+
readonly [name: string]: Projection<unknown> | ProjectionOwnershipTree;
|
|
71
|
+
};
|
|
41
72
|
type ProjectionScope = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
own<P extends Projection<unknown>>(projection: P): P;
|
|
74
|
+
own<T extends ProjectionOwnershipTree>(tree: T): T;
|
|
75
|
+
read<T>(projection: Projection<T>): T;
|
|
76
|
+
select<T>(projection: Projection<T>): Readable<T>;
|
|
77
|
+
select<T, R>(projection: Projection<T>, selector: (value: T) => R, equality?: (previous: R, next: R) => boolean): Readable<R>;
|
|
78
|
+
update<T>(input: Input<T>, value: T): void;
|
|
79
|
+
update<K extends string, V>(input: CollectionInput<K, V>, run: (draft: CollectionInputDraft<K, V>) => void): void;
|
|
80
|
+
batch<T>(run: () => T, options?: {
|
|
81
|
+
readonly cause?: unknown;
|
|
82
|
+
}): T;
|
|
51
83
|
dispose(): void;
|
|
52
84
|
};
|
|
53
85
|
declare const createProjectionRuntime: (options?: {
|
|
54
86
|
readonly onError?: (error: ProjectionError) => void;
|
|
55
87
|
}) => ProjectionRuntime;
|
|
56
88
|
//#endregion
|
|
57
|
-
export { type Change, type ChangeSet, type
|
|
89
|
+
export { type Change, type ChangeSet, type CollectionImpact, type CollectionInput, type CollectionInputDraft, type CommitSource, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentProblem, DocumentReentrancyError, type DocumentRuntime, type DocumentSelector, type DocumentTreeNode, type DocumentTreeValue, type Draft, type ExternalCollectionEvent, type ExternalCollectionRead, type ExternalCollectionSource, type ExternalValueEvent, type ExternalValueSource, type HistoryState, type Infer, type Input, type KeyedProjection, type LocalHistory, type MemberChange, type MutationIssue, type MutationIssueCode, type ObjectSchema, type ObserverError, type OperationResult, ParseError, type ParseIssue, type PathValueOf, type Projection, ProjectionDisposedError, ProjectionError, type ProjectionRuntime, type ProjectionScope, type Read, type Readable, type ReadonlyDocument, type ReadonlyValue, type Schema, type SchemaPath, TransactionRejected, type TransactionResult, type Unsubscribe, type Validator, type ValueTransition, createDocument, createProjectionRuntime, derive, field, input, list, map, object, observe, optional, parse, read, replace, select, snapshot, table, tree, variant };
|
|
58
90
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as table, A as ParseError, B as DocumentListConfig, C as Read, D as ChangeSet, E as Change, F as CollectionPath, G as ReadonlyValue, H as DocumentTreeValue, I as PathValueOf, J as field, K as Schema, L as SchemaPath, M as parse, N as CollectionEntry, O as MemberChange, P as CollectionId, Q as optional, R as DocumentAddress, S as Draft, T as snapshot, U as Infer, V as DocumentTreeNode, W as ObjectSchema, X as map, Y as list, Z as object, _ as Unsubscribe, a as DocumentProblem, b as CollectionImpact, c as HistoryState, d as OperationResult, et as tree, f as ReadonlyDocument, g as Readable, h as TransactionResult, i as DocumentDisposedError, j as ParseIssue, k as ValueTransition, l as LocalHistory, m as TransactionRejected, n as DocumentCommit, o as DocumentReentrancyError, p as Synchronous, q as Validator, r as DocumentDiagnostic, s as DocumentRuntime, t as CommitSource, tt as variant, u as ObserverError, v as MutationIssue, w as replace, x as DocumentImpact, y as MutationIssueCode, z as DocumentAnchor } from "./contract-COgxO5sv.js";
|
|
2
|
+
import { a as Projection, d as ExternalCollectionRead, f as ExternalCollectionSource, g as ProjectionError, h as ProjectionDisposedError, i as KeyedProjection, m as ExternalValueSource, n as CollectionInputDraft, p as ExternalValueEvent, r as Input, t as CollectionInput, u as ExternalCollectionEvent } from "./definition-xgk3YNBp.js";
|
|
3
3
|
|
|
4
4
|
//#region core/src/runtime.d.ts
|
|
5
|
-
declare const createDocument: <S extends
|
|
5
|
+
declare const createDocument: <S extends ObjectSchema<object>>(input: {
|
|
6
6
|
readonly schema: S;
|
|
7
7
|
readonly initial: Infer<S>;
|
|
8
8
|
readonly history?: {
|
|
@@ -10,49 +10,81 @@ declare const createDocument: <S extends ObjectNode>(input: {
|
|
|
10
10
|
} | false;
|
|
11
11
|
}) => DocumentRuntime<S>;
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region core/src/runtime/readable.d.ts
|
|
14
|
-
declare const asReadable: <TSchema extends ObjectNode>(runtime: DocumentRuntime<TSchema>) => DocumentReadable<TSchema>;
|
|
15
|
-
//#endregion
|
|
16
13
|
//#region core/src/runtime/select.d.ts
|
|
17
|
-
type DocumentSelector<TSchema extends
|
|
18
|
-
declare const read: <TSchema extends
|
|
19
|
-
declare const select: <TSchema extends
|
|
14
|
+
type DocumentSelector<TSchema extends ObjectSchema<object>, TResult> = (read: Read<TSchema>) => TResult;
|
|
15
|
+
declare const read: <TSchema extends ObjectSchema<object>, TResult>(document: ReadonlyDocument<TSchema>, selector: DocumentSelector<TSchema, TResult>) => TResult;
|
|
16
|
+
declare const select: <TSchema extends ObjectSchema<object>, TResult>(document: ReadonlyDocument<TSchema>, selector: DocumentSelector<TSchema, TResult>, equality?: (previous: TResult, next: TResult) => boolean) => Readable<TResult>;
|
|
20
17
|
//#endregion
|
|
21
|
-
//#region core/src/projection/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
//#region core/src/projection/input.d.ts
|
|
19
|
+
declare const input: (<T>(initial: T, equality?: (previous: T, next: T) => boolean) => Input<T>) & {
|
|
20
|
+
collection: <K extends string, V>(initial?: ReadonlyMap<K, V>, equality?: (previous: V, next: V) => boolean) => CollectionInput<K, V>;
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region core/src/projection/observe.d.ts
|
|
24
|
+
/** Establish a lazy reactive boundary from a document, readable, or external source. */
|
|
25
|
+
declare function observe<S extends ObjectSchema<object>>(document: ReadonlyDocument<S>): Projection<Infer<S>>;
|
|
26
|
+
declare function observe<T>(source: ExternalValueSource<T>): Projection<T>;
|
|
27
|
+
declare function observe<K extends string, V>(source: ExternalCollectionSource<K, V>): KeyedProjection<K, V>;
|
|
28
|
+
declare function observe<T>(readable: Readable<T>): Projection<T>;
|
|
29
|
+
declare function observe<S extends ObjectSchema<object>, P extends CollectionPath>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P): KeyedProjection<CollectionId<P>, ReadonlyValue<CollectionEntry<P>>>;
|
|
30
|
+
declare function observe<S extends ObjectSchema<object>, P>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P): Projection<PathValueOf<P>>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region core/src/projection/derive.d.ts
|
|
33
|
+
type ProjectionDependencies = Readonly<Record<string, Projection<unknown>>>;
|
|
34
|
+
type ProjectionValues<D extends ProjectionDependencies> = { readonly [K in keyof D]: D[K] extends Projection<infer T> ? T : never };
|
|
35
|
+
type Equality<T> = (previous: T, next: T) => boolean;
|
|
36
|
+
/** A declared dynamic lookup from one driver entry to one key in another keyed projection. */
|
|
37
|
+
type KeyedDependency<DriverKey extends string, DriverValue, SourceKey extends string = string, SourceValue = unknown> = {
|
|
38
|
+
readonly source: KeyedProjection<SourceKey, SourceValue>;
|
|
39
|
+
readonly key: (value: DriverValue, key: DriverKey) => Synchronous<SourceKey | undefined>;
|
|
27
40
|
};
|
|
41
|
+
type KeyedDeriveDependency<K extends string, V> = (Projection<unknown> & {
|
|
42
|
+
readonly source?: never;
|
|
43
|
+
readonly key?: never;
|
|
44
|
+
}) | KeyedDependency<K, V, string, unknown>;
|
|
45
|
+
type KeyedDeriveDependencies<K extends string, V, D extends object> = { readonly [P in keyof D]: P extends string ? KeyedDeriveDependency<K, V> : never };
|
|
46
|
+
type KeyedDependencyValues<D extends Readonly<Record<string, unknown>>> = { readonly [P in keyof D]: D[P] extends {
|
|
47
|
+
readonly source: KeyedProjection<infer _K extends string, infer V>;
|
|
48
|
+
} ? V | undefined : D[P] extends Projection<infer T> ? T : never };
|
|
49
|
+
declare function createValueDerive<const D extends ProjectionDependencies, T>(dependencies: D, compute: (values: ProjectionValues<D>) => Synchronous<T>, equality?: Equality<T>): Projection<T>;
|
|
50
|
+
declare function createKeyedDerive<K extends string, V, T>(source: KeyedProjection<K, V>, select: (value: V, key: K) => Synchronous<T>, equality?: Equality<T>): KeyedProjection<K, T>;
|
|
51
|
+
declare function createKeyedDerive<K extends string, V, const D extends object & KeyedDeriveDependencies<K, V, D>, T>(source: KeyedProjection<K, V>, dependencies: D, select: (value: V, key: K, dependencies: KeyedDependencyValues<D>) => Synchronous<T>, equality?: Equality<T>): KeyedProjection<K, T>;
|
|
52
|
+
declare const derive: typeof createValueDerive & {
|
|
53
|
+
keyed: typeof createKeyedDerive;
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region core/src/projection/runtime.d.ts
|
|
28
57
|
type ProjectionRuntime = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
update<K extends string, V>(input:
|
|
34
|
-
batch<T>(run: () => T
|
|
35
|
-
batch<T>(options: {
|
|
58
|
+
read<T>(projection: Projection<T>): T;
|
|
59
|
+
select<T>(projection: Projection<T>): Readable<T>;
|
|
60
|
+
select<T, R>(projection: Projection<T>, selector: (value: T) => R, equality?: (previous: R, next: R) => boolean): Readable<R>;
|
|
61
|
+
update<T>(input: Input<T>, value: T): void;
|
|
62
|
+
update<K extends string, V>(input: CollectionInput<K, V>, run: (draft: CollectionInputDraft<K, V>) => void): void;
|
|
63
|
+
batch<T>(run: () => T, options?: {
|
|
36
64
|
readonly cause?: unknown;
|
|
37
|
-
}
|
|
65
|
+
}): T;
|
|
38
66
|
scope(): ProjectionScope;
|
|
39
67
|
dispose(): void;
|
|
40
68
|
};
|
|
69
|
+
type ProjectionOwnershipTree = {
|
|
70
|
+
readonly [name: string]: Projection<unknown> | ProjectionOwnershipTree;
|
|
71
|
+
};
|
|
41
72
|
type ProjectionScope = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
own<P extends Projection<unknown>>(projection: P): P;
|
|
74
|
+
own<T extends ProjectionOwnershipTree>(tree: T): T;
|
|
75
|
+
read<T>(projection: Projection<T>): T;
|
|
76
|
+
select<T>(projection: Projection<T>): Readable<T>;
|
|
77
|
+
select<T, R>(projection: Projection<T>, selector: (value: T) => R, equality?: (previous: R, next: R) => boolean): Readable<R>;
|
|
78
|
+
update<T>(input: Input<T>, value: T): void;
|
|
79
|
+
update<K extends string, V>(input: CollectionInput<K, V>, run: (draft: CollectionInputDraft<K, V>) => void): void;
|
|
80
|
+
batch<T>(run: () => T, options?: {
|
|
81
|
+
readonly cause?: unknown;
|
|
82
|
+
}): T;
|
|
51
83
|
dispose(): void;
|
|
52
84
|
};
|
|
53
85
|
declare const createProjectionRuntime: (options?: {
|
|
54
86
|
readonly onError?: (error: ProjectionError) => void;
|
|
55
87
|
}) => ProjectionRuntime;
|
|
56
88
|
//#endregion
|
|
57
|
-
export { type Change, type ChangeSet, type
|
|
89
|
+
export { type Change, type ChangeSet, type CollectionImpact, type CollectionInput, type CollectionInputDraft, type CommitSource, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentProblem, DocumentReentrancyError, type DocumentRuntime, type DocumentSelector, type DocumentTreeNode, type DocumentTreeValue, type Draft, type ExternalCollectionEvent, type ExternalCollectionRead, type ExternalCollectionSource, type ExternalValueEvent, type ExternalValueSource, type HistoryState, type Infer, type Input, type KeyedProjection, type LocalHistory, type MemberChange, type MutationIssue, type MutationIssueCode, type ObjectSchema, type ObserverError, type OperationResult, ParseError, type ParseIssue, type PathValueOf, type Projection, ProjectionDisposedError, ProjectionError, type ProjectionRuntime, type ProjectionScope, type Read, type Readable, type ReadonlyDocument, type ReadonlyValue, type Schema, type SchemaPath, TransactionRejected, type TransactionResult, type Unsubscribe, type Validator, type ValueTransition, createDocument, createProjectionRuntime, derive, field, input, list, map, object, observe, optional, parse, read, replace, select, snapshot, table, tree, variant };
|
|
58
90
|
//# sourceMappingURL=index.d.ts.map
|