doxum 0.1.26 → 0.1.28
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 +86 -3
- package/dist/advanced.cjs +40 -30
- package/dist/advanced.cjs.map +1 -1
- package/dist/advanced.d.cts +34 -2
- package/dist/advanced.d.ts +34 -2
- package/dist/advanced.js +31 -22
- package/dist/advanced.js.map +1 -1
- package/dist/{definition-xgk3YNBp.d.ts → dependency-B3E65M1E.d.cts} +27 -3
- package/dist/{definition-CDOuvb5C.d.cts → dependency-BYbdDHNa.d.ts} +27 -3
- package/dist/driver-B5vdPohL.js.map +1 -1
- package/dist/driver-BL91gn7_.cjs.map +1 -1
- package/dist/index.cjs +885 -394
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -18
- package/dist/index.d.ts +33 -18
- package/dist/index.js +784 -293
- package/dist/index.js.map +1 -1
- package/dist/local-sync.cjs.map +1 -1
- package/dist/local-sync.js.map +1 -1
- package/dist/transform-B4T3AcJr.js +938 -0
- package/dist/transform-B4T3AcJr.js.map +1 -0
- package/dist/transform-DUleAsG0.cjs +1105 -0
- package/dist/transform-DUleAsG0.cjs.map +1 -0
- package/package.json +1 -1
- package/skills/doxum-runtime/SKILL.md +16 -6
- package/skills/doxum-runtime/references/api.en.md +49 -15
- package/skills/doxum-runtime/references/api.zh-CN.md +47 -13
- package/skills/doxum-runtime/references/guide.en.md +2 -1
- package/skills/doxum-runtime/references/guide.zh-CN.md +2 -1
- package/skills/doxum-runtime/references/invariants.en.md +2 -2
- package/skills/doxum-runtime/references/invariants.zh-CN.md +2 -2
- package/skills/doxum-runtime/references/patterns.en.md +1 -1
- package/skills/doxum-runtime/references/patterns.zh-CN.md +1 -1
- package/skills/doxum-runtime/references/projections.en.md +77 -4
- package/skills/doxum-runtime/references/projections.zh-CN.md +74 -3
- package/dist/scheduler--137L3j-.js +0 -500
- package/dist/scheduler--137L3j-.js.map +0 -1
- package/dist/scheduler-D4VthaaK.cjs +0 -589
- package/dist/scheduler-D4VthaaK.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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 {
|
|
2
|
+
import { _ as ProjectionDisposedError, a as Input, f as ExternalCollectionEvent, g as ExternalValueSource, h as ExternalValueEvent, i as CollectionInputDraft, m as ExternalCollectionSource, n as KeyedDependencyValues, o as KeyedProjection, p as ExternalCollectionRead, r as CollectionInput, s as Projection, t as KeyedDependencies, v as ProjectionError } from "./dependency-B3E65M1E.cjs";
|
|
3
3
|
|
|
4
4
|
//#region core/src/runtime.d.ts
|
|
5
5
|
declare const createDocument: <S extends ObjectSchema<object>>(input: {
|
|
@@ -33,24 +33,37 @@ declare function observe<S extends ObjectSchema<object>, P>(document: ReadonlyDo
|
|
|
33
33
|
type ProjectionDependencies = Readonly<Record<string, Projection<unknown>>>;
|
|
34
34
|
type ProjectionValues<D extends ProjectionDependencies> = { readonly [K in keyof D]: D[K] extends Projection<infer T> ? T : never };
|
|
35
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>;
|
|
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
36
|
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
37
|
declare const derive: typeof createValueDerive & {
|
|
53
|
-
keyed:
|
|
38
|
+
keyed: {
|
|
39
|
+
<K extends string, V, T>(source: KeyedProjection<K, V>, select: (value: NoInfer<V>, key: NoInfer<K>) => Synchronous<T>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
40
|
+
<K extends string, V, const D extends object, T>(source: KeyedProjection<K, V>, dependencies: D & KeyedDependencies<NoInfer<K>, NoInfer<V>, D>, select: (value: NoInfer<V>, key: NoInfer<K>, dependencies: KeyedDependencyValues<D>) => Synchronous<T>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
41
|
+
} & {
|
|
42
|
+
keys: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly K[]>;
|
|
43
|
+
values: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly V[]>;
|
|
44
|
+
entries: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly (readonly [K, V])[]>;
|
|
45
|
+
get: <K extends string, V>(source: KeyedProjection<K, V>, key: Projection<NoInfer<K> | undefined>, equality?: (previous: V | undefined, next: V | undefined) => boolean) => Projection<V | undefined>;
|
|
46
|
+
groupBy: {
|
|
47
|
+
<K extends string, V, G extends string>(source: KeyedProjection<K, V>, selector: (value: NoInfer<V>, key: NoInfer<K>) => Synchronous<G | readonly G[]>): KeyedProjection<G, readonly K[]>;
|
|
48
|
+
<K extends string, V, const D extends object, G extends string>(source: KeyedProjection<K, V>, dependencies: D & KeyedDependencies<NoInfer<K>, NoInfer<V>, D>, selector: (value: NoInfer<V>, key: NoInfer<K>, dependencies: KeyedDependencyValues<D>) => Synchronous<G | readonly G[]>): KeyedProjection<G, readonly K[]>;
|
|
49
|
+
};
|
|
50
|
+
singleton: <K extends string, V>(source: Projection<V | undefined>, keyOf: (value: V) => Synchronous<K>, equality?: (previous: V, next: V) => boolean) => KeyedProjection<K, V>;
|
|
51
|
+
subset: <K extends string, V>(source: KeyedProjection<K, V>, orderedKeys: Projection<readonly K[]> | readonly K[]) => KeyedProjection<K, V>;
|
|
52
|
+
filter: {
|
|
53
|
+
<K extends string, V>(source: KeyedProjection<K, V>, predicate: (value: NoInfer<V>, key: NoInfer<K>) => Synchronous<boolean>): KeyedProjection<K, V>;
|
|
54
|
+
<K extends string, V, const D extends object>(source: KeyedProjection<K, V>, dependencies: D & KeyedDependencies<NoInfer<K>, NoInfer<V>, D>, predicate: (value: NoInfer<V>, key: NoInfer<K>, dependencies: KeyedDependencyValues<D>) => Synchronous<boolean>): KeyedProjection<K, V>;
|
|
55
|
+
};
|
|
56
|
+
compact: {
|
|
57
|
+
<K extends string, V, T>(source: KeyedProjection<K, V>, select: (value: NoInfer<V>, key: NoInfer<K>) => Synchronous<T | undefined>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
58
|
+
<K extends string, V, const D extends object, T>(source: KeyedProjection<K, V>, dependencies: D & KeyedDependencies<NoInfer<K>, NoInfer<V>, D>, select: (value: NoInfer<V>, key: NoInfer<K>, dependencies: KeyedDependencyValues<D>) => Synchronous<T | undefined>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region core/src/projection/readable/keyed.d.ts
|
|
64
|
+
type ProjectionItems<K extends string, V> = {
|
|
65
|
+
readonly keys: Readable<readonly K[]>;
|
|
66
|
+
get(key: K): Readable<V | undefined>;
|
|
54
67
|
};
|
|
55
68
|
//#endregion
|
|
56
69
|
//#region core/src/projection/runtime.d.ts
|
|
@@ -58,6 +71,7 @@ type ProjectionRuntime = {
|
|
|
58
71
|
read<T>(projection: Projection<T>): T;
|
|
59
72
|
select<T>(projection: Projection<T>): Readable<T>;
|
|
60
73
|
select<T, R>(projection: Projection<T>, selector: (value: T) => R, equality?: (previous: R, next: R) => boolean): Readable<R>;
|
|
74
|
+
items<K extends string, V>(projection: KeyedProjection<K, V>): ProjectionItems<K, V>;
|
|
61
75
|
update<T>(input: Input<T>, value: T): void;
|
|
62
76
|
update<K extends string, V>(input: CollectionInput<K, V>, run: (draft: CollectionInputDraft<K, V>) => void): void;
|
|
63
77
|
batch<T>(run: () => T, options?: {
|
|
@@ -75,6 +89,7 @@ type ProjectionScope = {
|
|
|
75
89
|
read<T>(projection: Projection<T>): T;
|
|
76
90
|
select<T>(projection: Projection<T>): Readable<T>;
|
|
77
91
|
select<T, R>(projection: Projection<T>, selector: (value: T) => R, equality?: (previous: R, next: R) => boolean): Readable<R>;
|
|
92
|
+
items<K extends string, V>(projection: KeyedProjection<K, V>): ProjectionItems<K, V>;
|
|
78
93
|
update<T>(input: Input<T>, value: T): void;
|
|
79
94
|
update<K extends string, V>(input: CollectionInput<K, V>, run: (draft: CollectionInputDraft<K, V>) => void): void;
|
|
80
95
|
batch<T>(run: () => T, options?: {
|
|
@@ -86,5 +101,5 @@ declare const createProjectionRuntime: (options?: {
|
|
|
86
101
|
readonly onError?: (error: ProjectionError) => void;
|
|
87
102
|
}) => ProjectionRuntime;
|
|
88
103
|
//#endregion
|
|
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 };
|
|
104
|
+
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 ProjectionItems, 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 };
|
|
90
105
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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 {
|
|
2
|
+
import { _ as ProjectionDisposedError, a as Input, f as ExternalCollectionEvent, g as ExternalValueSource, h as ExternalValueEvent, i as CollectionInputDraft, m as ExternalCollectionSource, n as KeyedDependencyValues, o as KeyedProjection, p as ExternalCollectionRead, r as CollectionInput, s as Projection, t as KeyedDependencies, v as ProjectionError } from "./dependency-BYbdDHNa.js";
|
|
3
3
|
|
|
4
4
|
//#region core/src/runtime.d.ts
|
|
5
5
|
declare const createDocument: <S extends ObjectSchema<object>>(input: {
|
|
@@ -33,24 +33,37 @@ declare function observe<S extends ObjectSchema<object>, P>(document: ReadonlyDo
|
|
|
33
33
|
type ProjectionDependencies = Readonly<Record<string, Projection<unknown>>>;
|
|
34
34
|
type ProjectionValues<D extends ProjectionDependencies> = { readonly [K in keyof D]: D[K] extends Projection<infer T> ? T : never };
|
|
35
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>;
|
|
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
36
|
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
37
|
declare const derive: typeof createValueDerive & {
|
|
53
|
-
keyed:
|
|
38
|
+
keyed: {
|
|
39
|
+
<K extends string, V, T>(source: KeyedProjection<K, V>, select: (value: NoInfer<V>, key: NoInfer<K>) => Synchronous<T>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
40
|
+
<K extends string, V, const D extends object, T>(source: KeyedProjection<K, V>, dependencies: D & KeyedDependencies<NoInfer<K>, NoInfer<V>, D>, select: (value: NoInfer<V>, key: NoInfer<K>, dependencies: KeyedDependencyValues<D>) => Synchronous<T>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
41
|
+
} & {
|
|
42
|
+
keys: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly K[]>;
|
|
43
|
+
values: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly V[]>;
|
|
44
|
+
entries: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly (readonly [K, V])[]>;
|
|
45
|
+
get: <K extends string, V>(source: KeyedProjection<K, V>, key: Projection<NoInfer<K> | undefined>, equality?: (previous: V | undefined, next: V | undefined) => boolean) => Projection<V | undefined>;
|
|
46
|
+
groupBy: {
|
|
47
|
+
<K extends string, V, G extends string>(source: KeyedProjection<K, V>, selector: (value: NoInfer<V>, key: NoInfer<K>) => Synchronous<G | readonly G[]>): KeyedProjection<G, readonly K[]>;
|
|
48
|
+
<K extends string, V, const D extends object, G extends string>(source: KeyedProjection<K, V>, dependencies: D & KeyedDependencies<NoInfer<K>, NoInfer<V>, D>, selector: (value: NoInfer<V>, key: NoInfer<K>, dependencies: KeyedDependencyValues<D>) => Synchronous<G | readonly G[]>): KeyedProjection<G, readonly K[]>;
|
|
49
|
+
};
|
|
50
|
+
singleton: <K extends string, V>(source: Projection<V | undefined>, keyOf: (value: V) => Synchronous<K>, equality?: (previous: V, next: V) => boolean) => KeyedProjection<K, V>;
|
|
51
|
+
subset: <K extends string, V>(source: KeyedProjection<K, V>, orderedKeys: Projection<readonly K[]> | readonly K[]) => KeyedProjection<K, V>;
|
|
52
|
+
filter: {
|
|
53
|
+
<K extends string, V>(source: KeyedProjection<K, V>, predicate: (value: NoInfer<V>, key: NoInfer<K>) => Synchronous<boolean>): KeyedProjection<K, V>;
|
|
54
|
+
<K extends string, V, const D extends object>(source: KeyedProjection<K, V>, dependencies: D & KeyedDependencies<NoInfer<K>, NoInfer<V>, D>, predicate: (value: NoInfer<V>, key: NoInfer<K>, dependencies: KeyedDependencyValues<D>) => Synchronous<boolean>): KeyedProjection<K, V>;
|
|
55
|
+
};
|
|
56
|
+
compact: {
|
|
57
|
+
<K extends string, V, T>(source: KeyedProjection<K, V>, select: (value: NoInfer<V>, key: NoInfer<K>) => Synchronous<T | undefined>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
58
|
+
<K extends string, V, const D extends object, T>(source: KeyedProjection<K, V>, dependencies: D & KeyedDependencies<NoInfer<K>, NoInfer<V>, D>, select: (value: NoInfer<V>, key: NoInfer<K>, dependencies: KeyedDependencyValues<D>) => Synchronous<T | undefined>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region core/src/projection/readable/keyed.d.ts
|
|
64
|
+
type ProjectionItems<K extends string, V> = {
|
|
65
|
+
readonly keys: Readable<readonly K[]>;
|
|
66
|
+
get(key: K): Readable<V | undefined>;
|
|
54
67
|
};
|
|
55
68
|
//#endregion
|
|
56
69
|
//#region core/src/projection/runtime.d.ts
|
|
@@ -58,6 +71,7 @@ type ProjectionRuntime = {
|
|
|
58
71
|
read<T>(projection: Projection<T>): T;
|
|
59
72
|
select<T>(projection: Projection<T>): Readable<T>;
|
|
60
73
|
select<T, R>(projection: Projection<T>, selector: (value: T) => R, equality?: (previous: R, next: R) => boolean): Readable<R>;
|
|
74
|
+
items<K extends string, V>(projection: KeyedProjection<K, V>): ProjectionItems<K, V>;
|
|
61
75
|
update<T>(input: Input<T>, value: T): void;
|
|
62
76
|
update<K extends string, V>(input: CollectionInput<K, V>, run: (draft: CollectionInputDraft<K, V>) => void): void;
|
|
63
77
|
batch<T>(run: () => T, options?: {
|
|
@@ -75,6 +89,7 @@ type ProjectionScope = {
|
|
|
75
89
|
read<T>(projection: Projection<T>): T;
|
|
76
90
|
select<T>(projection: Projection<T>): Readable<T>;
|
|
77
91
|
select<T, R>(projection: Projection<T>, selector: (value: T) => R, equality?: (previous: R, next: R) => boolean): Readable<R>;
|
|
92
|
+
items<K extends string, V>(projection: KeyedProjection<K, V>): ProjectionItems<K, V>;
|
|
78
93
|
update<T>(input: Input<T>, value: T): void;
|
|
79
94
|
update<K extends string, V>(input: CollectionInput<K, V>, run: (draft: CollectionInputDraft<K, V>) => void): void;
|
|
80
95
|
batch<T>(run: () => T, options?: {
|
|
@@ -86,5 +101,5 @@ declare const createProjectionRuntime: (options?: {
|
|
|
86
101
|
readonly onError?: (error: ProjectionError) => void;
|
|
87
102
|
}) => ProjectionRuntime;
|
|
88
103
|
//#endregion
|
|
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 };
|
|
104
|
+
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 ProjectionItems, 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 };
|
|
90
105
|
//# sourceMappingURL=index.d.ts.map
|