@oimdb/react 2.2.0 → 3.0.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/dist/index.d.cts CHANGED
@@ -1,50 +1,57 @@
1
- import { TOIMPk, OIMGlobalIndexArrayBased, OIMReactiveGlobalIndexArrayBased, OIMGlobalIndexSetBased, OIMReactiveGlobalIndexSetBased, OIMReactiveCollection, OIMIndexArrayBased, OIMReactiveIndexArrayBased, OIMIndexSetBased, OIMReactiveIndexSetBased, OIMReactiveObject, TOIMKeyPath } from '@oimdb/core';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
1
  import * as React from 'react';
4
- import { ReactNode } from 'react';
2
+ import { DependencyList } from 'react';
3
+ import { OIMDB, TOIMSlot, TOIMComputedSlot, TOIMStoreKey, OIMSlotCollectionService, TOIMEntitySlot, TOIMStoreSlot, OIMSingleSlotService, TOIMSingleSlotStore, TOIMBucketSlot, OIMSlotContentBucketService, TOIMEntityColumnName, TOIMColumnSlot, TOIMEntityColumnValue, TOIMIndexableSlot, OIMComputedService, TOIMComputedSources, TOIMComputedStoreSlot } from '@oimdb/core';
4
+
5
+ declare const OIMDBContext: React.Context<OIMDB | undefined>;
6
+
7
+ declare function OIMDBProvider({ db, children }: {
8
+ db: OIMDB;
9
+ children: React.ReactNode;
10
+ }): React.ReactElement;
11
+
12
+ declare function useOIMDB(): OIMDB;
13
+
14
+ type TOIMBinding<TValue> = {
15
+ readonly sourceSlots?: readonly TOIMSlot[] | undefined;
16
+ readonly sourceComputeds?: readonly TOIMComputedSlot[] | undefined;
17
+ readonly derive: () => TValue;
18
+ };
19
+
20
+ /**
21
+ * Applies a binding: one `OIMEffectService.INSTANCE.subscribeEffect` over its roots, its derivations settled before
22
+ * every read. THE BINDING MUST KEEP ITS IDENTITY ACROSS RENDERS — a fresh one per render
23
+ * resubscribes on every commit and never converges, freezing the screen rather than
24
+ * throwing. That, and why the snapshot is a counter bumped on subscribing, are in
25
+ * ../README.md.
26
+ */
27
+ declare function useOIMValue<TValue>(binding: TOIMBinding<TValue>): TValue;
28
+
29
+ declare function useOIMComputedValue<TValue>(computedSlot: TOIMComputedSlot<TValue>): TValue;
30
+
31
+ declare function useOIMEntity<TEntity extends object, TKey = TOIMStoreKey, TStore = unknown>(entityCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMEntitySlot<TEntity, TKey>, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, entityStoreSlot: TOIMStoreSlot<TStore, TOIMEntitySlot<TEntity, TKey>>, key: TKey): TEntity | undefined;
32
+
33
+ declare function useOIMSingleEntity<TEntity extends object>(singleSlotService: Pick<OIMSingleSlotService<TOIMEntitySlot<TEntity, void>, unknown>, 'getSingleSlot' | 'holdSingleSlot'>, singleSlotStoreSlot: TOIMStoreSlot<TOIMSingleSlotStore<TOIMEntitySlot<TEntity, void>>, TOIMEntitySlot<TEntity, void>>): TEntity | undefined;
34
+
35
+ declare function useOIMSingleBucketSlots<TEntity extends object, TSlots = unknown>(singleSlotService: Pick<OIMSingleSlotService<TOIMBucketSlot<TSlots, void>, Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>>, 'getSingleSlot' | 'holdSingleSlot' | 'slotContentService'>, singleSlotStoreSlot: TOIMStoreSlot<TOIMSingleSlotStore<TOIMBucketSlot<TSlots, void>>, TOIMBucketSlot<TSlots, void>>): readonly TOIMEntitySlot<TEntity>[];
5
36
 
