import {ApiNList, APIParams, ResolveAPI} from "./api.js"; import {BridgeAPIOptions} from "./options.js"; import {BoundaryContextValue} from "./boundary.js"; import React from "react"; import {CacheInitCbMap, InitializedOnInitMap, PendingResolverMap} from "./maps.js"; import {HookId} from "./tools.js"; export type BridgeRegistry = BridgeAPIOptions> = { [N in keyof A]?: { options?: O[N], apiNList?: ResolveAPI, /** * The hook id of the first useRegister that took ownership of this field * when it is in non-multi mode. Used to prevent later useRegister hooks * from silently overriding the API of an existing owner. */ ownerId?: HookId, } } export interface BridgeResolver, N extends keyof A> { initial: boolean; promise: Promise>; resolve: (apiNList: ApiNList) => void; } export interface ReactAPIBridge> { globalContextValue: BoundaryContextValue, BridgeContext: React.Context>, cacheInitCbMap: CacheInitCbMap, initializedOnInitMap: InitializedOnInitMap, bridgeOptions: O | undefined, pendingResolverMap: PendingResolverMap }