@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
30 lines (29 loc) • 1.35 kB
TypeScript
import { PlayCanvasHostContext } from "../hostConfig";
export type Vec3Arr = [number, number, number];
export type EntityProps = {
name?: string;
position?: Vec3Arr;
rotation?: [number, number, number?];
scale?: Vec3Arr;
};
export type EntityNode = {
type: 'entity';
entity: pc.Entity;
};
declare function createInstance(_type: string, props: EntityProps, _app: pc.Application): EntityNode;
declare function commitUpdate(instance: EntityNode, _type: string, oldProps: EntityProps, newProps: EntityProps): void;
declare function appendChild(parent: EntityNode, child: EntityNode): void;
declare function appendChildToContainer(container: PlayCanvasHostContext, child: EntityNode): void;
declare function appendInitialChild(parent: EntityNode, child: EntityNode): void;
declare function removeChild(parent: EntityNode, child: EntityNode): void;
declare function removeChildFromContainer(container: PlayCanvasHostContext, child: EntityNode): void;
declare const _default: {
createInstance: typeof createInstance;
commitUpdate: typeof commitUpdate;
appendChild: typeof appendChild;
appendInitialChild: typeof appendInitialChild;
removeChild: typeof removeChild;
removeChildFromContainer: typeof removeChildFromContainer;
appendChildToContainer: typeof appendChildToContainer;
};
export default _default;