valdres 1.0.0-beta.42 → 1.0.0-beta.43
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.
|
@@ -90,6 +90,8 @@ export interface SelectorOptions<Value> {
|
|
|
90
90
|
readonly name?: string;
|
|
91
91
|
readonly equal?: (previous: Value, next: Value) => boolean;
|
|
92
92
|
}
|
|
93
|
+
export type UninferredValue<Value> = [Value][Value extends unknown ? 0 : never];
|
|
94
|
+
export type ComparatorValue<Value> = [Value] extends [unknown] ? Value : never;
|
|
93
95
|
export type AtomUpdater<Value> = (current: Value) => Value;
|
|
94
96
|
/** A scope-bound revocable view over one internal StoreTree draft. */
|
|
95
97
|
export interface RootTransaction {
|
package/dist/types/v1.d.ts
CHANGED
|
@@ -42,11 +42,11 @@ interface FamilyFactory {
|
|
|
42
42
|
<Factory extends AnyFamilyFactory>(createNode: NonEmptyFamilyFactory<Factory>, options: EncodedFamilyOptions<Parameters<Factory>>): (...args: Parameters<Factory>) => ReturnType<Factory>;
|
|
43
43
|
}
|
|
44
44
|
interface AtomFactory {
|
|
45
|
-
<Value>(initial: Value, options?: AtomOptions<Value
|
|
46
|
-
readonly lazy: <Value>(initialize: () => Value, options?: AtomOptions<Value
|
|
45
|
+
<Value>(initial: Value, options?: AtomOptions<import("./v1-internal/committed-store-tree/types.js").UninferredValue<Value>>): Atom<Value>;
|
|
46
|
+
readonly lazy: <Value>(initialize: () => Value, options?: AtomOptions<import("./v1-internal/committed-store-tree/types.js").ComparatorValue<Value>>) => Atom<Value>;
|
|
47
47
|
}
|
|
48
48
|
export declare const atom: AtomFactory;
|
|
49
|
-
export declare const selector: <Value>(read: (get: StateRead) => Value, options?: SelectorOptions<Value
|
|
49
|
+
export declare const selector: <Value>(read: (get: StateRead) => Value, options?: SelectorOptions<import("./v1-internal/committed-store-tree/types.js").ComparatorValue<Value>>) => Selector<Value>;
|
|
50
50
|
export declare const externalAtom: <Value>(...args: [source: ExternalSource<Value>, options?: ExternalAtomOptions]) => ExternalAtom<Value>;
|
|
51
51
|
export declare function collection<Key extends CollectionKey, Value extends CollectionValue>(options?: CollectionOptions<Key, Value, Key>): Collection<Key, Value, Key>;
|
|
52
52
|
export declare function collection<Key extends CollectionKey, Value extends CollectionValue, Input, Indexes extends CollectionIndexSchema<Indexes> = never>(options: CollectionOptions<Key, Value, Input, Indexes>): Collection<Key, Value, Input, Indexes>;
|
package/package.json
CHANGED