UNPKG

@lifeart/gxt

Version:

<img align="right" width="95" height="95" alt="Philosopher’s stone, logo of PostCSS" src="./public/logo.png">

73 lines (71 loc) • 2.66 kB
import { Object3D } from 'three'; import { TresObject, TresScene } from './types'; import { TresContext } from './context'; /** * Namespace for Tres-specific userData properties */ export interface TresUserData { onClick?: (event: any) => void; onPointerMove?: (event: any) => void; onPointerEnter?: (event: any) => void; onPointerLeave?: (event: any) => void; materialViaProp?: boolean; geometryViaProp?: boolean; name?: string; blockPointerEvents?: boolean; } export declare class TresPlaceholder extends Object3D { readonly isTresPlaceholder = true; debugName?: string; constructor(debugName?: string); } export declare class TresFragment extends TresPlaceholder { readonly isTresFragment = true; constructor(); } export declare class TresComment extends TresPlaceholder { readonly isTresComment = true; constructor(text?: string); } export declare class TresText extends TresPlaceholder { readonly isTresText = true; textContent: string; constructor(text?: string); } type Props = [any[], [string, any][], any[]]; export declare class TresBrowserDOMApi { private _context; private _scene; toString(): string; /** * Set the TresContext for this API instance * This allows access to scene, camera, renderer from within components */ setContext(context: TresContext): void; /** * Get the TresContext */ getContext(): TresContext | null; /** * Get the scene for this API instance */ get scene(): TresScene | null; /** * Set the scene directly (used when scene is first parent in insert) */ private setScene; isNode(node: unknown): node is TresObject | TresPlaceholder; parent(node: TresObject | TresPlaceholder | null): TresObject | null; clearChildren(node: TresObject | TresPlaceholder | null): void; addEventListener(_node: TresObject | TresPlaceholder, _eventName: string, _fn: EventListener): undefined; element(tag: string, _isSVG?: boolean, _anchor?: boolean, _props?: Props): TresObject | TresPlaceholder | null; insert(parent: TresScene | TresObject | TresFragment | null, child: TresObject | TresPlaceholder | null, _anchor?: any): void; destroy(node: TresObject | TresPlaceholder | null): void; attr(node: TresObject | TresPlaceholder | null, prop: string, nextValue: any): void; prop(node: TresObject | TresPlaceholder | null, prop: string, nextValue: any): void; comment(text?: string): TresComment; text(text: string | number): TresText; textContent(node: TresText | null, text: string): void; fragment(): TresFragment; } export {};