6
37
  /**
7
- * Hooks for keyless "Global" (whole-collection / "all") indexes. Same shape as
8
- * the keyed `…ByIndexKey…` hooks, minus the `key` argument.
38
+ * One field of one identity. It cannot go through {@link useOIMValue}: a column identity is
39
+ * minted INSIDE the subscription, so there is no root slot a binding could name. `slot` is an
40
+ * ENTITY SLOT because an entity slot is what can be taken out from under this component — ../README.md.
9
41
  */
10
- declare const useSelectPksByGlobalIndexArrayBased: <TPk extends TOIMPk, TIndex extends OIMGlobalIndexArrayBased<TPk>>(reactiveIndex: OIMReactiveGlobalIndexArrayBased<TPk, TIndex>) => TPk[] | undefined;
11
- declare const useSelectPksByGlobalIndexSetBased: <TPk extends TOIMPk, TIndex extends OIMGlobalIndexSetBased<TPk>>(reactiveIndex: OIMReactiveGlobalIndexSetBased<TPk, TIndex>) => Set<TPk> | undefined;
12
- declare const useSelectEntitiesByGlobalIndexArrayBased: <TEntity extends object, TPk extends TOIMPk, TIndex extends OIMGlobalIndexArrayBased<TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveGlobalIndexArrayBased<TPk, TIndex>) => readonly (TEntity | undefined)[] | undefined;
13
- declare const useSelectEntitiesByGlobalIndexSetBased: <TEntity extends object, TPk extends TOIMPk, TIndex extends OIMGlobalIndexSetBased<TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveGlobalIndexSetBased<TPk, TIndex>) => readonly (TEntity | undefined)[] | undefined;
14
-
15
- declare const useSelectEntityByPkSignal: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pk: TPk) => TEntity | undefined;
16
- declare const useSelectPksByIndexKeyArrayBasedSignal: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, key: TKey) => readonly TPk[];
17
- declare const useSelectPksByIndexKeySetBasedSignal: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, key: TKey) => ReadonlySet<TPk>;
18
- declare const useSelectPksByGlobalIndexArrayBasedSignal: <TPk extends TOIMPk, TIndex extends OIMGlobalIndexArrayBased<TPk>>(reactiveIndex: OIMReactiveGlobalIndexArrayBased<TPk, TIndex>) => readonly TPk[];
19
- declare const useSelectPksByGlobalIndexSetBasedSignal: <TPk extends TOIMPk, TIndex extends OIMGlobalIndexSetBased<TPk>>(reactiveIndex: OIMReactiveGlobalIndexSetBased<TPk, TIndex>) => ReadonlySet<TPk>;
20
-
21
- declare const useSelectPksByIndexKeysSetBased: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, keys: readonly TKey[]) => TPk[] | undefined;
22
- declare const useSelectPksByIndexKeySetBased: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, key: TKey) => Set<TPk> | undefined;
23
- declare const useSelectPksByIndexKeysArrayBased: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, keys: readonly TKey[]) => TPk[] | undefined;
24
- declare const useSelectPksByIndexKeyArrayBased: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, key: TKey) => TPk[] | undefined;
25
- declare const useSelectEntityByPk: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pk: TPk) => TEntity | undefined;
26
- declare const useSelectValueByObjectKey: <TKey extends string, TValue>(reactiveObject: OIMReactiveObject<TKey, TValue>, key: TKey) => TValue | undefined;
27
- declare const useSelectValuesByObjectKeys: <TKey extends string, TValue>(reactiveObject: OIMReactiveObject<TKey, TValue>, keys: readonly TKey[]) => readonly (TValue | undefined)[] | undefined;
28
- declare const useSelectEntitiesByPks: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pks: readonly TPk[]) => readonly (TEntity | undefined)[] | undefined;
29
- declare const useSelectEntitiesByIndexKeySetBased: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, key: TKey) => readonly (TEntity | undefined)[] | undefined;
30
- declare const useSelectEntitiesByIndexKeysSetBased: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly (TEntity | undefined)[] | undefined;
31
- declare const useSelectEntitiesByIndexKeyArrayBased: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, key: TKey) => readonly (TEntity | undefined)[] | undefined;
32
- declare const useSelectEntitiesByIndexKeysArrayBased: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly (TEntity | undefined)[] | undefined;
33
- declare const useSelectPksByCompositeIndexKeySetBased: <TPk extends TOIMPk, TIndex extends OIMIndexSetBased<TOIMKeyPath, TPk>>(reactiveIndex: OIMReactiveIndexSetBased<TOIMKeyPath, TPk, TIndex>, key: TOIMKeyPath) => Set<TPk> | undefined;
34
- declare const useSelectPksByCompositeIndexKeyArrayBased: <TPk extends TOIMPk, TIndex extends OIMIndexArrayBased<TOIMKeyPath, TPk>>(reactiveIndex: OIMReactiveIndexArrayBased<TOIMKeyPath, TPk, TIndex>, key: TOIMKeyPath) => TPk[] | undefined;
35
- declare const useSelectEntitiesByCompositeIndexKeySetBased: <TEntity extends object, TPk extends TOIMPk, TIndex extends OIMIndexSetBased<TOIMKeyPath, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexSetBased<TOIMKeyPath, TPk, TIndex>, key: TOIMKeyPath) => readonly (TEntity | undefined)[] | undefined;
36
- declare const useSelectEntitiesByCompositeIndexKeyArrayBased: <TEntity extends object, TPk extends TOIMPk, TIndex extends OIMIndexArrayBased<TOIMKeyPath, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexArrayBased<TOIMKeyPath, TPk, TIndex>, key: TOIMKeyPath) => readonly (TEntity | undefined)[] | undefined;
37
-
38
- type CollectionsDictionary = Record<string, OIMReactiveCollection<any, any>>;
39
- type OIMContextValue<T extends CollectionsDictionary = CollectionsDictionary> = T;
40
- declare const OIMCollectionsContext: React.Context<CollectionsDictionary>;
41
- declare function createOIMCollectionsContext<T extends CollectionsDictionary = CollectionsDictionary>(): React.Context<OIMContextValue<T>>;
42
- interface OIMCollectionsProviderProps<T extends CollectionsDictionary = CollectionsDictionary> {
43
- collections: T;
44
- children: ReactNode;
45
- context?: React.Context<OIMContextValue<T>>;
46
- }
47
- declare function OIMCollectionsProvider<T extends CollectionsDictionary = CollectionsDictionary>({ collections, children, context }: OIMCollectionsProviderProps<T>): react_jsx_runtime.JSX.Element;
48
- declare function useOIMCollectionsContext<T extends CollectionsDictionary = CollectionsDictionary>(context?: React.Context<OIMContextValue<T>>): T;
49
-
50
- export { type CollectionsDictionary, OIMCollectionsContext, OIMCollectionsProvider, type OIMCollectionsProviderProps, type OIMContextValue, createOIMCollectionsContext, useOIMCollectionsContext, useSelectEntitiesByCompositeIndexKeyArrayBased, useSelectEntitiesByCompositeIndexKeySetBased, useSelectEntitiesByGlobalIndexArrayBased, useSelectEntitiesByGlobalIndexSetBased, useSelectEntitiesByIndexKeyArrayBased, useSelectEntitiesByIndexKeySetBased, useSelectEntitiesByIndexKeysArrayBased, useSelectEntitiesByIndexKeysSetBased, useSelectEntitiesByPks, useSelectEntityByPk, useSelectEntityByPkSignal, useSelectPksByCompositeIndexKeyArrayBased, useSelectPksByCompositeIndexKeySetBased, useSelectPksByGlobalIndexArrayBased, useSelectPksByGlobalIndexArrayBasedSignal, useSelectPksByGlobalIndexSetBased, useSelectPksByGlobalIndexSetBasedSignal, useSelectPksByIndexKeyArrayBased, useSelectPksByIndexKeyArrayBasedSignal, useSelectPksByIndexKeySetBased, useSelectPksByIndexKeySetBasedSignal, useSelectPksByIndexKeysArrayBased, useSelectPksByIndexKeysSetBased, useSelectValueByObjectKey, useSelectValuesByObjectKeys };
42
+ declare function useOIMField<TEntity extends object, TName extends TOIMEntityColumnName<TEntity>, TKey = TOIMStoreKey>(entityCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMEntitySlot<TEntity, TKey>, unknown, unknown, TName, TOIMColumnSlot>, 'getColumn'>, slot: TOIMEntitySlot<TEntity, TKey>, name: TName): TOIMEntityColumnValue<TEntity, TName> | undefined;
43
+
44
+ /** A bucket's slots, copied out of the service's LIVE container, in the collection's order. */
45
+ declare function useOIMBucketSlots<TEntity extends object, TSlots = unknown>(bucketCollectionService: Pick<OIMSlotCollectionService<unknown, TOIMBucketSlot<TSlots>, unknown, Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>>, 'slotContentService'>, bucketSlot: TOIMBucketSlot<TSlots>): readonly TOIMEntitySlot<TEntity>[];
46
+
47
+ declare function useOIMBucketSlotsByKey<TEntity extends object, TSlots = unknown, TKey = TOIMStoreKey, TStore = unknown>(bucketCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMBucketSlot<TSlots, TKey>, TStore, Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>>, 'getSlotByKey' | 'holdSlotByKey' | 'slotContentService'>, bucketStoreSlot: TOIMStoreSlot<TStore, TOIMBucketSlot<TSlots, TKey>>, key: TKey): readonly TOIMEntitySlot<TEntity>[];
48
+
49
+ declare function useOIMSlotsByKeys<TKey, TSlot extends TOIMIndexableSlot<TKey>, TStore = unknown>(slotCollectionService: Pick<OIMSlotCollectionService<TKey, TSlot, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, storeSlot: TOIMStoreSlot<TStore, TSlot>, keys: readonly TKey[]): readonly TSlot[];
50
+
51
+ declare function useOIMComputedValueByKey<TValue, TKey = TOIMStoreKey, TStore = unknown>(computedCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMComputedSlot<TValue, TKey>, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, computedStoreSlot: TOIMStoreSlot<TStore, TOIMComputedSlot<TValue, TKey>>, key: TKey): TValue;
52
+
53
+ declare function useOIMSingleComputedValue<TValue>(computedService: OIMComputedService<void, TValue, TOIMSingleSlotStore<TOIMComputedSlot<TValue, void>>>, derive: ((computedSlot: TOIMComputedSlot<TValue, void>) => TValue) | undefined, createSources: ((key: void, storeSlot: TOIMStoreSlot | undefined) => Partial<TOIMComputedSources>) | undefined, dependencyList: DependencyList): TValue;
54
+
55
+ declare function useOIMComputedCollection<TKey, TValue, TStore>(computedService: OIMComputedService<TKey, TValue, TStore>, derive: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => TValue) | undefined, createSources: ((key: TKey, storeSlot: TOIMStoreSlot | undefined) => Partial<TOIMComputedSources>) | undefined, dependencyList: DependencyList): TOIMComputedStoreSlot<TStore, TValue, TKey>;
56
+
57
+ export { OIMDBContext, OIMDBProvider, type TOIMBinding, useOIMBucketSlots, useOIMBucketSlotsByKey, useOIMComputedCollection, useOIMComputedValue, useOIMComputedValueByKey, useOIMDB, useOIMEntity, useOIMField, useOIMSingleBucketSlots, useOIMSingleComputedValue, useOIMSingleEntity, useOIMSlotsByKeys, useOIMValue };
package/dist/index.d.ts CHANGED
@@ -1,50 +1,57 @@
1
- import { TOIMPk, OIMGlobalIndexArrayBased, OIMReactiveGlobalIndexArrayBased, OIMGlobalIndexSetBased, OIMReactiveGlobalIndexSetBased, OIMReactiveCollection, OIMIndexArrayBased, OIMReactiveIndexArrayBased, OIMIndexSetBased, OIMReactiveIndexSetBased, OIMReactiveObject, TOIMKeyPath } from '@oimdb/core';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
1
  import * as React from 'react';
