@mittwald/react-tunnel
Version:
It's like a Portal – but with React components
32 lines • 1.32 kB
TypeScript
import { ReactNode } from 'react';
import { ObservableMap } from 'mobx';
export declare const defaultTunnelProviderId = "default";
export type TunnelChildren = ReactNode | undefined | ((tunnelChildren?: ReactNode | undefined) => ReactNode | undefined);
interface TunnelEntryState {
index: number;
id: string;
children: TunnelChildren;
}
interface TunnelEntries {
committed: boolean;
entries: TunnelEntryState[];
}
export declare class TunnelState {
readonly id: string;
private instanceId;
readonly committedChildren: ObservableMap<string, ObservableMap<string, TunnelEntryState>>;
private readonly renderPhaseChildren;
private nextIndex;
constructor(id?: string, instanceId?: string);
static useNew(id?: string): TunnelState;
resetIndex(): void;
useEntryIndex(): number;
setChildren(tunnelId: string | undefined, entryId: string, index: number, children: TunnelChildren): void;
setRenderPhaseChildren(tunnelId: string | undefined, entryId: string, index: number, children: TunnelChildren): void;
private deleteChildrenFromMap;
deleteChildren(tunnelId: string | undefined, entryId: string): void;
private takeRenderPhaseChildren;
getEntries(tunnelId?: string): TunnelEntries | undefined;
}
export {};
//# sourceMappingURL=TunnelState.d.ts.map