UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.

73 lines (72 loc) 2.91 kB
import { Color, Euler, Object3D } from "three"; import { Behaviour } from "../engine-components/Component.js"; import { EventList } from "../engine-components/EventList.js"; import { SerializationContext, TypeSerializer } from "./engine_serialization_core.js"; import { RenderTexture } from "./engine_texture.js"; import { RGBAColor } from "./js-extensions/index.js"; declare class ColorSerializer extends TypeSerializer { constructor(); onDeserialize(data: any): Color | RGBAColor | void; onSerialize(data: any): any | void; } export declare const colorSerializer: ColorSerializer; declare class EulerSerializer extends TypeSerializer { constructor(); onDeserialize(data: any, _context: SerializationContext): Euler | undefined; onSerialize(data: any, _context: SerializationContext): { x: any; y: any; z: any; order: any; }; } export declare const euler: EulerSerializer; declare type ObjectData = { node?: number; guid?: string; }; declare class ObjectSerializer extends TypeSerializer { constructor(); onSerialize(data: any, context: SerializationContext): { node: number; } | undefined; onDeserialize(data: ObjectData | string | null, context: SerializationContext): Object3D<import("three").Object3DEventMap> | Behaviour | null | undefined; } export declare const objectSerializer: ObjectSerializer; declare class ComponentSerializer extends TypeSerializer { constructor(); onSerialize(data: any, _context: SerializationContext): { guid: any; } | undefined; onDeserialize(data: any, context: SerializationContext): any; findObjectForGuid(guid: string, root: Object3D): any; } export declare const componentSerializer: ComponentSerializer; declare class EventListData { type: string; calls: Array<EventListCall>; } declare type EventListCall = { method: string; target: string; argument?: any; arguments?: Array<any>; enabled?: boolean; }; declare class EventListSerializer extends TypeSerializer { constructor(); onSerialize(_data: EventList<any>, _context: SerializationContext): EventListData | undefined; onDeserialize(data: EventListData, context: SerializationContext): EventList<any> | undefined | null; } export declare const eventListSerializer: EventListSerializer; export declare class RenderTextureSerializer extends TypeSerializer { constructor(); onSerialize(_data: any, _context: SerializationContext): void; onDeserialize(data: any, context: SerializationContext): RenderTexture | undefined; } export declare class UriSerializer extends TypeSerializer { constructor(); onSerialize(_data: string, _context: SerializationContext): null; onDeserialize(data: string, _context: SerializationContext): string | undefined; } export {};