@wonderlandengine/editor-api 1.2.4 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data.d.ts +76 -38
- package/dist/data.js +77 -57
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/native.d.ts +6 -0
- package/dist/ui.d.ts +50 -0
- package/dist/ui.js +50 -0
- package/dist/workspace.d.ts +10 -0
- package/dist/workspace.js +2 -0
- package/package.json +1 -1
package/dist/data.d.ts
CHANGED
@@ -43,8 +43,14 @@ export declare class ProjectSettings extends Access {
|
|
43
43
|
type: ProjectType;
|
44
44
|
customIndexHtml: boolean;
|
45
45
|
extraFilesFolder: string;
|
46
|
-
|
46
|
+
prefab: boolean;
|
47
47
|
version: number[];
|
48
|
+
maxTexturesBinSize: number;
|
49
|
+
}
|
50
|
+
/** Workspace settings */
|
51
|
+
export interface WorkspaceSettings extends Access {
|
52
|
+
main: string | null;
|
53
|
+
files: string[];
|
48
54
|
}
|
49
55
|
/** Sky settings */
|
50
56
|
export declare class SkySettings extends Access {
|
@@ -110,6 +116,7 @@ export declare class RenderingSettings extends Access {
|
|
110
116
|
usePreZ: boolean;
|
111
117
|
useMultiDraw: boolean;
|
112
118
|
useFrustumCulling: boolean;
|
119
|
+
useTextureStreaming: boolean;
|
113
120
|
sky: SkySettings;
|
114
121
|
bloom: BloomSettings;
|
115
122
|
hdr: HdrSettings;
|
@@ -128,33 +135,17 @@ export declare class EditorSettings extends Access {
|
|
128
135
|
serverCOEP: string;
|
129
136
|
camera: CameraSettings;
|
130
137
|
ids: string;
|
138
|
+
pluginsPaths: string[];
|
131
139
|
package: {
|
132
140
|
packageUnusedMeshes: boolean;
|
141
|
+
packageUnusedAnimations: boolean;
|
133
142
|
supercompressionLevel: number;
|
134
143
|
};
|
144
|
+
importPhysicalAsPhongMaterials: boolean;
|
135
145
|
}
|
136
146
|
/** Plugins settings */
|
137
147
|
export declare class PluginsSettings extends Access {
|
138
148
|
}
|
139
|
-
/** WebXR feature flags */
|
140
|
-
export interface WebXRFeatureFlags {
|
141
|
-
'local': boolean;
|
142
|
-
'local-floor': boolean;
|
143
|
-
'bounded-floor': boolean;
|
144
|
-
'unbounded': boolean;
|
145
|
-
'hand-tracking': boolean;
|
146
|
-
'hit-test': boolean;
|
147
|
-
'plane-detection': boolean;
|
148
|
-
'light-estimation': boolean;
|
149
|
-
'anchors': boolean;
|
150
|
-
'occlusion': boolean;
|
151
|
-
'marker-tracking': boolean;
|
152
|
-
}
|
153
|
-
/** WebXR settings */
|
154
|
-
export declare class WebXRSettings extends Access {
|
155
|
-
optionalFeatures: WebXRFeatureFlags;
|
156
|
-
requiredFeatures: WebXRFeatureFlags;
|
157
|
-
}
|
158
149
|
/** PWA settings */
|
159
150
|
export declare class PWASettings extends Access {
|
160
151
|
enable: boolean;
|
@@ -173,7 +164,6 @@ export declare class RuntimeSettings extends Access {
|
|
173
164
|
googleAnalyticsSecondary: string;
|
174
165
|
enableRuntimeGltf: boolean;
|
175
166
|
viewObject: ObjectReference;
|
176
|
-
webxr: WebXRSettings;
|
177
167
|
xrButtonColor: string;
|
178
168
|
pwa: PWASettings;
|
179
169
|
}
|
@@ -187,18 +177,60 @@ export declare enum BundlingType {
|
|
187
177
|
export declare class ScriptingSettings extends Access {
|
188
178
|
sourcePaths: never[];
|
189
179
|
libraryPaths: never[];
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
180
|
+
materialDefinitions: string | null;
|
181
|
+
components: {
|
182
|
+
bundling: string;
|
183
|
+
npmScript: string;
|
184
|
+
esbuildFlags: string;
|
185
|
+
entryPoint: string;
|
186
|
+
output: string | null;
|
187
|
+
};
|
188
|
+
application: {
|
189
|
+
bundling: string;
|
190
|
+
npmScript: string;
|
191
|
+
esbuildFlags: string;
|
192
|
+
entryPoint: string;
|
193
|
+
output: string | null;
|
194
|
+
};
|
195
195
|
}
|
196
196
|
/** VR settings */
|
197
197
|
export declare class VRSettings extends Access {
|
198
198
|
enable: boolean;
|
199
|
-
|
200
|
-
|
199
|
+
}
|
200
|
+
/** AR settings */
|
201
|
+
export declare class ARSettings extends Access {
|
202
|
+
enable: boolean;
|
203
|
+
}
|
204
|
+
/** WebXR feature flags */
|
205
|
+
export interface WebXRFeatureFlags {
|
206
|
+
'local': boolean;
|
207
|
+
'local-floor': boolean;
|
208
|
+
'bounded-floor': boolean;
|
209
|
+
'unbounded': boolean;
|
210
|
+
'hand-tracking': boolean;
|
211
|
+
'hit-test': boolean;
|
212
|
+
'plane-detection': boolean;
|
213
|
+
'light-estimation': boolean;
|
214
|
+
'anchors': boolean;
|
215
|
+
'occlusion': boolean;
|
216
|
+
'marker-tracking': boolean;
|
217
|
+
}
|
218
|
+
/** WebXR settings */
|
219
|
+
export declare class WebXRSettings extends Access {
|
201
220
|
framebufferScaleFactor: number;
|
221
|
+
offerSession: boolean;
|
222
|
+
optionalFeatures: WebXRFeatureFlags;
|
223
|
+
optionalFeaturesExtra: string;
|
224
|
+
requiredFeatures: WebXRFeatureFlags;
|
225
|
+
requiredFeaturesExtra: string;
|
226
|
+
}
|
227
|
+
/** XR settings */
|
228
|
+
export declare class XRSettings extends Access {
|
229
|
+
vr: VRSettings;
|
230
|
+
ar: ARSettings;
|
231
|
+
webxr: WebXRSettings;
|
232
|
+
leftEyeObject: ObjectReference;
|
233
|
+
rightEyeObject: ObjectReference;
|
202
234
|
}
|
203
235
|
/** Physics settings */
|
204
236
|
export declare class PhysXSettings extends Access {
|
@@ -220,10 +252,6 @@ export declare class PhysXSettings extends Access {
|
|
220
252
|
lengthToleranceScale: number;
|
221
253
|
speedToleranceScale: number;
|
222
254
|
}
|
223
|
-
/** AR settings */
|
224
|
-
export declare class ARSettings extends Access {
|
225
|
-
enable: boolean;
|
226
|
-
}
|
227
255
|
/** Localization settings */
|
228
256
|
export declare class LocalizationSettings extends Access {
|
229
257
|
enableZipCompression: boolean;
|
@@ -232,15 +260,15 @@ export declare class LocalizationSettings extends Access {
|
|
232
260
|
defaultLanguage: string;
|
233
261
|
}
|
234
262
|
/** Settings for the currently open project */
|
235
|
-
export
|
263
|
+
export interface Settings extends Access {
|
236
264
|
project: ProjectSettings;
|
265
|
+
workspace: WorkspaceSettings;
|
237
266
|
rendering: RenderingSettings;
|
238
267
|
editor: EditorSettings;
|
239
268
|
runtime: RuntimeSettings;
|
240
269
|
scripting: ScriptingSettings;
|
241
270
|
plugins: PluginsSettings;
|
242
|
-
|
243
|
-
ar: ARSettings;
|
271
|
+
xr: XRSettings;
|
244
272
|
physx: PhysXSettings;
|
245
273
|
localization: LocalizationSettings;
|
246
274
|
}
|
@@ -257,6 +285,7 @@ export declare class Link extends Access {
|
|
257
285
|
export declare class Resource extends Access {
|
258
286
|
name: string;
|
259
287
|
link: Link | null;
|
288
|
+
packageAlways: boolean;
|
260
289
|
}
|
261
290
|
/** Image resource */
|
262
291
|
export declare class ImageResource extends Resource {
|
@@ -264,8 +293,6 @@ export declare class ImageResource extends Resource {
|
|
264
293
|
maxSize: number[];
|
265
294
|
compression: ImageCompressionType;
|
266
295
|
stream: boolean;
|
267
|
-
isProbe: boolean;
|
268
|
-
isSpecularProbe: boolean;
|
269
296
|
hdr: boolean;
|
270
297
|
}
|
271
298
|
/** Texture resource */
|
@@ -325,9 +352,11 @@ export declare class PhysicalMaterial extends Access {
|
|
325
352
|
albedoColor: number[];
|
326
353
|
emissiveTexture: TextureReference;
|
327
354
|
emissiveColor: number[];
|
355
|
+
fogColor: number[];
|
328
356
|
albedoTexture: TextureReference;
|
329
357
|
metallicFactor: number;
|
330
358
|
roughnessFactor: number;
|
359
|
+
occlusionRoughnessMetallicTexture: TextureReference;
|
331
360
|
roughnessMetallicTexture: TextureReference;
|
332
361
|
specularProbeTexture: TextureReference;
|
333
362
|
irradianceProbeTexture: TextureReference;
|
@@ -379,6 +408,11 @@ export declare class SkyMaterial extends Access {
|
|
379
408
|
colorStop3: number[];
|
380
409
|
texture: TextureReference;
|
381
410
|
}
|
411
|
+
/** Material properties for the default Sky pipeline */
|
412
|
+
export declare class AtmosphericSkyMaterial extends Access {
|
413
|
+
direction: number[];
|
414
|
+
exposure: number;
|
415
|
+
}
|
382
416
|
/** Material properties for the default Background pipeline */
|
383
417
|
export declare class BackgroundMaterial extends Access {
|
384
418
|
colorStop0: number[];
|
@@ -399,6 +433,7 @@ export declare class MaterialResource extends Resource {
|
|
399
433
|
DistanceFieldVector?: DistanceFieldVectorMaterial;
|
400
434
|
Text?: TextMaterial;
|
401
435
|
Sky?: SkyMaterial;
|
436
|
+
AtmosphericSky?: AtmosphericSkyMaterial;
|
402
437
|
Background?: BackgroundMaterial;
|
403
438
|
}
|
404
439
|
/** Animation blending type */
|
@@ -539,7 +574,8 @@ export declare class MeshComponent extends Access {
|
|
539
574
|
/** Text effect type enum */
|
540
575
|
export declare enum TextEffectType {
|
541
576
|
None = "none",
|
542
|
-
Outline = "outline"
|
577
|
+
Outline = "outline",
|
578
|
+
Shadow = "shadow"
|
543
579
|
}
|
544
580
|
/** Text wrap mode */
|
545
581
|
export declare enum TextWrapMode {
|
@@ -552,9 +588,11 @@ export declare enum TextWrapMode {
|
|
552
588
|
export declare class TextComponent extends Access {
|
553
589
|
alignment: string;
|
554
590
|
verticalAlignment: string;
|
591
|
+
justified: boolean;
|
555
592
|
characterSpacing: number;
|
556
593
|
lineSpacing: number;
|
557
594
|
effect: TextEffectType;
|
595
|
+
effectOffset: number[];
|
558
596
|
text: string;
|
559
597
|
material: MaterialReference;
|
560
598
|
wrapMode: TextWrapMode;
|
package/dist/data.js
CHANGED
@@ -55,8 +55,9 @@ export class ProjectSettings extends Access {
|
|
55
55
|
type = ProjectType.Website;
|
56
56
|
customIndexHtml = false;
|
57
57
|
extraFilesFolder = 'static';
|
58
|
-
|
58
|
+
prefab = false;
|
59
59
|
version = [1, 2, 0];
|
60
|
+
maxTexturesBinSize = 0;
|
60
61
|
}
|
61
62
|
/** Sky settings */
|
62
63
|
export class SkySettings extends Access {
|
@@ -124,6 +125,7 @@ export class RenderingSettings extends Access {
|
|
124
125
|
usePreZ = false;
|
125
126
|
useMultiDraw = false;
|
126
127
|
useFrustumCulling = true;
|
128
|
+
useTextureStreaming = true;
|
127
129
|
sky = new SkySettings();
|
128
130
|
bloom = new BloomSettings();
|
129
131
|
hdr = new HdrSettings();
|
@@ -142,43 +144,17 @@ export class EditorSettings extends Access {
|
|
142
144
|
serverCOEP = 'require-corp';
|
143
145
|
camera = new CameraSettings();
|
144
146
|
ids = 'incremental-number';
|
147
|
+
pluginsPaths = [];
|
145
148
|
package = {
|
146
149
|
packageUnusedMeshes: false,
|
150
|
+
packageUnusedAnimations: false,
|
147
151
|
supercompressionLevel: 8,
|
148
152
|
};
|
153
|
+
importPhysicalAsPhongMaterials = true;
|
149
154
|
}
|
150
155
|
/** Plugins settings */
|
151
156
|
export class PluginsSettings extends Access {
|
152
157
|
}
|
153
|
-
/** WebXR settings */
|
154
|
-
export class WebXRSettings extends Access {
|
155
|
-
optionalFeatures = {
|
156
|
-
'local': true,
|
157
|
-
'local-floor': false,
|
158
|
-
'bounded-floor': false,
|
159
|
-
'unbounded': false,
|
160
|
-
'hand-tracking': true,
|
161
|
-
'hit-test': true,
|
162
|
-
'plane-detection': false,
|
163
|
-
'light-estimation': false,
|
164
|
-
'anchors': false,
|
165
|
-
'occlusion': false,
|
166
|
-
'marker-tracking': false,
|
167
|
-
};
|
168
|
-
requiredFeatures = {
|
169
|
-
'local': true,
|
170
|
-
'local-floor': false,
|
171
|
-
'bounded-floor': false,
|
172
|
-
'unbounded': false,
|
173
|
-
'hand-tracking': false,
|
174
|
-
'hit-test': false,
|
175
|
-
'plane-detection': false,
|
176
|
-
'light-estimation': false,
|
177
|
-
'anchors': false,
|
178
|
-
'occlusion': false,
|
179
|
-
'marker-tracking': false,
|
180
|
-
};
|
181
|
-
}
|
182
158
|
/** PWA settings */
|
183
159
|
export class PWASettings extends Access {
|
184
160
|
enable = false;
|
@@ -197,7 +173,6 @@ export class RuntimeSettings extends Access {
|
|
197
173
|
googleAnalyticsSecondary = '';
|
198
174
|
enableRuntimeGltf = false;
|
199
175
|
viewObject = null;
|
200
|
-
webxr = new WebXRSettings();
|
201
176
|
xrButtonColor = 'white';
|
202
177
|
pwa = new PWASettings();
|
203
178
|
}
|
@@ -212,18 +187,70 @@ export var BundlingType;
|
|
212
187
|
export class ScriptingSettings extends Access {
|
213
188
|
sourcePaths = [];
|
214
189
|
libraryPaths = [];
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
190
|
+
materialDefinitions = null;
|
191
|
+
components = {
|
192
|
+
bundling: 'esbuild',
|
193
|
+
npmScript: 'build',
|
194
|
+
esbuildFlags: '--format=esm --target=es2022 --external:@wonderlandengine/api',
|
195
|
+
entryPoint: 'js/index.js',
|
196
|
+
output: null,
|
197
|
+
};
|
198
|
+
application = {
|
199
|
+
bundling: 'esbuild',
|
200
|
+
npmScript: 'build',
|
201
|
+
esbuildFlags: '--format=esm --target=es2022 --external:@wonderlandengine/api',
|
202
|
+
entryPoint: 'app.js',
|
203
|
+
output: null,
|
204
|
+
};
|
220
205
|
}
|
221
206
|
/** VR settings */
|
222
207
|
export class VRSettings extends Access {
|
223
208
|
enable = true;
|
224
|
-
|
225
|
-
|
209
|
+
}
|
210
|
+
/** AR settings */
|
211
|
+
export class ARSettings extends Access {
|
212
|
+
enable = false;
|
213
|
+
}
|
214
|
+
/** WebXR settings */
|
215
|
+
export class WebXRSettings extends Access {
|
226
216
|
framebufferScaleFactor = 1.0;
|
217
|
+
offerSession = true;
|
218
|
+
optionalFeatures = {
|
219
|
+
'local': true,
|
220
|
+
'local-floor': false,
|
221
|
+
'bounded-floor': false,
|
222
|
+
'unbounded': false,
|
223
|
+
'hand-tracking': true,
|
224
|
+
'hit-test': true,
|
225
|
+
'plane-detection': false,
|
226
|
+
'light-estimation': false,
|
227
|
+
'anchors': false,
|
228
|
+
'occlusion': false,
|
229
|
+
'marker-tracking': false,
|
230
|
+
};
|
231
|
+
optionalFeaturesExtra = '';
|
232
|
+
requiredFeatures = {
|
233
|
+
'local': true,
|
234
|
+
'local-floor': false,
|
235
|
+
'bounded-floor': false,
|
236
|
+
'unbounded': false,
|
237
|
+
'hand-tracking': false,
|
238
|
+
'hit-test': false,
|
239
|
+
'plane-detection': false,
|
240
|
+
'light-estimation': false,
|
241
|
+
'anchors': false,
|
242
|
+
'occlusion': false,
|
243
|
+
'marker-tracking': false,
|
244
|
+
};
|
245
|
+
requiredFeaturesExtra = '';
|
246
|
+
}
|
247
|
+
/** XR settings */
|
248
|
+
export class XRSettings extends Access {
|
249
|
+
vr = new VRSettings();
|
250
|
+
ar = new ARSettings();
|
251
|
+
webxr = new WebXRSettings();
|
252
|
+
leftEyeObject = null;
|
253
|
+
rightEyeObject = null;
|
227
254
|
}
|
228
255
|
/** Physics settings */
|
229
256
|
export class PhysXSettings extends Access {
|
@@ -245,10 +272,6 @@ export class PhysXSettings extends Access {
|
|
245
272
|
lengthToleranceScale = 1.0;
|
246
273
|
speedToleranceScale = 10.0;
|
247
274
|
}
|
248
|
-
/** AR settings */
|
249
|
-
export class ARSettings extends Access {
|
250
|
-
enable = false;
|
251
|
-
}
|
252
275
|
/** Localization settings */
|
253
276
|
export class LocalizationSettings extends Access {
|
254
277
|
enableZipCompression = false;
|
@@ -256,19 +279,6 @@ export class LocalizationSettings extends Access {
|
|
256
279
|
languagesFolder = 'languages';
|
257
280
|
defaultLanguage = 'en';
|
258
281
|
}
|
259
|
-
/** Settings for the currently open project */
|
260
|
-
export class Settings extends Access {
|
261
|
-
project = new ProjectSettings();
|
262
|
-
rendering = new RenderingSettings();
|
263
|
-
editor = new EditorSettings();
|
264
|
-
runtime = new RuntimeSettings();
|
265
|
-
scripting = new ScriptingSettings();
|
266
|
-
plugins = new PluginsSettings();
|
267
|
-
vr = new VRSettings();
|
268
|
-
ar = new ARSettings();
|
269
|
-
physx = new PhysXSettings();
|
270
|
-
localization = new LocalizationSettings();
|
271
|
-
}
|
272
282
|
/** Image compression type */
|
273
283
|
export var ImageCompressionType;
|
274
284
|
(function (ImageCompressionType) {
|
@@ -283,6 +293,7 @@ export class Link extends Access {
|
|
283
293
|
export class Resource extends Access {
|
284
294
|
name = '';
|
285
295
|
link = null;
|
296
|
+
packageAlways = false;
|
286
297
|
}
|
287
298
|
/** Image resource */
|
288
299
|
export class ImageResource extends Resource {
|
@@ -290,8 +301,6 @@ export class ImageResource extends Resource {
|
|
290
301
|
maxSize = [8192, 8192];
|
291
302
|
compression = ImageCompressionType.ETC1s;
|
292
303
|
stream = true;
|
293
|
-
isProbe = false;
|
294
|
-
isSpecularProbe = false;
|
295
304
|
hdr = false;
|
296
305
|
}
|
297
306
|
/** Texture resource */
|
@@ -353,9 +362,11 @@ export class PhysicalMaterial extends Access {
|
|
353
362
|
albedoColor = [1.0, 1.0, 1.0, 1.0];
|
354
363
|
emissiveTexture = null;
|
355
364
|
emissiveColor = [0.0, 0.0, 0.0, 1.0];
|
365
|
+
fogColor = [1.0, 1.0, 1.0, 0.0];
|
356
366
|
albedoTexture = null;
|
357
367
|
metallicFactor = 1.0;
|
358
368
|
roughnessFactor = 1.0;
|
369
|
+
occlusionRoughnessMetallicTexture = null;
|
359
370
|
roughnessMetallicTexture = null;
|
360
371
|
specularProbeTexture = null;
|
361
372
|
irradianceProbeTexture = null;
|
@@ -407,6 +418,11 @@ export class SkyMaterial extends Access {
|
|
407
418
|
colorStop3 = [0.55, 0.95, 1, 1];
|
408
419
|
texture = null;
|
409
420
|
}
|
421
|
+
/** Material properties for the default Sky pipeline */
|
422
|
+
export class AtmosphericSkyMaterial extends Access {
|
423
|
+
direction = [0.0, 1.0, 1.0];
|
424
|
+
exposure = 0.5;
|
425
|
+
}
|
410
426
|
/** Material properties for the default Background pipeline */
|
411
427
|
export class BackgroundMaterial extends Access {
|
412
428
|
colorStop0 = [1, 1, 1, 1];
|
@@ -427,6 +443,7 @@ export class MaterialResource extends Resource {
|
|
427
443
|
DistanceFieldVector;
|
428
444
|
Text;
|
429
445
|
Sky;
|
446
|
+
AtmosphericSky;
|
430
447
|
Background;
|
431
448
|
}
|
432
449
|
/** Animation blending type */
|
@@ -571,6 +588,7 @@ export var TextEffectType;
|
|
571
588
|
(function (TextEffectType) {
|
572
589
|
TextEffectType["None"] = "none";
|
573
590
|
TextEffectType["Outline"] = "outline";
|
591
|
+
TextEffectType["Shadow"] = "shadow";
|
574
592
|
})(TextEffectType || (TextEffectType = {}));
|
575
593
|
/** Text wrap mode */
|
576
594
|
export var TextWrapMode;
|
@@ -584,9 +602,11 @@ export var TextWrapMode;
|
|
584
602
|
export class TextComponent extends Access {
|
585
603
|
alignment = 'center';
|
586
604
|
verticalAlignment = 'middle';
|
605
|
+
justified = false;
|
587
606
|
characterSpacing = 0.0;
|
588
607
|
lineSpacing = 1.2;
|
589
608
|
effect = TextEffectType.None;
|
609
|
+
effectOffset = [0.0, 0.0];
|
590
610
|
text = 'Wonderland Engine';
|
591
611
|
material = 'DefaultFontMaterial';
|
592
612
|
wrapMode = TextWrapMode.None;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/native.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { EditorData } from './data.js';
|
2
|
+
import { Workspace } from './workspace.js';
|
2
3
|
interface NativeToolsAPI {
|
3
4
|
packageProject(destDir?: string): number;
|
4
5
|
loadFile(filename: string): number;
|
@@ -22,6 +23,10 @@ interface NativeUiAPI {
|
|
22
23
|
spinner(): void;
|
23
24
|
beginGroup(): void;
|
24
25
|
endGroup(): void;
|
26
|
+
inputFloat(label: string, value: number): number | null;
|
27
|
+
inputFloat3(label: string, value: Float32Array): boolean;
|
28
|
+
inputInt(label: string, value: number): number | null;
|
29
|
+
inputInt3(label: string, value: Int32Array): boolean;
|
25
30
|
}
|
26
31
|
/** Project paths */
|
27
32
|
export interface Project {
|
@@ -68,5 +73,6 @@ declare global {
|
|
68
73
|
function _wl_internalBinding(moduleName: 'ui'): NativeUiAPI;
|
69
74
|
function _wl_internalBinding(moduleName: 'data'): EditorData;
|
70
75
|
function _wl_internalBinding(moduleName: 'project'): Project;
|
76
|
+
function _wl_internalBinding(moduleName: 'workspace'): Workspace;
|
71
77
|
}
|
72
78
|
export {};
|
package/dist/ui.d.ts
CHANGED
@@ -100,3 +100,53 @@ export declare const beginGroup: () => void;
|
|
100
100
|
export declare const endGroup: () => void;
|
101
101
|
/** Spinner to indicate loading. */
|
102
102
|
export declare const spinner: () => void;
|
103
|
+
/**
|
104
|
+
* Draggable float input
|
105
|
+
* @param label Label for the input.
|
106
|
+
* @param value Current value.
|
107
|
+
* @returns The new value when changed by the user this frame, otherwise `null`.
|
108
|
+
*
|
109
|
+
* @example
|
110
|
+
* let myFloat = 0;
|
111
|
+
* const n = ui.inputFloat("change this:", myFloat);
|
112
|
+
* if(n !== null) myFloat = n;
|
113
|
+
*/
|
114
|
+
export declare const inputFloat: (label: string, value: number) => number | null;
|
115
|
+
/**
|
116
|
+
* Draggable float3 input
|
117
|
+
* @param label Label for the input.
|
118
|
+
* @param value Current value.
|
119
|
+
* @returns `true` if changed by the user this frame, `false` otherwise.
|
120
|
+
*
|
121
|
+
* @example
|
122
|
+
* const myFloat3 = new Float32Array(3);
|
123
|
+
* if(ui.inputFloat3("change this:", myFloat3)) {
|
124
|
+
* console.log("changed");
|
125
|
+
* }
|
126
|
+
*/
|
127
|
+
export declare const inputFloat3: (label: string, value: Float32Array) => boolean;
|
128
|
+
/**
|
129
|
+
* Draggable int input
|
130
|
+
* @param label Label for the input.
|
131
|
+
* @param value Current value.
|
132
|
+
* @returns The new value when changed by the user this frame, otherwise `null`.
|
133
|
+
*
|
134
|
+
* @example
|
135
|
+
* let myInt = 0;
|
136
|
+
* const n = ui.inputInt("change this:", myInt);
|
137
|
+
* if(n !== null) myInt = n;
|
138
|
+
*/
|
139
|
+
export declare const inputInt: (label: string, value: number) => number | null;
|
140
|
+
/**
|
141
|
+
* Draggable int3 input
|
142
|
+
* @param label Label for the input.
|
143
|
+
* @param value Current value.
|
144
|
+
* @returns `true` if changed by the user this frame, `false` otherwise.
|
145
|
+
*
|
146
|
+
* @example
|
147
|
+
* const myInt3 = new Int32Array(3);
|
148
|
+
* if(ui.inputInt3("change this:", myInt3)) {
|
149
|
+
* console.log("changed");
|
150
|
+
* }
|
151
|
+
*/
|
152
|
+
export declare const inputInt3: (label: string, value: Int32Array) => boolean;
|
package/dist/ui.js
CHANGED
@@ -124,3 +124,53 @@ export const beginGroup = ui.beginGroup.bind(ui);
|
|
124
124
|
export const endGroup = ui.endGroup.bind(ui);
|
125
125
|
/** Spinner to indicate loading. */
|
126
126
|
export const spinner = ui.spinner.bind(ui);
|
127
|
+
/**
|
128
|
+
* Draggable float input
|
129
|
+
* @param label Label for the input.
|
130
|
+
* @param value Current value.
|
131
|
+
* @returns The new value when changed by the user this frame, otherwise `null`.
|
132
|
+
*
|
133
|
+
* @example
|
134
|
+
* let myFloat = 0;
|
135
|
+
* const n = ui.inputFloat("change this:", myFloat);
|
136
|
+
* if(n !== null) myFloat = n;
|
137
|
+
*/
|
138
|
+
export const inputFloat = ui.inputFloat.bind(ui);
|
139
|
+
/**
|
140
|
+
* Draggable float3 input
|
141
|
+
* @param label Label for the input.
|
142
|
+
* @param value Current value.
|
143
|
+
* @returns `true` if changed by the user this frame, `false` otherwise.
|
144
|
+
*
|
145
|
+
* @example
|
146
|
+
* const myFloat3 = new Float32Array(3);
|
147
|
+
* if(ui.inputFloat3("change this:", myFloat3)) {
|
148
|
+
* console.log("changed");
|
149
|
+
* }
|
150
|
+
*/
|
151
|
+
export const inputFloat3 = ui.inputFloat3.bind(ui);
|
152
|
+
/**
|
153
|
+
* Draggable int input
|
154
|
+
* @param label Label for the input.
|
155
|
+
* @param value Current value.
|
156
|
+
* @returns The new value when changed by the user this frame, otherwise `null`.
|
157
|
+
*
|
158
|
+
* @example
|
159
|
+
* let myInt = 0;
|
160
|
+
* const n = ui.inputInt("change this:", myInt);
|
161
|
+
* if(n !== null) myInt = n;
|
162
|
+
*/
|
163
|
+
export const inputInt = ui.inputInt.bind(ui);
|
164
|
+
/**
|
165
|
+
* Draggable int3 input
|
166
|
+
* @param label Label for the input.
|
167
|
+
* @param value Current value.
|
168
|
+
* @returns `true` if changed by the user this frame, `false` otherwise.
|
169
|
+
*
|
170
|
+
* @example
|
171
|
+
* const myInt3 = new Int32Array(3);
|
172
|
+
* if(ui.inputInt3("change this:", myInt3)) {
|
173
|
+
* console.log("changed");
|
174
|
+
* }
|
175
|
+
*/
|
176
|
+
export const inputInt3 = ui.inputInt3.bind(ui);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/** @todo: Give access to each projects using: getProject(filename). */
|
2
|
+
/**
|
3
|
+
* Workspace access.
|
4
|
+
*
|
5
|
+
* Allows to read the current workspace setup.
|
6
|
+
*/
|
7
|
+
export interface Workspace {
|
8
|
+
mainFilename: string;
|
9
|
+
}
|
10
|
+
export declare const workspace: Workspace;
|