import {BridgeAPIOptions} from "./options.js";
import {APIParams, ResolveAPI} from "./api.js";
import {BridgeRegistry} from "./bridge.js";
export type BoundaryContextValue = BridgeAPIOptions> = {
bridge: BridgeRegistry;
parent?: BoundaryContextValue;
payload: P;
};
export type BoundaryProps = BridgeAPIOptions> =
undefined extends P ? {
contextValue?: BoundaryContextValue;
payload?: P;
} : (
| {
payload: P,
contextValue?: BoundaryContextValue;
}
| {
contextValue: BoundaryContextValue;
payload?: P,
});
export type BoundaryAPI = BridgeAPIOptions, P = any> = {
payload: P;
getAPI: (name: N) => ResolveAPI,
parent: BoundaryContextValue | undefined,
}