UNPKG

@donverduyn/react-runtime

Version:
17 lines (16 loc) 1.32 kB
import type { DryRunApi } from '@/hooks/useDryRun/factories/DryRunFactory'; import type { ProviderTreeApi } from '@/hooks/useProviderTree/useProviderTree'; import type { RegisterId, RuntimeInstance, RuntimeKey, ScopeId } from '@/types'; import { type TreeMapStore } from '../useTreeMap/useTreeMap'; export declare const useRuntimeProvider: (scopeId: ScopeId, id: RegisterId, treeMap: TreeMapStore, providerTree: ProviderTreeApi, dryRunInstance?: DryRunApi | null) => { gcUnpromoted: () => void; keepAlive: () => void; promote: () => void; getByKey: (currentId: RegisterId | undefined, key: RuntimeKey, index?: number, snapshot?: ReturnType<() => Map<RegisterId, Map<symbol, Map<number, import("@/types").RuntimeId>>>> | null) => [RuntimeInstance<any> | null, boolean]; getSnapshot: () => Map<RegisterId, Map<symbol, Map<number, import("@/types").RuntimeId>>>; mergeIsolatedById: (registerId: RegisterId) => void; register: <R, P extends Record<string, unknown>>(id: RegisterId, payload: import("@/types").RuntimePayload<R, P>) => RuntimeInstance<any, any>; registerIsolated: <R, P extends Record<PropertyKey, unknown>>(id: RegisterId, payload: import("@/types").RuntimePayload<R, P>) => RuntimeInstance<any, any>; gcIsolated: (id: RegisterId) => void; unregister: () => void; };