stroid 0.1.0 → 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/CHANGELOG.md +232 -108
- package/README.md +157 -577
- package/dist/async.d.ts +5 -3
- package/dist/async.js +28 -23
- package/dist/async.js.map +1 -0
- package/dist/cache.d.ts +12 -0
- package/dist/computed.d.ts +19 -8
- package/dist/computed.js +12 -10
- package/dist/computed.js.map +1 -0
- package/dist/core.d.ts +5 -5
- package/dist/core.js +16 -23
- package/dist/core.js.map +1 -0
- package/dist/devtools.d.ts +12 -1
- package/dist/devtools.js +2 -1
- package/dist/devtools.js.map +1 -0
- package/dist/feature.d.ts +92 -0
- package/dist/feature.js +2 -0
- package/dist/feature.js.map +1 -0
- package/dist/helpers.d.ts +13 -5
- package/dist/helpers.js +16 -13
- package/dist/helpers.js.map +1 -0
- package/dist/index-internal.d.ts +44 -0
- package/dist/index.d.cts +91 -52
- package/dist/index.d.ts +91 -52
- package/dist/index.js +27 -21
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +6 -0
- package/dist/install.js +2 -0
- package/dist/install.js.map +1 -0
- package/dist/{options-CB35e3Xo.d.cts → options.d.ts} +52 -2
- package/dist/persist.d.ts +1 -2
- package/dist/persist.js +2 -1
- package/dist/persist.js.map +1 -0
- package/dist/{react.d.cts → react/index.d.ts} +28 -10
- package/dist/react/index.js +38 -0
- package/dist/react/index.js.map +1 -0
- package/dist/registry.d.ts +117 -0
- package/dist/runtime-admin.js +2 -1
- package/dist/runtime-admin.js.map +1 -0
- package/dist/runtime-tools.d.ts +44 -17
- package/dist/runtime-tools.js +3 -2
- package/dist/runtime-tools.js.map +1 -0
- package/dist/selectors.js +2 -1
- package/dist/selectors.js.map +1 -0
- package/dist/server.d.ts +27 -11
- package/dist/server.js +12 -9
- package/dist/server.js.map +1 -0
- package/dist/store-registry.d.ts +80 -0
- package/dist/sync.d.ts +1 -2
- package/dist/sync.js +2 -1
- package/dist/sync.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +16 -13
- package/dist/testing.js.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types/adapters/options.d.ts +90 -2
- package/dist/types/async/cache.d.ts +39 -0
- package/dist/types/async/clone.d.ts +9 -1
- package/dist/types/{async-fetch.d.ts → async/fetch.d.ts} +2 -2
- package/dist/types/async/inflight.d.ts +1 -1
- package/dist/types/{async-registry.d.ts → async/registry.d.ts} +25 -5
- package/dist/types/async/request.d.ts +9 -1
- package/dist/types/async.d.ts +10 -2
- package/dist/types/{computed-graph.d.ts → computed/computed-graph.d.ts} +4 -6
- package/dist/types/{computed.d.ts → computed/index.d.ts} +3 -2
- package/dist/types/config.d.ts +9 -1
- package/dist/types/core/index.d.ts +11 -0
- package/dist/types/core/lifecycle-hooks.d.ts +16 -0
- package/dist/types/core/store-admin-impl.d.ts +9 -0
- package/dist/types/core/store-admin.d.ts +9 -0
- package/dist/types/core/store-core.d.ts +13 -0
- package/dist/types/core/store-create.d.ts +16 -0
- package/dist/types/core/store-hydrate-impl.d.ts +35 -0
- package/dist/types/core/store-hydrate.d.ts +9 -0
- package/dist/types/core/store-lifecycle/hooks.d.ts +19 -0
- package/dist/types/{store-lifecycle → core/store-lifecycle}/identity.d.ts +3 -3
- package/dist/types/{store-lifecycle → core/store-lifecycle}/registry.d.ts +22 -8
- package/dist/types/{store-lifecycle → core/store-lifecycle}/types.d.ts +29 -1
- package/dist/types/{store-lifecycle → core/store-lifecycle}/validation.d.ts +11 -3
- package/dist/types/core/store-name.d.ts +28 -0
- package/dist/types/{store-notify.d.ts → core/store-notify.d.ts} +1 -1
- package/dist/types/{store-read.d.ts → core/store-read.d.ts} +8 -2
- package/dist/types/{store-registry.d.ts → core/store-registry.d.ts} +44 -10
- package/dist/types/core/store-replace-impl.d.ts +11 -0
- package/dist/types/core/store-replace.d.ts +9 -0
- package/dist/types/core/store-set-impl.d.ts +13 -0
- package/dist/types/core/store-set.d.ts +9 -0
- package/dist/types/core/store-shared/core.d.ts +13 -0
- package/dist/types/core/store-shared/notify.d.ts +12 -0
- package/dist/types/{store-transaction.d.ts → core/store-transaction.d.ts} +15 -1
- package/dist/types/core/store-write-shared.d.ts +19 -0
- package/dist/types/core/store-write.d.ts +13 -0
- package/dist/types/features/feature-registry.d.ts +91 -0
- package/dist/types/features/lifecycle.d.ts +12 -0
- package/dist/types/index.d.ts +13 -2
- package/dist/types/integrations/query.d.ts +2 -2
- package/dist/types/internals/computed-order.d.ts +3 -0
- package/dist/types/internals/config.d.ts +56 -2
- package/dist/types/internals/reporting.d.ts +1 -0
- package/dist/types/internals/store-admin.d.ts +1 -1
- package/dist/types/internals/store-ops.d.ts +13 -3
- package/dist/types/internals/test-reset.d.ts +2 -0
- package/dist/types/internals/write-context.d.ts +15 -0
- package/dist/types/notification/delivery.d.ts +3 -0
- package/dist/types/notification/index.d.ts +10 -0
- package/dist/types/notification/metrics.d.ts +12 -0
- package/dist/types/notification/priority.d.ts +9 -0
- package/dist/types/notification/scheduler.d.ts +11 -0
- package/dist/types/notification/snapshot.d.ts +8 -0
- package/dist/types/runtime-tools/index.d.ts +58 -0
- package/dist/types/store.d.ts +16 -7
- package/dist/types/types/utility.d.ts +17 -0
- package/dist/types/utils/devfreeze.d.ts +2 -0
- package/dist/types/utils.d.ts +8 -0
- package/dist/{types-grvlY4BX.d.cts → types.d.ts} +30 -2
- package/dist/utility.d.ts +15 -0
- package/package.json +35 -11
- package/dist/async-cache-DFHwcBQL.d.cts +0 -52
- package/dist/async-cache-DFHwcBQL.d.ts +0 -52
- package/dist/async.cjs +0 -29
- package/dist/async.d.cts +0 -40
- package/dist/computed-BbAZm1Dq.d.cts +0 -17
- package/dist/computed-CccdgY5j.d.ts +0 -17
- package/dist/computed.cjs +0 -11
- package/dist/computed.d.cts +0 -29
- package/dist/core.cjs +0 -30
- package/dist/core.d.cts +0 -5
- package/dist/devtools.cjs +0 -1
- package/dist/devtools.d.cts +0 -19
- package/dist/helpers.cjs +0 -20
- package/dist/helpers.d.cts +0 -29
- package/dist/index.cjs +0 -30
- package/dist/options-CB35e3Xo.d.ts +0 -245
- package/dist/persist.cjs +0 -1
- package/dist/persist.d.cts +0 -2
- package/dist/react.cjs +0 -31
- package/dist/react.d.ts +0 -52
- package/dist/react.js +0 -31
- package/dist/runtime-admin.cjs +0 -1
- package/dist/runtime-admin.d.cts +0 -4
- package/dist/runtime-tools.cjs +0 -3
- package/dist/runtime-tools.d.cts +0 -39
- package/dist/selectors.cjs +0 -1
- package/dist/selectors.d.cts +0 -4
- package/dist/server.cjs +0 -10
- package/dist/server.d.cts +0 -14
- package/dist/sync.cjs +0 -1
- package/dist/sync.d.cts +0 -2
- package/dist/testing.cjs +0 -20
- package/dist/testing.d.cts +0 -16
- package/dist/types/async-cache.d.ts +0 -57
- package/dist/types/core.d.ts +0 -1
- package/dist/types/devfreeze.d.ts +0 -1
- package/dist/types/feature-registry.d.ts +0 -69
- package/dist/types/internals/hooks-warnings.d.ts +0 -6
- package/dist/types/store-lifecycle/bind.d.ts +0 -3
- package/dist/types/store-lifecycle/hooks.d.ts +0 -44
- package/dist/types/store-lifecycle.d.ts +0 -20
- package/dist/types/store-name.d.ts +0 -19
- package/dist/types/store-write.d.ts +0 -45
- package/dist/types-grvlY4BX.d.ts +0 -37
- /package/dist/types/{async-retry.d.ts → async/retry.d.ts} +0 -0
- /package/dist/types/{runtime-admin.d.ts → runtime-admin/index.d.ts} +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { StoreKey, StoreValue } from "./store-lifecycle.js";
|
|
2
|
-
import { createStore } from "./store-write.js";
|
|
3
|
-
/**
|
|
4
|
-
* Helper to get an auto-completable, literal-typed store handle without creating it.
|
|
5
|
-
*
|
|
6
|
-
* Example:
|
|
7
|
-
* const user = store("user");
|
|
8
|
-
* setStore(user, "name", "Alex");
|
|
9
|
-
*/
|
|
10
|
-
export declare const store: <Name extends string, State = StoreValue>(name: Name) => StoreKey<Name, State>;
|
|
11
|
-
export declare const namespace: (ns: string) => {
|
|
12
|
-
store: <Name extends string, State = unknown>(name: Name) => StoreKey<Name, State>;
|
|
13
|
-
create: <Name extends string, State>(name: Name, data: State, options?: Parameters<typeof createStore>[2]) => import("./store-lifecycle.js").StoreDefinition<string, unknown> | undefined;
|
|
14
|
-
createStrict: <Name extends string, State>(name: Name, data: State, options?: Parameters<typeof createStore>[2]) => import("./store-lifecycle.js").StoreDefinition<string, unknown>;
|
|
15
|
-
set: (name: any, ...rest: any[]) => any;
|
|
16
|
-
get: (name: any, ...rest: any[]) => any;
|
|
17
|
-
delete: (name: string) => void;
|
|
18
|
-
reset: (name: string) => import("./store-lifecycle.js").WriteResult;
|
|
19
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type StoreOptions } from "./adapters/options.js";
|
|
2
|
-
import { type PartialDeep, type Path, type PathValue, type StoreDefinition, type StoreKey, type StoreName, type StateFor, type WriteResult } from "./store-lifecycle.js";
|
|
3
|
-
type LooseStoreNames = string extends StoreName ? true : false;
|
|
4
|
-
type StorePathFor<Name extends StoreName> = LooseStoreNames extends true ? string | string[] : Path<StateFor<Name>>;
|
|
5
|
-
type StorePathValueFor<Name extends StoreName, P extends StorePathFor<Name>> = LooseStoreNames extends true ? unknown : (P extends Path<StateFor<Name>> ? PathValue<StateFor<Name>, P> : never);
|
|
6
|
-
type HydrateSnapshot = Partial<{
|
|
7
|
-
[K in StoreName]: StateFor<K>;
|
|
8
|
-
}>;
|
|
9
|
-
type HydrateOptions<Snapshot extends Record<string, unknown>> = Partial<{
|
|
10
|
-
[K in keyof Snapshot]: StoreOptions<Snapshot[K]>;
|
|
11
|
-
}> & {
|
|
12
|
-
default?: StoreOptions;
|
|
13
|
-
};
|
|
14
|
-
type HydrationTrust<Snapshot extends Record<string, unknown>> = {
|
|
15
|
-
allowUntrusted?: boolean;
|
|
16
|
-
validate?: (snapshot: Snapshot) => boolean;
|
|
17
|
-
};
|
|
18
|
-
export declare const createStore: <Name extends string, State>(name: Name, initialData: State, option?: StoreOptions<State>) => StoreDefinition<Name, State> | undefined;
|
|
19
|
-
export declare const createStoreStrict: <Name extends string, State>(name: Name, initialData: State, option?: StoreOptions<State>) => StoreDefinition<Name, State>;
|
|
20
|
-
export declare function setStore<Name extends string, State, P extends Path<State>>(name: StoreDefinition<Name, State>, path: P, value: PathValue<State, P>): WriteResult;
|
|
21
|
-
export declare function setStore<Name extends string, State>(name: StoreDefinition<Name, State>, mutator: (draft: State) => void): WriteResult;
|
|
22
|
-
export declare function setStore<Name extends string, State>(name: StoreDefinition<Name, State>, data: PartialDeep<State>): WriteResult;
|
|
23
|
-
export declare function setStore<Name extends string, State, P extends Path<State>>(name: StoreKey<Name, State>, path: P, value: PathValue<State, P>): WriteResult;
|
|
24
|
-
export declare function setStore<Name extends string, State>(name: StoreKey<Name, State>, mutator: (draft: State) => void): WriteResult;
|
|
25
|
-
export declare function setStore<Name extends string, State>(name: StoreKey<Name, State>, data: PartialDeep<State>): WriteResult;
|
|
26
|
-
export declare function setStore<Name extends StoreName, P extends StorePathFor<Name>>(name: Name, path: P, value: StorePathValueFor<Name, P>): WriteResult;
|
|
27
|
-
export declare function setStore<Name extends StoreName>(name: Name, mutator: (draft: StateFor<Name>) => void): WriteResult;
|
|
28
|
-
export declare function setStore<Name extends StoreName>(name: Name, data: PartialDeep<StateFor<Name>>): WriteResult;
|
|
29
|
-
export declare function replaceStore<Name extends string, State>(name: StoreDefinition<Name, State>, value: State): WriteResult;
|
|
30
|
-
export declare function replaceStore<Name extends string, State>(name: StoreKey<Name, State>, value: State): WriteResult;
|
|
31
|
-
export declare function replaceStore<Name extends StoreName>(name: Name, value: StateFor<Name>): WriteResult;
|
|
32
|
-
export declare function deleteStore<Name extends string, State>(name: StoreDefinition<Name, State>): void;
|
|
33
|
-
export declare function deleteStore<Name extends string, State>(name: StoreKey<Name, State>): void;
|
|
34
|
-
export declare function deleteStore<Name extends StoreName>(name: Name): void;
|
|
35
|
-
export declare function resetStore<Name extends string, State>(name: StoreDefinition<Name, State>): WriteResult;
|
|
36
|
-
export declare function resetStore<Name extends string, State>(name: StoreKey<Name, State>): WriteResult;
|
|
37
|
-
export declare function resetStore<Name extends StoreName>(name: Name): WriteResult;
|
|
38
|
-
export declare const clearAllStores: () => void;
|
|
39
|
-
export declare const _hardResetAllStoresForTest: () => void;
|
|
40
|
-
export declare const hydrateStores: <Snapshot extends Record<string, unknown> = HydrateSnapshot>(snapshot: Snapshot, options?: HydrateOptions<Snapshot>, trust?: HydrationTrust<Snapshot>) => {
|
|
41
|
-
hydrated: string[];
|
|
42
|
-
created: string[];
|
|
43
|
-
failed: Record<string, string>;
|
|
44
|
-
};
|
|
45
|
-
export { useRegistry } from "./store-lifecycle.js";
|
package/dist/types-grvlY4BX.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
2
|
-
type PrevDepth = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
3
|
-
type PathInternal<T, Depth extends number> = Depth extends 0 ? never : T extends Primitive ? never : {
|
|
4
|
-
[K in keyof T & (string | number)]: T[K] extends Primitive | Array<unknown> ? `${K}` : `${K}` | `${K}.${PathInternal<T[K], PrevDepth[Depth]>}`;
|
|
5
|
-
}[keyof T & (string | number)];
|
|
6
|
-
type Path<T, Depth extends number = 10> = PathInternal<T, Depth>;
|
|
7
|
-
type PathValue<T, P extends Path<T>> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? Rest extends Path<T[K]> ? PathValue<T[K], Rest> : never : never : P extends keyof T ? T[P] : never;
|
|
8
|
-
type PartialDeep<T> = T extends Primitive ? T : unknown extends T ? T : {
|
|
9
|
-
[K in keyof T]?: PartialDeep<T[K]>;
|
|
10
|
-
};
|
|
11
|
-
type StoreValue = unknown;
|
|
12
|
-
interface StoreStateMap {
|
|
13
|
-
}
|
|
14
|
-
interface StrictStoreMap {
|
|
15
|
-
}
|
|
16
|
-
type RegisteredStoreMap = StoreStateMap & StrictStoreMap;
|
|
17
|
-
declare const storeNameBrand: unique symbol;
|
|
18
|
-
type BrandedStoreName = string & {
|
|
19
|
-
readonly [storeNameBrand]: true;
|
|
20
|
-
};
|
|
21
|
-
type StoreName = (keyof RegisteredStoreMap & string) | BrandedStoreName;
|
|
22
|
-
type StateFor<Name extends string> = Name extends keyof RegisteredStoreMap ? RegisteredStoreMap[Name] : StoreValue;
|
|
23
|
-
type StoreKey<Name extends string = string, State = StoreValue> = StoreDefinition<Name, State> & {
|
|
24
|
-
__store?: true;
|
|
25
|
-
};
|
|
26
|
-
interface StoreDefinition<Name extends string = string, State = StoreValue> {
|
|
27
|
-
name: Name;
|
|
28
|
-
state?: State;
|
|
29
|
-
}
|
|
30
|
-
type WriteResult = {
|
|
31
|
-
ok: true;
|
|
32
|
-
} | {
|
|
33
|
-
ok: false;
|
|
34
|
-
reason: "not-found" | "validate" | "path" | "middleware" | "ssr" | "invalid-args";
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type { PartialDeep as P, StoreName as S, WriteResult as W, StoreDefinition as a, StoreValue as b, StoreKey as c, StateFor as d, Path as e, PathValue as f, StoreStateMap as g, StrictStoreMap as h };
|
|
File without changes
|
|
File without changes
|