@ray-core/runtime
Version:
Ray 是一个全新的基于 React 的小程序开发框架
56 lines (55 loc) • 1.61 kB
TypeScript
import { FiberRoot } from 'react-reconciler';
import VNode, { RawNode } from './VNode';
interface SpliceUpdate {
path: string[];
children?: RawNode[];
id: number;
raw: RawNode | null;
type: 'splice';
node: VNode;
}
interface SetUpdate {
path: string[];
name: string;
value: any;
type: 'set';
node: VNode;
}
export default class AppContainer {
context: any;
root: VNode;
rootKey: string;
updateQueue: Array<SpliceUpdate | SetUpdate>;
_rootContainer?: FiberRoot;
cbIds: string[];
stopUpdate?: boolean;
_slot: {
idsCache: number[];
node: VNode | undefined;
};
_pageSlot: VNode | null;
constructor(context: any, rootKey?: string);
requestUpdate(update: SpliceUpdate | SetUpdate): void;
normalizeUpdatePath(paths: string[]): string;
getPageSlotParentInfo(): {
slotIndexAtParentChildren: number;
parentPath: string[];
parentChildren: number[];
} | undefined;
applyUpdate(): void;
handlePayload(): {
[key: string]: any;
} | undefined;
clearUpdate(): void;
createCallback(id: string, propKey: string, node: VNode, fn: (...params: any) => any): void;
removeCallback(name: string): void;
appendChild(child: VNode): void;
removeChild(child: VNode): void;
insertBefore(child: VNode, beforeChild: VNode): void;
replaceSlot(parent: VNode, child: VNode, index?: number): VNode[] | undefined;
removeSlot(parent: VNode, child: VNode): void;
copyVNode(node: VNode, option?: {
parent?: VNode;
}): any;
}
export {};