4
- import { ReactNode } from 'react';
2
+ import { DependencyList } from 'react';
3
+ import { OIMDB, TOIMSlot, TOIMComputedSlot, TOIMStoreKey, OIMSlotCollectionService, TOIMEntitySlot, TOIMStoreSlot, OIMSingleSlotService, TOIMSingleSlotStore, TOIMBucketSlot, OIMSlotContentBucketService, TOIMEntityColumnName, TOIMColumnSlot, TOIMEntityColumnValue, TOIMIndexableSlot, OIMComputedService, TOIMComputedSources, TOIMComputedStoreSlot } from '@oimdb/core';
4
+
5
+ declare const OIMDBContext: React.Context<OIMDB | undefined>;
6
+
7
+ declare function OIMDBProvider({ db, children }: {
8
+ db: OIMDB;
9
+ children: React.ReactNode;
10
+ }): React.ReactElement;
11
+
12
+ declare function useOIMDB(): OIMDB;
13
+
14
+ type TOIMBinding<TValue> = {
15
+ readonly sourceSlots?: readonly TOIMSlot[] | undefined;
16
+ readonly sourceComputeds?: readonly TOIMComputedSlot[] | undefined;
17
+ readonly derive: () => TValue;
18
+ };
19
+
20
+ /**
21
+ * Applies a binding: one `OIMEffectService.INSTANCE.subscribeEffect` over its roots, its derivations settled before
22
+ * every read. THE BINDING MUST KEEP ITS IDENTITY ACROSS RENDERS — a fresh one per render
23
+ * resubscribes on every commit and never converges, freezing the screen rather than
24
+ * throwing. That, and why the snapshot is a counter bumped on subscribing, are in
25
+ * ../README.md.
26
+ */
27
+ declare function useOIMValue<TValue>(binding: TOIMBinding<TValue>): TValue;
28
+
29
+ declare function useOIMComputedValue<TValue>(computedSlot: TOIMComputedSlot<TValue>): TValue;
30
+
31
+ declare function useOIMEntity<TEntity extends object, TKey = TOIMStoreKey, TStore = unknown>(entityCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMEntitySlot<TEntity, TKey>, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, entityStoreSlot: TOIMStoreSlot<TStore, TOIMEntitySlot<TEntity, TKey>>, key: TKey): TEntity | undefined;
32
+
33
+ declare function useOIMSingleEntity<TEntity extends object>(singleSlotService: Pick<OIMSingleSlotService<TOIMEntitySlot<TEntity, void>, unknown>, 'getSingleSlot' | 'holdSingleSlot'>, singleSlotStoreSlot: TOIMStoreSlot<TOIMSingleSlotStore<TOIMEntitySlot<TEntity, void>>, TOIMEntitySlot<TEntity, void>>): TEntity | undefined;
34
+
35
+ declare function useOIMSingleBucketSlots<TEntity extends object, TSlots = unknown>(singleSlotService: Pick<OIMSingleSlotService<TOIMBucketSlot<TSlots, void>, Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>>, 'getSingleSlot' | 'holdSingleSlot' | 'slotContentService'>, singleSlotStoreSlot: TOIMStoreSlot<TOIMSingleSlotStore<TOIMBucketSlot<TSlots, void>>, TOIMBucketSlot<TSlots, void>>): readonly TOIMEntitySlot<TEntity>[];
5
36
 
