shelving 1.76.2 → 1.79.0
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/{api → modules/api}/Resource.d.ts +0 -0
- package/{api → modules/api}/Resource.js +0 -0
- package/{api → modules/api}/index.d.ts +0 -0
- package/{api → modules/api}/index.js +0 -0
- package/{constraint → modules/constraint}/Constraint.d.ts +0 -0
- package/{constraint → modules/constraint}/Constraint.js +0 -0
- package/{constraint → modules/constraint}/Constraints.d.ts +1 -1
- package/{constraint → modules/constraint}/Constraints.js +0 -0
- package/{constraint → modules/constraint}/FilterConstraint.d.ts +6 -6
- package/{constraint → modules/constraint}/FilterConstraint.js +1 -1
- package/{constraint → modules/constraint}/FilterConstraints.d.ts +5 -5
- package/{constraint → modules/constraint}/FilterConstraints.js +0 -0
- package/{constraint → modules/constraint}/QueryConstraints.d.ts +4 -4
- package/{constraint → modules/constraint}/QueryConstraints.js +2 -2
- package/{constraint → modules/constraint}/SortConstraint.d.ts +4 -3
- package/{constraint → modules/constraint}/SortConstraint.js +2 -3
- package/{constraint → modules/constraint}/SortConstraints.d.ts +5 -5
- package/{constraint → modules/constraint}/SortConstraints.js +0 -0
- package/{constraint → modules/constraint}/index.d.ts +0 -0
- package/{constraint → modules/constraint}/index.js +0 -0
- package/{db → modules/db}/Change.d.ts +10 -13
- package/{db → modules/db}/Change.js +2 -2
- package/modules/db/Collection.d.ts +74 -0
- package/{db → modules/db}/Collection.js +47 -7
- package/modules/db/Database.d.ts +76 -0
- package/modules/db/Database.js +95 -0
- package/{db → modules/db}/Item.d.ts +9 -9
- package/{db → modules/db}/Item.js +19 -21
- package/{db → modules/db}/Query.d.ts +6 -6
- package/{db → modules/db}/Query.js +2 -3
- package/{db → modules/db}/index.d.ts +0 -0
- package/{db → modules/db}/index.js +0 -0
- package/{error → modules/error}/AssertionError.d.ts +0 -0
- package/{error → modules/error}/AssertionError.js +0 -0
- package/{error → modules/error}/ConditionError.d.ts +0 -0
- package/{error → modules/error}/ConditionError.js +0 -0
- package/{error → modules/error}/PermissionError.d.ts +0 -0
- package/{error → modules/error}/PermissionError.js +0 -0
- package/{error → modules/error}/RequiredError.d.ts +0 -0
- package/{error → modules/error}/RequiredError.js +0 -0
- package/{error → modules/error}/ThroughError.d.ts +0 -0
- package/{error → modules/error}/ThroughError.js +0 -0
- package/{error → modules/error}/UnsupportedError.d.ts +0 -0
- package/{error → modules/error}/UnsupportedError.js +0 -0
- package/{error → modules/error}/ValidationError.d.ts +0 -0
- package/{error → modules/error}/ValidationError.js +0 -0
- package/{error → modules/error}/index.d.ts +0 -0
- package/{error → modules/error}/index.js +0 -0
- package/{feedback → modules/feedback}/ErrorFeedback.d.ts +0 -0
- package/{feedback → modules/feedback}/ErrorFeedback.js +1 -5
- package/{feedback → modules/feedback}/Feedback.d.ts +0 -0
- package/{feedback → modules/feedback}/Feedback.js +1 -5
- package/{feedback → modules/feedback}/InvalidFeedback.d.ts +0 -0
- package/{feedback → modules/feedback}/InvalidFeedback.js +1 -5
- package/{feedback → modules/feedback}/SuccessFeedback.d.ts +0 -0
- package/{feedback → modules/feedback}/SuccessFeedback.js +1 -5
- package/{feedback → modules/feedback}/WarningFeedback.d.ts +0 -0
- package/{feedback → modules/feedback}/WarningFeedback.js +1 -5
- package/{feedback → modules/feedback}/hydrations.d.ts +0 -0
- package/{feedback → modules/feedback}/hydrations.js +0 -0
- package/{feedback → modules/feedback}/index.d.ts +0 -0
- package/{feedback → modules/feedback}/index.js +0 -0
- package/{firestore → modules/firestore}/client/FirestoreClientProvider.d.ts +3 -3
- package/{firestore → modules/firestore}/client/FirestoreClientProvider.js +4 -4
- package/{firestore → modules/firestore}/client/index.d.ts +0 -0
- package/{firestore → modules/firestore}/client/index.js +0 -0
- package/{firestore → modules/firestore}/lite/FirestoreLiteProvider.d.ts +3 -3
- package/{firestore → modules/firestore}/lite/FirestoreLiteProvider.js +4 -4
- package/{firestore → modules/firestore}/lite/index.d.ts +0 -0
- package/{firestore → modules/firestore}/lite/index.js +0 -0
- package/{firestore → modules/firestore}/server/FirestoreServerProvider.d.ts +3 -3
- package/{firestore → modules/firestore}/server/FirestoreServerProvider.js +4 -4
- package/{firestore → modules/firestore}/server/index.d.ts +0 -0
- package/{firestore → modules/firestore}/server/index.js +0 -0
- package/{index.d.ts → modules/index.d.ts} +0 -0
- package/{index.js → modules/index.js} +0 -0
- package/{markup → modules/markup}/index.d.ts +0 -0
- package/{markup → modules/markup}/index.js +0 -0
- package/{markup → modules/markup}/options.d.ts +0 -0
- package/{markup → modules/markup}/options.js +0 -0
- package/{markup → modules/markup}/regexp.d.ts +0 -0
- package/{markup → modules/markup}/regexp.js +0 -0
- package/{markup → modules/markup}/render.d.ts +0 -0
- package/{markup → modules/markup}/render.js +0 -0
- package/{markup → modules/markup}/rules.d.ts +0 -0
- package/{markup → modules/markup}/rules.js +0 -0
- package/{observe → modules/observe}/AbstractObserver.d.ts +0 -0
- package/{observe → modules/observe}/AbstractObserver.js +0 -0
- package/{observe → modules/observe}/AsyncObserver.d.ts +0 -0
- package/{observe → modules/observe}/AsyncObserver.js +0 -0
- package/{observe → modules/observe}/LastSubject.d.ts +0 -0
- package/{observe → modules/observe}/LastSubject.js +0 -0
- package/{observe → modules/observe}/MatchObserver.d.ts +0 -0
- package/{observe → modules/observe}/MatchObserver.js +0 -0
- package/{observe → modules/observe}/MatchableObserver.d.ts +0 -0
- package/{observe → modules/observe}/MatchableObserver.js +0 -0
- package/{observe → modules/observe}/Observable.d.ts +0 -0
- package/{observe → modules/observe}/Observable.js +0 -0
- package/{observe → modules/observe}/Observer.d.ts +0 -0
- package/{observe → modules/observe}/Observer.js +0 -0
- package/{observe → modules/observe}/OnceObserver.d.ts +0 -0
- package/{observe → modules/observe}/OnceObserver.js +0 -0
- package/{observe → modules/observe}/Subject.d.ts +0 -0
- package/{observe → modules/observe}/Subject.js +0 -0
- package/{observe → modules/observe}/ThroughObserver.d.ts +0 -0
- package/{observe → modules/observe}/ThroughObserver.js +0 -0
- package/{observe → modules/observe}/TransformObserver.d.ts +0 -0
- package/{observe → modules/observe}/TransformObserver.js +0 -0
- package/{observe → modules/observe}/TransformableObserver.d.ts +0 -0
- package/{observe → modules/observe}/TransformableObserver.js +0 -0
- package/{observe → modules/observe}/index.d.ts +0 -0
- package/{observe → modules/observe}/index.js +0 -0
- package/{observe → modules/observe}/util.d.ts +0 -0
- package/{observe → modules/observe}/util.js +0 -0
- package/{provider → modules/provider}/BatchProvider.d.ts +0 -0
- package/{provider → modules/provider}/BatchProvider.js +0 -0
- package/{provider → modules/provider}/CacheProvider.d.ts +3 -3
- package/{provider → modules/provider}/CacheProvider.js +6 -6
- package/{provider → modules/provider}/DebugProvider.d.ts +5 -5
- package/{provider → modules/provider}/DebugProvider.js +12 -12
- package/{provider → modules/provider}/MemoryProvider.d.ts +5 -5
- package/{provider → modules/provider}/MemoryProvider.js +9 -8
- package/{provider → modules/provider}/Provider.d.ts +7 -7
- package/{provider → modules/provider}/Provider.js +0 -0
- package/{provider → modules/provider}/ThroughProvider.d.ts +5 -5
- package/{provider → modules/provider}/ThroughProvider.js +4 -4
- package/{provider → modules/provider}/ValidationProvider.d.ts +11 -11
- package/{provider → modules/provider}/ValidationProvider.js +29 -28
- package/{provider → modules/provider}/index.d.ts +0 -0
- package/{provider → modules/provider}/index.js +0 -0
- package/{react → modules/react}/index.d.ts +0 -0
- package/{react → modules/react}/index.js +0 -0
- package/{react → modules/react}/useCache.d.ts +0 -0
- package/{react → modules/react}/useCache.js +0 -0
- package/{react → modules/react}/useInstance.d.ts +0 -0
- package/{react → modules/react}/useInstance.js +0 -0
- package/{react → modules/react}/useItem.d.ts +7 -7
- package/{react → modules/react}/useItem.js +0 -0
- package/{react → modules/react}/useLazy.d.ts +0 -0
- package/{react → modules/react}/useLazy.js +0 -0
- package/{react → modules/react}/useQuery.d.ts +10 -10
- package/{react → modules/react}/useQuery.js +0 -0
- package/{react → modules/react}/useReduce.d.ts +0 -0
- package/{react → modules/react}/useReduce.js +0 -0
- package/{react → modules/react}/useSubscribe.d.ts +0 -0
- package/{react → modules/react}/useSubscribe.js +0 -0
- package/{schema → modules/schema}/AllowSchema.d.ts +0 -0
- package/{schema → modules/schema}/AllowSchema.js +0 -0
- package/{schema → modules/schema}/ArraySchema.d.ts +0 -0
- package/{schema → modules/schema}/ArraySchema.js +0 -0
- package/{schema → modules/schema}/BooleanSchema.d.ts +0 -0
- package/{schema → modules/schema}/BooleanSchema.js +0 -0
- package/{schema → modules/schema}/ColorSchema.d.ts +0 -0
- package/{schema → modules/schema}/ColorSchema.js +0 -0
- package/{schema → modules/schema}/DataSchema.d.ts +5 -1
- package/{schema → modules/schema}/DataSchema.js +0 -0
- package/{schema → modules/schema}/DateSchema.d.ts +0 -0
- package/{schema → modules/schema}/DateSchema.js +0 -0
- package/{schema → modules/schema}/EmailSchema.d.ts +0 -0
- package/{schema → modules/schema}/EmailSchema.js +0 -0
- package/{schema → modules/schema}/KeySchema.d.ts +0 -0
- package/{schema → modules/schema}/KeySchema.js +0 -0
- package/{schema → modules/schema}/LinkSchema.d.ts +0 -0
- package/{schema → modules/schema}/LinkSchema.js +0 -0
- package/{schema → modules/schema}/NumberSchema.d.ts +0 -0
- package/{schema → modules/schema}/NumberSchema.js +0 -0
- package/{schema → modules/schema}/ObjectSchema.d.ts +0 -0
- package/{schema → modules/schema}/ObjectSchema.js +0 -0
- package/{schema → modules/schema}/OptionalSchema.d.ts +0 -0
- package/{schema → modules/schema}/OptionalSchema.js +0 -0
- package/{schema → modules/schema}/PhoneSchema.d.ts +0 -0
- package/{schema → modules/schema}/PhoneSchema.js +0 -0
- package/{schema → modules/schema}/RequiredSchema.d.ts +0 -0
- package/{schema → modules/schema}/RequiredSchema.js +0 -0
- package/{schema → modules/schema}/Schema.d.ts +0 -0
- package/{schema → modules/schema}/Schema.js +0 -0
- package/{schema → modules/schema}/SlugSchema.d.ts +0 -0
- package/{schema → modules/schema}/SlugSchema.js +0 -0
- package/{schema → modules/schema}/StringSchema.d.ts +0 -0
- package/{schema → modules/schema}/StringSchema.js +0 -0
- package/{schema → modules/schema}/ThroughSchema.d.ts +0 -0
- package/{schema → modules/schema}/ThroughSchema.js +0 -0
- package/{schema → modules/schema}/index.d.ts +0 -0
- package/{schema → modules/schema}/index.js +0 -0
- package/{state → modules/state}/ArrayState.d.ts +0 -0
- package/{state → modules/state}/ArrayState.js +0 -0
- package/{state → modules/state}/BooleanState.d.ts +0 -0
- package/{state → modules/state}/BooleanState.js +0 -0
- package/{state → modules/state}/DataState.d.ts +3 -3
- package/{state → modules/state}/DataState.js +0 -0
- package/{state → modules/state}/ObjectState.d.ts +0 -0
- package/{state → modules/state}/ObjectState.js +0 -0
- package/{state → modules/state}/SelfClosingState.d.ts +0 -0
- package/{state → modules/state}/SelfClosingState.js +0 -0
- package/{state → modules/state}/State.d.ts +0 -0
- package/{state → modules/state}/State.js +0 -0
- package/{state → modules/state}/index.d.ts +0 -0
- package/{state → modules/state}/index.js +0 -0
- package/{test → modules/test}/basics.d.ts +0 -0
- package/{test → modules/test}/basics.js +0 -0
- package/{test → modules/test}/index.d.ts +0 -0
- package/{test → modules/test}/index.js +0 -0
- package/{test → modules/test}/people.d.ts +0 -0
- package/{test → modules/test}/people.js +0 -0
- package/{test → modules/test}/util.d.ts +0 -0
- package/{test → modules/test}/util.js +0 -0
- package/{update → modules/update}/ArrayUpdate.d.ts +0 -0
- package/{update → modules/update}/ArrayUpdate.js +0 -0
- package/{update → modules/update}/DataUpdate.d.ts +15 -7
- package/{update → modules/update}/DataUpdate.js +28 -21
- package/{update → modules/update}/Delete.d.ts +0 -0
- package/{update → modules/update}/Delete.js +0 -0
- package/{update → modules/update}/Increment.d.ts +0 -0
- package/{update → modules/update}/Increment.js +0 -0
- package/{update → modules/update}/ObjectUpdate.d.ts +0 -0
- package/{update → modules/update}/ObjectUpdate.js +0 -0
- package/{update → modules/update}/Update.d.ts +0 -0
- package/{update → modules/update}/Update.js +0 -0
- package/{update → modules/update}/hydrations.d.ts +0 -0
- package/{update → modules/update}/hydrations.js +0 -0
- package/{update → modules/update}/index.d.ts +0 -0
- package/{update → modules/update}/index.js +0 -0
- package/{util → modules/util}/array.d.ts +0 -0
- package/{util → modules/util}/array.js +0 -0
- package/{util → modules/util}/assert.d.ts +0 -0
- package/{util → modules/util}/assert.js +0 -0
- package/{util → modules/util}/async.d.ts +0 -0
- package/{util → modules/util}/async.js +0 -0
- package/{util → modules/util}/boolean.d.ts +0 -0
- package/{util → modules/util}/boolean.js +0 -0
- package/{util → modules/util}/class.d.ts +0 -0
- package/{util → modules/util}/class.js +0 -0
- package/{util → modules/util}/clone.d.ts +0 -0
- package/{util → modules/util}/clone.js +0 -0
- package/{util → modules/util}/color.d.ts +0 -0
- package/{util → modules/util}/color.js +0 -0
- package/{util → modules/util}/data.d.ts +0 -0
- package/{util → modules/util}/data.js +0 -0
- package/{util → modules/util}/date.d.ts +0 -0
- package/{util → modules/util}/date.js +0 -0
- package/{util → modules/util}/debug.d.ts +0 -0
- package/{util → modules/util}/debug.js +0 -0
- package/{util → modules/util}/diff.d.ts +0 -0
- package/{util → modules/util}/diff.js +0 -0
- package/{util → modules/util}/entry.d.ts +0 -0
- package/{util → modules/util}/entry.js +0 -0
- package/{util → modules/util}/equal.d.ts +0 -0
- package/{util → modules/util}/equal.js +0 -0
- package/{util → modules/util}/error.d.ts +0 -0
- package/{util → modules/util}/error.js +0 -0
- package/{util → modules/util}/filter.d.ts +0 -0
- package/{util → modules/util}/filter.js +0 -0
- package/{util → modules/util}/function.d.ts +0 -0
- package/{util → modules/util}/function.js +0 -0
- package/{util → modules/util}/hydrate.d.ts +0 -0
- package/{util → modules/util}/hydrate.js +0 -0
- package/{util → modules/util}/index.d.ts +0 -0
- package/{util → modules/util}/index.js +0 -0
- package/{util → modules/util}/iterate.d.ts +0 -0
- package/{util → modules/util}/iterate.js +0 -0
- package/{util → modules/util}/jsx.d.ts +0 -0
- package/{util → modules/util}/jsx.js +0 -0
- package/{util → modules/util}/lazy.d.ts +0 -0
- package/{util → modules/util}/lazy.js +0 -0
- package/{util → modules/util}/map.d.ts +0 -0
- package/{util → modules/util}/map.js +0 -0
- package/{util → modules/util}/match.d.ts +0 -0
- package/{util → modules/util}/match.js +0 -0
- package/{util → modules/util}/merge.d.ts +0 -0
- package/{util → modules/util}/merge.js +0 -0
- package/{util → modules/util}/null.d.ts +0 -0
- package/{util → modules/util}/null.js +0 -0
- package/{util → modules/util}/number.d.ts +0 -0
- package/{util → modules/util}/number.js +0 -0
- package/{util → modules/util}/object.d.ts +0 -0
- package/{util → modules/util}/object.js +0 -0
- package/{util → modules/util}/random.d.ts +0 -0
- package/{util → modules/util}/random.js +0 -0
- package/{util → modules/util}/regexp.d.ts +0 -0
- package/{util → modules/util}/regexp.js +0 -0
- package/{util → modules/util}/serialise.d.ts +0 -0
- package/{util → modules/util}/serialise.js +0 -0
- package/{util → modules/util}/set.d.ts +0 -0
- package/{util → modules/util}/set.js +0 -0
- package/{util → modules/util}/sort.d.ts +0 -0
- package/{util → modules/util}/sort.js +0 -0
- package/{util → modules/util}/source.d.ts +0 -0
- package/{util → modules/util}/source.js +0 -0
- package/{util → modules/util}/string.d.ts +0 -0
- package/{util → modules/util}/string.js +0 -0
- package/{util → modules/util}/template.d.ts +0 -0
- package/{util → modules/util}/template.js +0 -0
- package/{util → modules/util}/timeout.d.ts +0 -0
- package/{util → modules/util}/timeout.js +0 -0
- package/{util → modules/util}/transform.d.ts +3 -3
- package/{util → modules/util}/transform.js +0 -0
- package/{util → modules/util}/undefined.d.ts +0 -0
- package/{util → modules/util}/undefined.js +0 -0
- package/{util → modules/util}/units.d.ts +0 -0
- package/{util → modules/util}/units.js +0 -0
- package/{util → modules/util}/url.d.ts +0 -0
- package/{util → modules/util}/url.js +0 -0
- package/{util → modules/util}/validate.d.ts +0 -0
- package/{util → modules/util}/validate.js +0 -0
- package/package.json +8 -8
- package/db/Collection.d.ts +0 -46
- package/db/Database.d.ts +0 -42
- package/db/Database.js +0 -43
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -16,19 +16,19 @@ export declare type Transformer<I, O> = Transformable<I, O> | Transform<I, O> |
|
|
|
16
16
|
export declare function transform<I, O>(input: I, transformer: (v: I) => O): O;
|
|
17
17
|
export declare function transform<I, O>(input: I, transformer: Transformer<I, O>): O;
|
|
18
18
|
/** Set of named transformers for a data object. */
|
|
19
|
-
export declare type
|
|
19
|
+
export declare type Transformers<T extends Data> = {
|
|
20
20
|
readonly [K in keyof T]?: Transformer<T[K], T[K]>;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* Transform the props of a data object using a set of transformers for its props.
|
|
24
24
|
* @returns New object with changed props (or the same object if no changes were made).
|
|
25
25
|
*/
|
|
26
|
-
export declare function transformData<T extends Data>(data: T, transforms:
|
|
26
|
+
export declare function transformData<T extends Data>(data: T, transforms: Transformers<T>): T;
|
|
27
27
|
/**
|
|
28
28
|
* Transform the props of a data object using a set of prop transformers.
|
|
29
29
|
* @yield Transformed prop entry after calling the corresponding prop transformer.
|
|
30
30
|
*/
|
|
31
|
-
export declare function transformProps<T extends Data>(data: T, transforms:
|
|
31
|
+
export declare function transformProps<T extends Data>(data: T, transforms: Transformers<T>): Iterable<Prop<T>>;
|
|
32
32
|
/**
|
|
33
33
|
* Transform the _values_ of an iterable set of entries using a transformer.
|
|
34
34
|
* @yield Transformed entry after calling transforming the new value for each entry.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"state-management",
|
|
12
12
|
"query-builder"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.79.0",
|
|
15
15
|
"repository": "https://github.com/dhoulb/shelving",
|
|
16
16
|
"author": "Dave Houlbrooke <dave@shax.com>",
|
|
17
17
|
"license": "0BSD",
|
|
@@ -62,23 +62,23 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@google-cloud/firestore": "^5.0.2",
|
|
65
|
-
"@types/jest": "^28.1.
|
|
66
|
-
"@types/react": "^18.0.
|
|
65
|
+
"@types/jest": "^28.1.7",
|
|
66
|
+
"@types/react": "^18.0.17",
|
|
67
67
|
"@types/react-dom": "^18.0.4",
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
69
|
-
"@typescript-eslint/parser": "^5.
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
|
69
|
+
"@typescript-eslint/parser": "^5.33.1",
|
|
70
70
|
"dpdm": "^3.9.0",
|
|
71
|
-
"eslint": "^8.
|
|
71
|
+
"eslint": "^8.22.0",
|
|
72
72
|
"eslint-config-prettier": "^8.5.0",
|
|
73
73
|
"eslint-plugin-import": "^2.26.0",
|
|
74
74
|
"eslint-plugin-prettier": "^4.0.0",
|
|
75
|
-
"firebase": "^9.9.
|
|
75
|
+
"firebase": "^9.9.3",
|
|
76
76
|
"jest": "^28.1.0",
|
|
77
77
|
"jest-ts-webcompat-resolver": "^1.0.0",
|
|
78
78
|
"prettier": "^2.6.2",
|
|
79
79
|
"react": "^18.1.0",
|
|
80
80
|
"react-dom": "^18.1.0",
|
|
81
|
-
"ts-jest": "^28.0.
|
|
81
|
+
"ts-jest": "^28.0.8",
|
|
82
82
|
"typescript": "^4.6.4"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
package/db/Collection.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Datas, Key } from "../util/data.js";
|
|
2
|
-
import type { Nullish } from "../util/null.js";
|
|
3
|
-
import type { FilterList } from "../constraint/FilterConstraint.js";
|
|
4
|
-
import type { SortList } from "../constraint/SortConstraint.js";
|
|
5
|
-
import type { DeepIterable } from "../util/iterate.js";
|
|
6
|
-
import type { AsyncDatabase, Database } from "./Database.js";
|
|
7
|
-
import { ItemData, AsyncItem, Item } from "./Item.js";
|
|
8
|
-
import { AsyncQuery, Query } from "./Query.js";
|
|
9
|
-
import { AddChange, ItemChanges, WriteChange } from "./Change.js";
|
|
10
|
-
/** Reference to a collection in a synchronous or asynchronous provider. */
|
|
11
|
-
declare abstract class BaseCollection<T extends Datas = Datas, K extends Key<T> = Key<T>> {
|
|
12
|
-
abstract readonly db: Database<T> | AsyncDatabase<T>;
|
|
13
|
-
abstract readonly collection: K;
|
|
14
|
-
/** Create a query on this item's collection. */
|
|
15
|
-
abstract query(filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): Query<T, K> | AsyncQuery<T, K>;
|
|
16
|
-
/** Create a query on this item's collection. */
|
|
17
|
-
abstract item(id: string): Item<T, K> | AsyncItem<T, K>;
|
|
18
|
-
/** Add an item to this collection. */
|
|
19
|
-
abstract add(data: T[K]): string | Promise<string>;
|
|
20
|
-
/** Run a set of changes on this database. */
|
|
21
|
-
abstract change(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): ItemChanges<T, K> | Promise<ItemChanges<T, K>>;
|
|
22
|
-
/** Get an add change for this collection. */
|
|
23
|
-
getAdd(data: T[K]): AddChange<T, K>;
|
|
24
|
-
toString(): K;
|
|
25
|
-
}
|
|
26
|
-
/** Reference to a collection in a synchronous provider. */
|
|
27
|
-
export declare class Collection<T extends Datas = Datas, K extends Key<T> = Key<T>> extends BaseCollection<T, K> {
|
|
28
|
-
readonly db: Database<T>;
|
|
29
|
-
readonly collection: K;
|
|
30
|
-
constructor(db: Database<T>, collection: K);
|
|
31
|
-
query(filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): Query<T, K>;
|
|
32
|
-
item(id: string): Item<T, K>;
|
|
33
|
-
add(data: T[K]): string;
|
|
34
|
-
change(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): ItemChanges<T, K>;
|
|
35
|
-
}
|
|
36
|
-
/** Reference to a collection in an asynchronous provider. */
|
|
37
|
-
export declare class AsyncCollection<T extends Datas = Datas, K extends Key<T> = Key<T>> extends BaseCollection<T, K> {
|
|
38
|
-
readonly db: AsyncDatabase<T>;
|
|
39
|
-
readonly collection: K;
|
|
40
|
-
constructor(db: AsyncDatabase<T>, collection: K);
|
|
41
|
-
query(filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): AsyncQuery<T, K>;
|
|
42
|
-
item(id: string): AsyncItem<T, K>;
|
|
43
|
-
add(data: T[K]): Promise<string>;
|
|
44
|
-
change(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): Promise<ItemChanges<T, K>>;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
package/db/Database.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Key, Datas } from "../util/data.js";
|
|
2
|
-
import type { AsyncProvider, Provider } from "../provider/Provider.js";
|
|
3
|
-
import type { FilterList } from "../constraint/FilterConstraint.js";
|
|
4
|
-
import type { SortList } from "../constraint/SortConstraint.js";
|
|
5
|
-
import type { ItemData } from "../db/Item.js";
|
|
6
|
-
import type { Nullish } from "../util/null.js";
|
|
7
|
-
import { DeepIterable } from "../util/iterate.js";
|
|
8
|
-
import { Item, AsyncItem } from "./Item.js";
|
|
9
|
-
import { Query, AsyncQuery } from "./Query.js";
|
|
10
|
-
import { Collection, AsyncCollection } from "./Collection.js";
|
|
11
|
-
import { ItemChanges, WriteChange } from "./Change.js";
|
|
12
|
-
/** Database with a synchronous or asynchronous provider. */
|
|
13
|
-
declare abstract class BaseDatabase<T extends Datas> {
|
|
14
|
-
abstract readonly provider: Provider<T> | AsyncProvider<T>;
|
|
15
|
-
/** Create a query on a collection in this database. */
|
|
16
|
-
abstract collection<K extends Key<T>>(collection: K): Collection<T, K> | AsyncCollection<T, K>;
|
|
17
|
-
/** Create a query on a collection in this database. */
|
|
18
|
-
abstract query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): Query<T, K> | AsyncQuery<T, K>;
|
|
19
|
-
/** Reference an item in a collection in this database. */
|
|
20
|
-
abstract item<K extends Key<T>>(collection: K, id: string): Item<T, K> | AsyncItem<T, K>;
|
|
21
|
-
/** Run a set of changes on this database. */
|
|
22
|
-
abstract change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): ItemChanges<T, K> | Promise<ItemChanges<T, K>>;
|
|
23
|
-
}
|
|
24
|
-
/** Database with a synchronous provider. */
|
|
25
|
-
export declare class Database<T extends Datas = Datas> implements BaseDatabase<T> {
|
|
26
|
-
readonly provider: Provider<T>;
|
|
27
|
-
constructor(provider: Provider<T>);
|
|
28
|
-
collection<K extends Key<T>>(collection: K): Collection<T, K>;
|
|
29
|
-
query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): Query<T, K>;
|
|
30
|
-
item<K extends Key<T>>(collection: K, id: string): Item<T, K>;
|
|
31
|
-
change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): ItemChanges<T, K>;
|
|
32
|
-
}
|
|
33
|
-
/** Database with a synchronous provider. */
|
|
34
|
-
export declare class AsyncDatabase<T extends Datas = Datas> implements BaseDatabase<T> {
|
|
35
|
-
readonly provider: AsyncProvider<T>;
|
|
36
|
-
constructor(provider: AsyncProvider<T>);
|
|
37
|
-
collection<K extends Key<T>>(collection: K): AsyncCollection<T, K>;
|
|
38
|
-
query<K extends Key<T>>(collection: K, filters?: FilterList<ItemData<T[K]>>, sorts?: SortList<ItemData<T[K]>>, limit?: number | null): AsyncQuery<T, K>;
|
|
39
|
-
item<K extends Key<T>>(collection: K, id: string): AsyncItem<T, K>;
|
|
40
|
-
change<K extends Key<T>>(...changes: DeepIterable<Nullish<WriteChange<T, K>>>[]): Promise<ItemChanges<T, K>>;
|
|
41
|
-
}
|
|
42
|
-
export {};
|
package/db/Database.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Item, AsyncItem } from "./Item.js";
|
|
2
|
-
import { Query, AsyncQuery } from "./Query.js";
|
|
3
|
-
import { Collection, AsyncCollection } from "./Collection.js";
|
|
4
|
-
import { changeAsyncProvider, changeProvider } from "./Change.js";
|
|
5
|
-
/** Database with a synchronous or asynchronous provider. */
|
|
6
|
-
class BaseDatabase {
|
|
7
|
-
}
|
|
8
|
-
/** Database with a synchronous provider. */
|
|
9
|
-
export class Database {
|
|
10
|
-
constructor(provider) {
|
|
11
|
-
this.provider = provider;
|
|
12
|
-
}
|
|
13
|
-
collection(collection) {
|
|
14
|
-
return new Collection(this, collection);
|
|
15
|
-
}
|
|
16
|
-
query(collection, filters, sorts, limit) {
|
|
17
|
-
return new Query(this, collection, filters, sorts, limit);
|
|
18
|
-
}
|
|
19
|
-
item(collection, id) {
|
|
20
|
-
return new Item(this, collection, id);
|
|
21
|
-
}
|
|
22
|
-
change(...changes) {
|
|
23
|
-
return changeProvider(this.provider, changes);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/** Database with a synchronous provider. */
|
|
27
|
-
export class AsyncDatabase {
|
|
28
|
-
constructor(provider) {
|
|
29
|
-
this.provider = provider;
|
|
30
|
-
}
|
|
31
|
-
collection(collection) {
|
|
32
|
-
return new AsyncCollection(this, collection);
|
|
33
|
-
}
|
|
34
|
-
query(collection, filters, sorts, limit) {
|
|
35
|
-
return new AsyncQuery(this, collection, filters, sorts, limit);
|
|
36
|
-
}
|
|
37
|
-
item(collection, id) {
|
|
38
|
-
return new AsyncItem(this, collection, id);
|
|
39
|
-
}
|
|
40
|
-
change(...changes) {
|
|
41
|
-
return changeAsyncProvider(this.provider, changes);
|
|
42
|
-
}
|
|
43
|
-
}
|