@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
20 lines (19 loc) • 1.12 kB
TypeScript
import { ReadonlyKeysOf } from "type-fest";
import { EntityNode } from "./entity-config";
import { PlayCanvasHostContext } from "../hostConfig";
export type SystemKeys = Exclude<ReadonlyKeysOf<pc.ComponentSystemRegistry>, 'script'>;
type ComponentProps = Record<string, unknown>;
export type ComponentNode = {
type: 'component';
componentType: SystemKeys;
componentData: Record<string, any>;
componentProps: Record<string, any>;
attachedTo: pc.Entity | null;
};
export declare function createInstance(type: SystemKeys, props: ComponentProps, app: pc.Application): ComponentNode;
export declare function commitUpdate(instance: ComponentNode, _type: string, _oldProps: ComponentProps, newProps: ComponentProps): void;
export declare function appendChild(parent: EntityNode, child: ComponentNode): void;
export declare function appendInitialChild(parent: EntityNode, child: ComponentNode): void;
export declare function removeChild(parent: EntityNode, child: ComponentNode): void;
export declare function appendChildToContainer(_container: PlayCanvasHostContext, _child: ComponentNode): void;
export {};