6
37
  /**
7
- * Hooks for keyless "Global" (whole-collection / "all") indexes. Same shape as
8
- * the keyed `…ByIndexKey…` hooks, minus the `key` argument.
38
+ * One field of one identity. It cannot go through {@link useOIMValue}: a column identity is
39
+ * minted INSIDE the subscription, so there is no root slot a binding could name. `slot` is an
40
+ * ENTITY SLOT because an entity slot is what can be taken out from under this component — ../README.md.
9
41
  */
10
- declare const useSelectPksByGlobalIndexArrayBased: <TPk extends TOIMPk, TIndex extends OIMGlobalIndexArrayBased<TPk>>(reactiveIndex: OIMReactiveGlobalIndexArrayBased<TPk, TIndex>) => TPk[] | undefined;
11
- declare const useSelectPksByGlobalIndexSetBased: <TPk extends TOIMPk, TIndex extends OIMGlobalIndexSetBased<TPk>>(reactiveIndex: OIMReactiveGlobalIndexSetBased<TPk, TIndex>) => Set<TPk> | undefined;
12
- declare const useSelectEntitiesByGlobalIndexArrayBased: <TEntity extends object, TPk extends TOIMPk, TIndex extends OIMGlobalIndexArrayBased<TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveGlobalIndexArrayBased<TPk, TIndex>) => readonly (TEntity | undefined)[] | undefined;
13
- declare const useSelectEntitiesByGlobalIndexSetBased: <TEntity extends object, TPk extends TOIMPk, TIndex extends OIMGlobalIndexSetBased<TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveGlobalIndexSetBased<TPk, TIndex>) => readonly (TEntity | undefined)[] | undefined;
14
-
15
- declare const useSelectEntityByPkSignal: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pk: TPk) => TEntity | undefined;
16
- declare const useSelectPksByIndexKeyArrayBasedSignal: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, key: TKey) => readonly TPk[];
17
- declare const useSelectPksByIndexKeySetBasedSignal: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, key: TKey) => ReadonlySet<TPk>;
18
- declare const useSelectPksByGlobalIndexArrayBasedSignal: <TPk extends TOIMPk, TIndex extends OIMGlobalIndexArrayBased<TPk>>(reactiveIndex: OIMReactiveGlobalIndexArrayBased<TPk, TIndex>) => readonly TPk[];
19
- declare const useSelectPksByGlobalIndexSetBasedSignal: <TPk extends TOIMPk, TIndex extends OIMGlobalIndexSetBased<TPk>>(reactiveIndex: OIMReactiveGlobalIndexSetBased<TPk, TIndex>) => ReadonlySet<TPk>;
20
-
21
- declare const useSelectPksByIndexKeysSetBased: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, keys: readonly TKey[]) => TPk[] | undefined;
22
- declare const useSelectPksByIndexKeySetBased: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, key: TKey) => Set<TPk> | undefined;
23
- declare const useSelectPksByIndexKeysArrayBased: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, keys: readonly TKey[]) => TPk[] | undefined;
24
- declare const useSelectPksByIndexKeyArrayBased: <TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, key: TKey) => TPk[] | undefined;
25
- declare const useSelectEntityByPk: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pk: TPk) => TEntity | undefined;
26
- declare const useSelectValueByObjectKey: <TKey extends string, TValue>(reactiveObject: OIMReactiveObject<TKey, TValue>, key: TKey) => TValue | undefined;
27
- declare const useSelectValuesByObjectKeys: <TKey extends string, TValue>(reactiveObject: OIMReactiveObject<TKey, TValue>, keys: readonly TKey[]) => readonly (TValue | undefined)[] | undefined;
28
- declare const useSelectEntitiesByPks: <TEntity extends object, TPk extends TOIMPk>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, pks: readonly TPk[]) => readonly (TEntity | undefined)[] | undefined;
29
- declare const useSelectEntitiesByIndexKeySetBased: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, key: TKey) => readonly (TEntity | undefined)[] | undefined;
30
- declare const useSelectEntitiesByIndexKeysSetBased: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexSetBased<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexSetBased<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly (TEntity | undefined)[] | undefined;
31
- declare const useSelectEntitiesByIndexKeyArrayBased: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, key: TKey) => readonly (TEntity | undefined)[] | undefined;
32
- declare const useSelectEntitiesByIndexKeysArrayBased: <TEntity extends object, TPk extends TOIMPk, TKey extends TOIMPk, TIndex extends OIMIndexArrayBased<TKey, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexArrayBased<TKey, TPk, TIndex>, keys: readonly TKey[]) => readonly (TEntity | undefined)[] | undefined;
33
- declare const useSelectPksByCompositeIndexKeySetBased: <TPk extends TOIMPk, TIndex extends OIMIndexSetBased<TOIMKeyPath, TPk>>(reactiveIndex: OIMReactiveIndexSetBased<TOIMKeyPath, TPk, TIndex>, key: TOIMKeyPath) => Set<TPk> | undefined;
34
- declare const useSelectPksByCompositeIndexKeyArrayBased: <TPk extends TOIMPk, TIndex extends OIMIndexArrayBased<TOIMKeyPath, TPk>>(reactiveIndex: OIMReactiveIndexArrayBased<TOIMKeyPath, TPk, TIndex>, key: TOIMKeyPath) => TPk[] | undefined;
35
- declare const useSelectEntitiesByCompositeIndexKeySetBased: <TEntity extends object, TPk extends TOIMPk, TIndex extends OIMIndexSetBased<TOIMKeyPath, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexSetBased<TOIMKeyPath, TPk, TIndex>, key: TOIMKeyPath) => readonly (TEntity | undefined)[] | undefined;
36
- declare const useSelectEntitiesByCompositeIndexKeyArrayBased: <TEntity extends object, TPk extends TOIMPk, TIndex extends OIMIndexArrayBased<TOIMKeyPath, TPk>>(reactiveCollection: OIMReactiveCollection<TEntity, TPk>, reactiveIndex: OIMReactiveIndexArrayBased<TOIMKeyPath, TPk, TIndex>, key: TOIMKeyPath) => readonly (TEntity | undefined)[] | undefined;
37
-
38
- type CollectionsDictionary = Record<string, OIMReactiveCollection<any, any>>;
39
- type OIMContextValue<T extends CollectionsDictionary = CollectionsDictionary> = T;
40
- declare const OIMCollectionsContext: React.Context<CollectionsDictionary>;
41
- declare function createOIMCollectionsContext<T extends CollectionsDictionary = CollectionsDictionary>(): React.Context<OIMContextValue<T>>;
42
- interface OIMCollectionsProviderProps<T extends CollectionsDictionary = CollectionsDictionary> {
43
- collections: T;
44
- children: ReactNode;
45
- context?: React.Context<OIMContextValue<T>>;
46
- }
47
- declare function OIMCollectionsProvider<T extends CollectionsDictionary = CollectionsDictionary>({ collections, children, context }: OIMCollectionsProviderProps<T>): react_jsx_runtime.JSX.Element;
48
- declare function useOIMCollectionsContext<T extends CollectionsDictionary = CollectionsDictionary>(context?: React.Context<OIMContextValue<T>>): T;
49
-
50
- export { type CollectionsDictionary, OIMCollectionsContext, OIMCollectionsProvider, type OIMCollectionsProviderProps, type OIMContextValue, createOIMCollectionsContext, useOIMCollectionsContext, useSelectEntitiesByCompositeIndexKeyArrayBased, useSelectEntitiesByCompositeIndexKeySetBased, useSelectEntitiesByGlobalIndexArrayBased, useSelectEntitiesByGlobalIndexSetBased, useSelectEntitiesByIndexKeyArrayBased, useSelectEntitiesByIndexKeySetBased, useSelectEntitiesByIndexKeysArrayBased, useSelectEntitiesByIndexKeysSetBased, useSelectEntitiesByPks, useSelectEntityByPk, useSelectEntityByPkSignal, useSelectPksByCompositeIndexKeyArrayBased, useSelectPksByCompositeIndexKeySetBased, useSelectPksByGlobalIndexArrayBased, useSelectPksByGlobalIndexArrayBasedSignal, useSelectPksByGlobalIndexSetBased, useSelectPksByGlobalIndexSetBasedSignal, useSelectPksByIndexKeyArrayBased, useSelectPksByIndexKeyArrayBasedSignal, useSelectPksByIndexKeySetBased, useSelectPksByIndexKeySetBasedSignal, useSelectPksByIndexKeysArrayBased, useSelectPksByIndexKeysSetBased, useSelectValueByObjectKey, useSelectValuesByObjectKeys };
42
+ declare function useOIMField<TEntity extends object, TName extends TOIMEntityColumnName<TEntity>, TKey = TOIMStoreKey>(entityCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMEntitySlot<TEntity, TKey>, unknown, unknown, TName, TOIMColumnSlot>, 'getColumn'>, slot: TOIMEntitySlot<TEntity, TKey>, name: TName): TOIMEntityColumnValue<TEntity, TName> | undefined;
43
+
44
+ /** A bucket's slots, copied out of the service's LIVE container, in the collection's order. */
45
+ declare function useOIMBucketSlots<TEntity extends object, TSlots = unknown>(bucketCollectionService: Pick<OIMSlotCollectionService<unknown, TOIMBucketSlot<TSlots>, unknown, Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>>, 'slotContentService'>, bucketSlot: TOIMBucketSlot<TSlots>): readonly TOIMEntitySlot<TEntity>[];
46
+
47
+ declare function useOIMBucketSlotsByKey<TEntity extends object, TSlots = unknown, TKey = TOIMStoreKey, TStore = unknown>(bucketCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMBucketSlot<TSlots, TKey>, TStore, Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>>, 'getSlotByKey' | 'holdSlotByKey' | 'slotContentService'>, bucketStoreSlot: TOIMStoreSlot<TStore, TOIMBucketSlot<TSlots, TKey>>, key: TKey): readonly TOIMEntitySlot<TEntity>[];
48
+
49
+ declare function useOIMSlotsByKeys<TKey, TSlot extends TOIMIndexableSlot<TKey>, TStore = unknown>(slotCollectionService: Pick<OIMSlotCollectionService<TKey, TSlot, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, storeSlot: TOIMStoreSlot<TStore, TSlot>, keys: readonly TKey[]): readonly TSlot[];
50
+
51
+ declare function useOIMComputedValueByKey<TValue, TKey = TOIMStoreKey, TStore = unknown>(computedCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMComputedSlot<TValue, TKey>, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, computedStoreSlot: TOIMStoreSlot<TStore, TOIMComputedSlot<TValue, TKey>>, key: TKey): TValue;
52
+
53
+ declare function useOIMSingleComputedValue<TValue>(computedService: OIMComputedService<void, TValue, TOIMSingleSlotStore<TOIMComputedSlot<TValue, void>>>, derive: ((computedSlot: TOIMComputedSlot<TValue, void>) => TValue) | undefined, createSources: ((key: void, storeSlot: TOIMStoreSlot | undefined) => Partial<TOIMComputedSources>) | undefined, dependencyList: DependencyList): TValue;
54
+
55
+ declare function useOIMComputedCollection<TKey, TValue, TStore>(computedService: OIMComputedService<TKey, TValue, TStore>, derive: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => TValue) | undefined, createSources: ((key: TKey, storeSlot: TOIMStoreSlot | undefined) => Partial<TOIMComputedSources>) | undefined, dependencyList: DependencyList): TOIMComputedStoreSlot<TStore, TValue, TKey>;
56
+
57
+ export { OIMDBContext, OIMDBProvider, type TOIMBinding, useOIMBucketSlots, useOIMBucketSlotsByKey, useOIMComputedCollection, useOIMComputedValue, useOIMComputedValueByKey, useOIMDB, useOIMEntity, useOIMField, useOIMSingleBucketSlots, useOIMSingleComputedValue, useOIMSingleEntity, useOIMSlotsByKeys, useOIMValue };