UNPKG

@wonderlandengine/editor-api

Version:

Wonderland Engine's Editor API for plugins - very experimental.

49 lines (48 loc) 2.02 kB
import { ProjectData } from './data.js'; import { Workspace } from './workspace.js'; interface NativeToolsAPI { newSubProject(name: string, filename?: string, projectKind?: string): boolean; switchProject(id: number): void; packageProject(destDir?: string): number; loadFile(filename: string): number; loadScene(filename: string, parent?: string): number; awaitJob(jobId: number, cb: (success: boolean) => void): void; openBrowser(url: string): void; computeMeshBounds(meshId: string, out: Float32Array): void; saveProject(): void; getComponentTypes(): { name: string; properties: Record<string, string>; }[]; } interface NativeUiAPI { freeImage(id: number): void; loadImage(data: ArrayBuffer): [number, number]; text(text: string): void; label(text: string): void; button(label: string): boolean; image(id: number, width: number, height: number): boolean; inputText(label: string, value: string): string | null; inputTextPassword(label: string, value: string): string | null; inputTextMultiline(widgetId: string, value: string): string | null; checkbox(label: string, value: boolean): boolean | null; colorEdit4(label: string, value: Float32Array): boolean; dummy(width: number, height: number): void; sameLine(offset?: number): void; separator(): void; spinner(): void; beginGroup(): void; endGroup(): void; inputFloat(label: string, value: number): number | null; inputFloat3(label: string, value: Float32Array): boolean; inputInt(label: string, value: number): number | null; inputInt3(label: string, value: Int32Array): boolean; } declare global { function _wl_internalBinding(moduleName: 'tools'): NativeToolsAPI; function _wl_internalBinding(moduleName: 'ui'): NativeUiAPI; /** @todo Remove/deprecate */ function _wl_internalBinding(moduleName: 'data'): ProjectData; function _wl_internalBinding(moduleName: 'workspace'): Workspace; } export {};