@oimdb/react 2.2.0 → 3.1.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/README.md +260 -134
- package/dist/index.cjs +343 -726
- package/dist/index.d.cts +57 -46
- package/dist/index.d.ts +57 -46
- package/dist/index.js +329 -698
- package/llms.txt +4076 -0
- package/package.json +46 -36
package/dist/index.d.cts
CHANGED
|
@@ -1,50 +1,61 @@
|
|
|
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 {
|
|
2
|
+
import { DependencyList } from 'react';
|
|
3
|
+
import { OIMDB, TOIMSlot, TOIMComputedContentSlot, TOIMStoreKey, OIMSlotCollectionService, TOIMEntitySlot, TOIMStoreSlot, OIMSingleSlotService, TOIMEntityContentSlot, TOIMSingleSlotStore, TOIMBucketContentSlot, OIMSlotContentBucketService, TOIMEntityColumnName, OIMColumnSlotService, TOIMColumnSlot, OIMColumnSlotOwner, TOIMEntityColumnValue, TOIMBucketSlot, TOIMIndexableSlot, TOIMComputedSlot, OIMSingleComputedService, TOIMComputedSources, OIMComputedService, 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 TOIMComputedContentSlot[] | 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: TOIMComputedContentSlot<TValue>): TValue;
|
|
30
|
+
|
|
31
|
+
declare function useOIMEntity<TEntity extends object, TKey extends NonNullable<unknown> = 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<TOIMEntityContentSlot<TEntity>, unknown>, 'getSingleSlot' | 'holdSingleSlot'>, singleSlotStoreSlot: TOIMStoreSlot<TOIMSingleSlotStore<TOIMEntityContentSlot<TEntity>>, TOIMEntityContentSlot<TEntity>>): TEntity | undefined;
|
|
34
|
+
|
|
35
|
+
declare function useOIMSingleBucketSlots<TEntity extends object, TSlots = unknown>(singleSlotService: Pick<OIMSingleSlotService<TOIMBucketContentSlot<TSlots>, Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>>, 'getSingleSlot' | 'holdSingleSlot' | 'slotContentService'>, singleSlotStoreSlot: TOIMStoreSlot<TOIMSingleSlotStore<TOIMBucketContentSlot<TSlots>>, TOIMBucketContentSlot<TSlots>>): readonly TOIMEntitySlot<TEntity>[];
|
|
5
36
|
|
|
6
37
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
declare
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
declare
|
|
20
|
-
|
|
21
|
-
declare
|
|
22
|
-
|
|
23
|
-
declare
|
|
24
|
-
|
|
25
|
-
declare
|
|
26
|
-
|
|
27
|
-
declare
|
|
28
|
-
|
|
29
|
-
|
|
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 extends NonNullable<unknown> = TOIMStoreKey>(entityCollectionService: {
|
|
43
|
+
readonly columnSlotService: Pick<OIMColumnSlotService<TOIMEntitySlot<TEntity, TKey>, TName, TOIMColumnSlot, OIMColumnSlotOwner<TOIMSlot, TOIMColumnSlot>>, 'getColumn'>;
|
|
44
|
+
}, slot: TOIMEntitySlot<TEntity, TKey>, name: TName): TOIMEntityColumnValue<TEntity, TName> | undefined;
|
|
45
|
+
|
|
46
|
+
/** A bucket's slots, copied out of the service's LIVE container, in the collection's order. */
|
|
47
|
+
declare function useOIMBucketSlots<TEntity extends object, TSlots = unknown>(bucketCollectionService: {
|
|
48
|
+
readonly slotContentService: Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>;
|
|
49
|
+
}, bucketSlot: TOIMBucketContentSlot<TSlots>): readonly TOIMEntitySlot<TEntity>[];
|
|
50
|
+
|
|
51
|
+
declare function useOIMBucketSlotsByKey<TEntity extends object, TSlots = unknown, TKey extends NonNullable<unknown> = 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>[];
|
|
52
|
+
|
|
53
|
+
declare function useOIMSlotsByKeys<TKey extends NonNullable<unknown>, TSlot extends TOIMIndexableSlot<TKey>, TStore = unknown>(slotCollectionService: Pick<OIMSlotCollectionService<TKey, TSlot, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, storeSlot: TOIMStoreSlot<TStore, TSlot>, keys: readonly TKey[]): readonly TSlot[];
|
|
54
|
+
|
|
55
|
+
declare function useOIMComputedValueByKey<TValue, TKey extends NonNullable<unknown> = TOIMStoreKey, TStore = unknown>(computedCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMComputedSlot<TValue, TKey>, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, computedStoreSlot: TOIMStoreSlot<TStore, TOIMComputedSlot<TValue, TKey>>, key: TKey): TValue;
|
|
56
|
+
|
|
57
|
+
declare function useOIMSingleComputedValue<TValue>(computedService: OIMSingleComputedService<TValue>, derive: ((computedSlot: TOIMComputedContentSlot<TValue>) => TValue) | undefined, createSources: ((computedSlot: TOIMComputedContentSlot<TValue>) => Partial<TOIMComputedSources>) | undefined, dependencyList: DependencyList): TValue;
|
|
58
|
+
|
|
59
|
+
declare function useOIMComputedCollection<TKey extends NonNullable<unknown>, TValue, TStore>(computedService: OIMComputedService<TKey, TValue, TStore>, derive: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => TValue) | undefined, createSources: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => Partial<TOIMComputedSources>) | undefined, dependencyList: DependencyList): TOIMComputedStoreSlot<TStore, TValue, TOIMComputedSlot<TValue, TKey>>;
|
|
60
|
+
|
|
61
|
+
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,61 @@
|
|
|
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 {
|
|
2
|
+
import { DependencyList } from 'react';
|
|
3
|
+
import { OIMDB, TOIMSlot, TOIMComputedContentSlot, TOIMStoreKey, OIMSlotCollectionService, TOIMEntitySlot, TOIMStoreSlot, OIMSingleSlotService, TOIMEntityContentSlot, TOIMSingleSlotStore, TOIMBucketContentSlot, OIMSlotContentBucketService, TOIMEntityColumnName, OIMColumnSlotService, TOIMColumnSlot, OIMColumnSlotOwner, TOIMEntityColumnValue, TOIMBucketSlot, TOIMIndexableSlot, TOIMComputedSlot, OIMSingleComputedService, TOIMComputedSources, OIMComputedService, 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 TOIMComputedContentSlot[] | 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: TOIMComputedContentSlot<TValue>): TValue;
|
|
30
|
+
|
|
31
|
+
declare function useOIMEntity<TEntity extends object, TKey extends NonNullable<unknown> = 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<TOIMEntityContentSlot<TEntity>, unknown>, 'getSingleSlot' | 'holdSingleSlot'>, singleSlotStoreSlot: TOIMStoreSlot<TOIMSingleSlotStore<TOIMEntityContentSlot<TEntity>>, TOIMEntityContentSlot<TEntity>>): TEntity | undefined;
|
|
34
|
+
|
|
35
|
+
declare function useOIMSingleBucketSlots<TEntity extends object, TSlots = unknown>(singleSlotService: Pick<OIMSingleSlotService<TOIMBucketContentSlot<TSlots>, Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>>, 'getSingleSlot' | 'holdSingleSlot' | 'slotContentService'>, singleSlotStoreSlot: TOIMStoreSlot<TOIMSingleSlotStore<TOIMBucketContentSlot<TSlots>>, TOIMBucketContentSlot<TSlots>>): readonly TOIMEntitySlot<TEntity>[];
|
|
5
36
|
|
|
6
37
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
declare
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
declare
|
|
20
|
-
|
|
21
|
-
declare
|
|
22
|
-
|
|
23
|
-
declare
|
|
24
|
-
|
|
25
|
-
declare
|
|
26
|
-
|
|
27
|
-
declare
|
|
28
|
-
|
|
29
|
-
|
|
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 extends NonNullable<unknown> = TOIMStoreKey>(entityCollectionService: {
|
|
43
|
+
readonly columnSlotService: Pick<OIMColumnSlotService<TOIMEntitySlot<TEntity, TKey>, TName, TOIMColumnSlot, OIMColumnSlotOwner<TOIMSlot, TOIMColumnSlot>>, 'getColumn'>;
|
|
44
|
+
}, slot: TOIMEntitySlot<TEntity, TKey>, name: TName): TOIMEntityColumnValue<TEntity, TName> | undefined;
|
|
45
|
+
|
|
46
|
+
/** A bucket's slots, copied out of the service's LIVE container, in the collection's order. */
|
|
47
|
+
declare function useOIMBucketSlots<TEntity extends object, TSlots = unknown>(bucketCollectionService: {
|
|
48
|
+
readonly slotContentService: Pick<OIMSlotContentBucketService<TOIMEntitySlot<TEntity>, TSlots>, 'getBucketMemberSlots'>;
|
|
49
|
+
}, bucketSlot: TOIMBucketContentSlot<TSlots>): readonly TOIMEntitySlot<TEntity>[];
|
|
50
|
+
|
|
51
|
+
declare function useOIMBucketSlotsByKey<TEntity extends object, TSlots = unknown, TKey extends NonNullable<unknown> = 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>[];
|
|
52
|
+
|
|
53
|
+
declare function useOIMSlotsByKeys<TKey extends NonNullable<unknown>, TSlot extends TOIMIndexableSlot<TKey>, TStore = unknown>(slotCollectionService: Pick<OIMSlotCollectionService<TKey, TSlot, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, storeSlot: TOIMStoreSlot<TStore, TSlot>, keys: readonly TKey[]): readonly TSlot[];
|
|
54
|
+
|
|
55
|
+
declare function useOIMComputedValueByKey<TValue, TKey extends NonNullable<unknown> = TOIMStoreKey, TStore = unknown>(computedCollectionService: Pick<OIMSlotCollectionService<TKey, TOIMComputedSlot<TValue, TKey>, TStore, unknown>, 'getSlotByKey' | 'holdSlotByKey'>, computedStoreSlot: TOIMStoreSlot<TStore, TOIMComputedSlot<TValue, TKey>>, key: TKey): TValue;
|
|
56
|
+
|
|
57
|
+
declare function useOIMSingleComputedValue<TValue>(computedService: OIMSingleComputedService<TValue>, derive: ((computedSlot: TOIMComputedContentSlot<TValue>) => TValue) | undefined, createSources: ((computedSlot: TOIMComputedContentSlot<TValue>) => Partial<TOIMComputedSources>) | undefined, dependencyList: DependencyList): TValue;
|
|
58
|
+
|
|
59
|
+
declare function useOIMComputedCollection<TKey extends NonNullable<unknown>, TValue, TStore>(computedService: OIMComputedService<TKey, TValue, TStore>, derive: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => TValue) | undefined, createSources: ((computedSlot: TOIMComputedSlot<TValue, TKey>) => Partial<TOIMComputedSources>) | undefined, dependencyList: DependencyList): TOIMComputedStoreSlot<TStore, TValue, TOIMComputedSlot<TValue, TKey>>;
|
|
60
|
+
|
|
61
|
+
export { OIMDBContext, OIMDBProvider, type TOIMBinding, useOIMBucketSlots, useOIMBucketSlotsByKey, useOIMComputedCollection, useOIMComputedValue, useOIMComputedValueByKey, useOIMDB, useOIMEntity, useOIMField, useOIMSingleBucketSlots, useOIMSingleComputedValue, useOIMSingleEntity, useOIMSlotsByKeys, useOIMValue };
|