doxum 0.1.26 → 0.1.27
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 +21 -1
- package/dist/advanced.cjs +5 -21
- package/dist/advanced.cjs.map +1 -1
- package/dist/advanced.d.cts +8 -1
- package/dist/advanced.d.ts +8 -1
- package/dist/advanced.js +5 -22
- package/dist/advanced.js.map +1 -1
- package/dist/index.cjs +364 -192
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -16
- package/dist/index.d.ts +40 -16
- package/dist/index.js +361 -189
- package/dist/index.js.map +1 -1
- package/dist/{scheduler-D4VthaaK.cjs → scheduler-k1ZGR1PG.cjs} +136 -1
- package/dist/scheduler-k1ZGR1PG.cjs.map +1 -0
- package/dist/{scheduler--137L3j-.js → scheduler-vzf3OcjT.js} +95 -2
- package/dist/scheduler-vzf3OcjT.js.map +1 -0
- package/package.json +1 -1
- package/skills/doxum-runtime/SKILL.md +8 -4
- package/skills/doxum-runtime/references/api.en.md +28 -13
- package/skills/doxum-runtime/references/api.zh-CN.md +27 -12
- package/skills/doxum-runtime/references/projections.en.md +31 -2
- package/skills/doxum-runtime/references/projections.zh-CN.md +30 -1
- package/dist/scheduler--137L3j-.js.map +0 -1
- package/dist/scheduler-D4VthaaK.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -33,24 +33,48 @@ 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: V, key: K) => Synchronous<T>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
40
|
+
<K extends string, V, const D extends object & { readonly [P in keyof D]: P extends string ? (Projection<unknown> & {
|
|
41
|
+
readonly source?: never;
|
|
42
|
+
readonly key?: never;
|
|
43
|
+
}) | {
|
|
44
|
+
readonly source: KeyedProjection<string, unknown>;
|
|
45
|
+
readonly key: (value: V, key: K) => Synchronous<string | undefined>;
|
|
46
|
+
} : never }, T>(source: KeyedProjection<K, V>, dependencies: D, select: (value: V, key: K, dependencies: { readonly [P_1 in keyof D]: D[P_1] extends {
|
|
47
|
+
readonly source: KeyedProjection<infer _K extends string, infer V_1>;
|
|
48
|
+
} ? V_1 | undefined : D[P_1] extends Projection<infer T_1> ? T_1 : never }) => Synchronous<T>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
49
|
+
} & {
|
|
50
|
+
keys: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly K[]>;
|
|
51
|
+
values: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly V[]>;
|
|
52
|
+
subset: <K extends string, V>(source: KeyedProjection<K, V>, orderedKeys: Projection<readonly K[]> | readonly K[]) => KeyedProjection<K, V>;
|
|
53
|
+
filter: {
|
|
54
|
+
<K extends string, V>(source: KeyedProjection<K, V>, predicate: (value: V, key: K) => Synchronous<boolean>): KeyedProjection<K, V>;
|
|
55
|
+
<K extends string, V, const D extends object & { readonly [P in keyof D]: P extends string ? (Projection<unknown> & {
|
|
56
|
+
readonly source?: never;
|
|
57
|
+
readonly key?: never;
|
|
58
|
+
}) | {
|
|
59
|
+
readonly source: KeyedProjection<string, unknown>;
|
|
60
|
+
readonly key: (value: V, key: K) => Synchronous<string | undefined>;
|
|
61
|
+
} : never }>(source: KeyedProjection<K, V>, dependencies: D, predicate: (value: V, key: K, dependencies: { readonly [P_1 in keyof D]: D[P_1] extends {
|
|
62
|
+
readonly source: KeyedProjection<infer _K extends string, infer V_1>;
|
|
63
|
+
} ? V_1 | undefined : D[P_1] extends Projection<infer T> ? T : never }) => Synchronous<boolean>): KeyedProjection<K, V>;
|
|
64
|
+
};
|
|
65
|
+
compact: {
|
|
66
|
+
<K extends string, V, T>(source: KeyedProjection<K, V>, select: (value: V, key: K) => Synchronous<T | undefined>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
67
|
+
<K extends string, V, const D extends object & { readonly [P in keyof D]: P extends string ? (Projection<unknown> & {
|
|
68
|
+
readonly source?: never;
|
|
69
|
+
readonly key?: never;
|
|
70
|
+
}) | {
|
|
71
|
+
readonly source: KeyedProjection<string, unknown>;
|
|
72
|
+
readonly key: (value: V, key: K) => Synchronous<string | undefined>;
|
|
73
|
+
} : never }, T>(source: KeyedProjection<K, V>, dependencies: D, select: (value: V, key: K, dependencies: { readonly [P_1 in keyof D]: D[P_1] extends {
|
|
74
|
+
readonly source: KeyedProjection<infer _K extends string, infer V_1>;
|
|
75
|
+
} ? V_1 | undefined : D[P_1] extends Projection<infer T_1> ? T_1 : never }) => Synchronous<T | undefined>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
54
78
|
};
|
|
55
79
|
//#endregion
|
|
56
80
|
//#region core/src/projection/runtime.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -33,24 +33,48 @@ 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: V, key: K) => Synchronous<T>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
40
|
+
<K extends string, V, const D extends object & { readonly [P in keyof D]: P extends string ? (Projection<unknown> & {
|
|
41
|
+
readonly source?: never;
|
|
42
|
+
readonly key?: never;
|
|
43
|
+
}) | {
|
|
44
|
+
readonly source: KeyedProjection<string, unknown>;
|
|
45
|
+
readonly key: (value: V, key: K) => Synchronous<string | undefined>;
|
|
46
|
+
} : never }, T>(source: KeyedProjection<K, V>, dependencies: D, select: (value: V, key: K, dependencies: { readonly [P_1 in keyof D]: D[P_1] extends {
|
|
47
|
+
readonly source: KeyedProjection<infer _K extends string, infer V_1>;
|
|
48
|
+
} ? V_1 | undefined : D[P_1] extends Projection<infer T_1> ? T_1 : never }) => Synchronous<T>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
49
|
+
} & {
|
|
50
|
+
keys: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly K[]>;
|
|
51
|
+
values: <K extends string, V>(source: KeyedProjection<K, V>) => Projection<readonly V[]>;
|
|
52
|
+
subset: <K extends string, V>(source: KeyedProjection<K, V>, orderedKeys: Projection<readonly K[]> | readonly K[]) => KeyedProjection<K, V>;
|
|
53
|
+
filter: {
|
|
54
|
+
<K extends string, V>(source: KeyedProjection<K, V>, predicate: (value: V, key: K) => Synchronous<boolean>): KeyedProjection<K, V>;
|
|
55
|
+
<K extends string, V, const D extends object & { readonly [P in keyof D]: P extends string ? (Projection<unknown> & {
|
|
56
|
+
readonly source?: never;
|
|
57
|
+
readonly key?: never;
|
|
58
|
+
}) | {
|
|
59
|
+
readonly source: KeyedProjection<string, unknown>;
|
|
60
|
+
readonly key: (value: V, key: K) => Synchronous<string | undefined>;
|
|
61
|
+
} : never }>(source: KeyedProjection<K, V>, dependencies: D, predicate: (value: V, key: K, dependencies: { readonly [P_1 in keyof D]: D[P_1] extends {
|
|
62
|
+
readonly source: KeyedProjection<infer _K extends string, infer V_1>;
|
|
63
|
+
} ? V_1 | undefined : D[P_1] extends Projection<infer T> ? T : never }) => Synchronous<boolean>): KeyedProjection<K, V>;
|
|
64
|
+
};
|
|
65
|
+
compact: {
|
|
66
|
+
<K extends string, V, T>(source: KeyedProjection<K, V>, select: (value: V, key: K) => Synchronous<T | undefined>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
67
|
+
<K extends string, V, const D extends object & { readonly [P in keyof D]: P extends string ? (Projection<unknown> & {
|
|
68
|
+
readonly source?: never;
|
|
69
|
+
readonly key?: never;
|
|
70
|
+
}) | {
|
|
71
|
+
readonly source: KeyedProjection<string, unknown>;
|
|
72
|
+
readonly key: (value: V, key: K) => Synchronous<string | undefined>;
|
|
73
|
+
} : never }, T>(source: KeyedProjection<K, V>, dependencies: D, select: (value: V, key: K, dependencies: { readonly [P_1 in keyof D]: D[P_1] extends {
|
|
74
|
+
readonly source: KeyedProjection<infer _K extends string, infer V_1>;
|
|
75
|
+
} ? V_1 | undefined : D[P_1] extends Projection<infer T_1> ? T_1 : never }) => Synchronous<T | undefined>, equality?: (previous: T, next: T) => boolean): KeyedProjection<K, T>;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
54
78
|
};
|
|
55
79
|
//#endregion
|
|
56
80
|
//#region core/src/projection/runtime.d.ts
|