@arcote.tech/arc 0.0.27 → 0.1.2
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/dist/collection/collection.d.ts +28 -48
- package/dist/collection/queries/abstract-collection-query.d.ts +4 -6
- package/dist/collection/queries/{abstract-many-items.d.ts → find.d.ts} +8 -8
- package/dist/collection/queries/one-item.d.ts +1 -18
- package/dist/collection/query-builders/find-by-id.d.ts +2 -0
- package/dist/collection/query-builders/find-one.d.ts +2 -0
- package/dist/collection/query-builders/find.d.ts +13 -0
- package/dist/command/command.d.ts +29 -0
- package/dist/command/index.d.ts +2 -0
- package/dist/context/context.d.ts +34 -18
- package/dist/context/element.d.ts +36 -6
- package/dist/context/event.d.ts +39 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/query-builder-context.d.ts +15 -0
- package/dist/context/query-builders.d.ts +11 -2
- package/dist/context/query-cache.d.ts +9 -0
- package/dist/context/query.d.ts +5 -3
- package/dist/context/reactive-query.d.ts +23 -0
- package/dist/context/serializable-query.d.ts +11 -0
- package/dist/data-storage/store-state-fork.d.ts +2 -3
- package/dist/data-storage/store-state-master.d.ts +2 -5
- package/dist/data-storage/store-state.abstract.d.ts +2 -3
- package/dist/data-storage/types.d.ts +28 -0
- package/dist/db/index.d.ts +1 -0
- package/dist/db/interface.d.ts +2 -17
- package/dist/db/sqliteAdapter.d.ts +39 -0
- package/dist/dist/index.d.ts +513 -0
- package/dist/elements/abstract-primitive.d.ts +0 -1
- package/dist/elements/abstract.d.ts +2 -1
- package/dist/elements/array.d.ts +61 -3
- package/dist/elements/class.d.ts +1 -24
- package/dist/elements/date.d.ts +35 -2
- package/dist/elements/index.d.ts +2 -0
- package/dist/elements/number.d.ts +21 -6
- package/dist/elements/object.d.ts +38 -11
- package/dist/elements/or.d.ts +1 -11
- package/dist/elements/record.d.ts +16 -4
- package/dist/elements/string-enum.d.ts +17 -3
- package/dist/elements/string.d.ts +74 -6
- package/dist/elements/utils/type-validator-builder.d.ts +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1481 -752
- package/dist/model/index.d.ts +2 -0
- package/dist/model/model.d.ts +44 -38
- package/dist/state/query-builder.d.ts +1 -8
- package/dist/state/query.d.ts +1 -14
- package/dist/state/state.d.ts +1 -31
- package/dist/tests/context/context.test.d.ts +2 -0
- package/dist/tests/pipe.d.ts +2 -0
- package/dist/tests/query/advance-query.test.d.ts +2 -0
- package/dist/tests/query/collection-all.test.d.ts +2 -0
- package/dist/tests/utils/expect-not-false.d.ts +2 -0
- package/dist/tests/utils/sqlite-adapter.d.ts +3 -0
- package/dist/tests/utils/test-model.d.ts +26 -0
- package/dist/tests/validations/array.test.d.ts +2 -0
- package/dist/tests/validations/date.test.d.ts +2 -0
- package/dist/tests/validations/record.test.d.ts +2 -0
- package/dist/tests/validations/string-enum.test.d.ts +2 -0
- package/dist/utils/arcObjectToStoreSchema.d.ts +4 -0
- package/dist/utils/murmur-hash.d.ts +2 -0
- package/dist/utils.d.ts +4 -4
- package/dist/view/view.d.ts +49 -0
- package/package.json +11 -4
- package/dist/collection/collection-change.d.ts +0 -18
- package/dist/collection/db.d.ts +0 -17
- package/dist/collection/queries/all-items.d.ts +0 -7
- package/dist/collection/queries/indexed.d.ts +0 -13
- package/dist/collection/query-builders/abstract-many-items.d.ts +0 -11
- package/dist/collection/query-builders/all-items.d.ts +0 -9
- package/dist/collection/query-builders/indexed.d.ts +0 -11
- package/dist/collection/query-builders/one-item.d.ts +0 -11
- package/dist/collection/utils/index-query.d.ts +0 -6
- package/dist/data-storage/DataStorage.d.ts +0 -11
- package/dist/data-storage/ForkStoreState.d.ts +0 -32
- package/dist/data-storage/StoreState.d.ts +0 -39
- package/dist/data-storage/data-storage.d.ts +0 -2
- package/dist/data-storage/data-storage.interface.d.ts +0 -46
- package/dist/data-storage/master-store-state.d.ts +0 -30
- package/dist/data-storage/store-state.d.ts +0 -39
- package/dist/elements/object copy.d.ts +0 -29
- package/dist/rtc/deserializeChanges.d.ts +0 -3
- package/dist/state/db.d.ts +0 -15
- package/dist/state/state-change.d.ts +0 -14
- package/dist/state/util.d.ts +0 -3
- package/dist/tests/query/query.test.d.ts +0 -2
- package/dist/tests/query-notification-optimization.test copy.d.ts +0 -2
- package/dist/tests/query-notification-optimization.test.d.ts +0 -2
- package/dist/tests/validation.test.d.ts +0 -2
- package/dist/tests/validations/validation.test.d.ts +0 -2
- package/dist/utils/deep-merge.d.ts +0 -6
- /package/dist/{elements/tests → tests/validations}/object.test.d.ts +0 -0
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ForkStoreState,
|
|
3
|
-
QueryListener,
|
|
4
|
-
QueryListenerCallback,
|
|
5
|
-
StoreStateChange,
|
|
6
|
-
} from "./data-storage";
|
|
7
|
-
import type { DataStorage } from "./data-storage.abstract";
|
|
8
|
-
export declare abstract class StoreState<
|
|
9
|
-
Item extends {
|
|
10
|
-
_id: string;
|
|
11
|
-
},
|
|
12
|
-
> {
|
|
13
|
-
storeName: string;
|
|
14
|
-
protected dataStorage: DataStorage;
|
|
15
|
-
protected deserialize?: ((data: any) => Item) | undefined;
|
|
16
|
-
protected listeners: Set<QueryListener<Item>>;
|
|
17
|
-
protected indexQueryCache: Map<string, Item[]>;
|
|
18
|
-
constructor(
|
|
19
|
-
storeName: string,
|
|
20
|
-
dataStorage: DataStorage,
|
|
21
|
-
deserialize?: ((data: any) => Item) | undefined
|
|
22
|
-
);
|
|
23
|
-
abstract applyChanges(changes: StoreStateChange<Item>[]): Promise<void>;
|
|
24
|
-
fork(): ForkStoreState<Item>;
|
|
25
|
-
findByIndex(
|
|
26
|
-
index: string,
|
|
27
|
-
data: any,
|
|
28
|
-
listener?: QueryListenerCallback<Item>
|
|
29
|
-
): Promise<Item[]>;
|
|
30
|
-
set(item: Item): void;
|
|
31
|
-
remove(id: string): void;
|
|
32
|
-
modify(id: string, data: Partial<Item>): void;
|
|
33
|
-
unsubscribe(listener: QueryListener<Item>): void;
|
|
34
|
-
private notifyListeners;
|
|
35
|
-
private getAllLocalItems;
|
|
36
|
-
private mergeWithLocalModifications;
|
|
37
|
-
private matchesIndex;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=store-state.d.ts.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { objectUtil, type util } from "../utils";
|
|
2
|
-
import { ArcAbstract } from "./abstract";
|
|
3
|
-
import type { ArcElement } from "./element";
|
|
4
|
-
export declare type ArcRawShape = {
|
|
5
|
-
[k: string]: ArcElement;
|
|
6
|
-
};
|
|
7
|
-
export declare class ArcObject<E extends ArcRawShape> extends ArcAbstract {
|
|
8
|
-
private rawShape;
|
|
9
|
-
constructor(rawShape: E);
|
|
10
|
-
parse(value: {
|
|
11
|
-
[key in keyof E]: util.FirstArgument<E[key]["parse"]>;
|
|
12
|
-
}): {
|
|
13
|
-
[key in keyof E]: ReturnType<E[key]["parse"]>;
|
|
14
|
-
};
|
|
15
|
-
serialize(value: {
|
|
16
|
-
[key in keyof E]: util.FirstArgument<E[key]["serialize"]>;
|
|
17
|
-
}): {
|
|
18
|
-
[key in keyof E]: ReturnType<E[key]["serialize"]>;
|
|
19
|
-
};
|
|
20
|
-
deserialize(value: objectUtil.addQuestionMarks<{
|
|
21
|
-
[key in keyof E]: util.FirstArgument<E[key]["deserialize"]>;
|
|
22
|
-
}>): {
|
|
23
|
-
[key in keyof E]: ReturnType<E[key]["deserialize"]>;
|
|
24
|
-
};
|
|
25
|
-
deserializePath(path: string[], value: any): any;
|
|
26
|
-
}
|
|
27
|
-
export type ArcObjectAny = ArcObject<any>;
|
|
28
|
-
export declare function object<E extends ArcRawShape>(element: E): ArcObject<E>;
|
|
29
|
-
//# sourceMappingURL=object%20copy.d.ts.map
|
package/dist/state/db.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ReadTransaction, ReadWriteTransaction } from "../db/interface";
|
|
2
|
-
import type { ArcStateAny } from "./state";
|
|
3
|
-
import type { StateItem } from "./util";
|
|
4
|
-
export declare class StateReadTransaction {
|
|
5
|
-
protected dbTransaction: ReadTransaction;
|
|
6
|
-
constructor(dbTransaction: ReadTransaction);
|
|
7
|
-
find<S extends ArcStateAny>(state: S): Promise<StateItem<S> | undefined>;
|
|
8
|
-
}
|
|
9
|
-
export declare class StateReadWriteTransaction extends StateReadTransaction {
|
|
10
|
-
protected dbTransaction: ReadWriteTransaction;
|
|
11
|
-
constructor(dbTransaction: ReadWriteTransaction);
|
|
12
|
-
set<C extends ArcStateAny>(state: C, data: StateItem<C>): Promise<void>;
|
|
13
|
-
commit(): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=db.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Patches } from "mutative";
|
|
2
|
-
export type StateChange = {
|
|
3
|
-
state: string;
|
|
4
|
-
} & ({
|
|
5
|
-
type: "set";
|
|
6
|
-
body: any;
|
|
7
|
-
} | {
|
|
8
|
-
type: "mutate";
|
|
9
|
-
patches: Patches<any>;
|
|
10
|
-
});
|
|
11
|
-
export type StateEvent = Exclude<StateChange, {
|
|
12
|
-
type: "mutate";
|
|
13
|
-
}>;
|
|
14
|
-
//# sourceMappingURL=state-change.d.ts.map
|
package/dist/state/util.d.ts
DELETED
|
File without changes
|