@webspatial/core-sdk 0.1.6 → 0.1.7
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +712 -2
- package/dist/index.js +1500 -1
- package/dist/index.js.map +1 -0
- package/package.json +6 -5
- package/tsup.config.ts +23 -0
- package/dist/core/Spatial.d.ts +0 -27
- package/dist/core/Spatial.d.ts.map +0 -1
- package/dist/core/Spatial.js +0 -41
- package/dist/core/SpatialEntity.d.ts +0 -92
- package/dist/core/SpatialEntity.d.ts.map +0 -1
- package/dist/core/SpatialEntity.js +0 -122
- package/dist/core/SpatialHelper.d.ts +0 -39
- package/dist/core/SpatialHelper.d.ts.map +0 -1
- package/dist/core/SpatialHelper.js +0 -195
- package/dist/core/SpatialObject.d.ts +0 -20
- package/dist/core/SpatialObject.d.ts.map +0 -1
- package/dist/core/SpatialObject.js +0 -23
- package/dist/core/SpatialSession.d.ts +0 -164
- package/dist/core/SpatialSession.d.ts.map +0 -1
- package/dist/core/SpatialSession.js +0 -318
- package/dist/core/SpatialTransform.d.ts +0 -23
- package/dist/core/SpatialTransform.d.ts.map +0 -1
- package/dist/core/SpatialTransform.js +0 -31
- package/dist/core/SpatialWindowContainer.d.ts +0 -31
- package/dist/core/SpatialWindowContainer.d.ts.map +0 -1
- package/dist/core/SpatialWindowContainer.js +0 -48
- package/dist/core/component/EventSpatialComponent.d.ts +0 -22
- package/dist/core/component/EventSpatialComponent.d.ts.map +0 -1
- package/dist/core/component/EventSpatialComponent.js +0 -23
- package/dist/core/component/SpatialComponent.d.ts +0 -11
- package/dist/core/component/SpatialComponent.d.ts.map +0 -1
- package/dist/core/component/SpatialComponent.js +0 -23
- package/dist/core/component/SpatialInputComponent.d.ts +0 -22
- package/dist/core/component/SpatialInputComponent.d.ts.map +0 -1
- package/dist/core/component/SpatialInputComponent.js +0 -14
- package/dist/core/component/SpatialModel3DComponent.d.ts +0 -91
- package/dist/core/component/SpatialModel3DComponent.d.ts.map +0 -1
- package/dist/core/component/SpatialModel3DComponent.js +0 -185
- package/dist/core/component/SpatialModelComponent.d.ts +0 -22
- package/dist/core/component/SpatialModelComponent.d.ts.map +0 -1
- package/dist/core/component/SpatialModelComponent.js +0 -34
- package/dist/core/component/SpatialViewComponent.d.ts +0 -22
- package/dist/core/component/SpatialViewComponent.d.ts.map +0 -1
- package/dist/core/component/SpatialViewComponent.js +0 -30
- package/dist/core/component/SpatialWindowComponent.d.ts +0 -86
- package/dist/core/component/SpatialWindowComponent.d.ts.map +0 -1
- package/dist/core/component/SpatialWindowComponent.js +0 -114
- package/dist/core/component/index.d.ts +0 -7
- package/dist/core/component/index.d.ts.map +0 -1
- package/dist/core/component/index.js +0 -6
- package/dist/core/index.d.ts +0 -11
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -9
- package/dist/core/private/WebSpatial.d.ts +0 -46
- package/dist/core/private/WebSpatial.d.ts.map +0 -1
- package/dist/core/private/WebSpatial.js +0 -282
- package/dist/core/private/remote-command/RemoteCommand.d.ts +0 -8
- package/dist/core/private/remote-command/RemoteCommand.d.ts.map +0 -1
- package/dist/core/private/remote-command/RemoteCommand.js +0 -11
- package/dist/core/private/remote-command/index.d.ts +0 -2
- package/dist/core/private/remote-command/index.d.ts.map +0 -1
- package/dist/core/private/remote-command/index.js +0 -1
- package/dist/core/resource/SpatialMeshResource.d.ts +0 -7
- package/dist/core/resource/SpatialMeshResource.d.ts.map +0 -1
- package/dist/core/resource/SpatialMeshResource.js +0 -6
- package/dist/core/resource/SpatialPhysicallyBasedMaterialResource.d.ts +0 -37
- package/dist/core/resource/SpatialPhysicallyBasedMaterialResource.d.ts.map +0 -1
- package/dist/core/resource/SpatialPhysicallyBasedMaterialResource.js +0 -37
- package/dist/core/resource/index.d.ts +0 -3
- package/dist/core/resource/index.d.ts.map +0 -1
- package/dist/core/resource/index.js +0 -2
- package/dist/core/types.d.ts +0 -23
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -1
- package/dist/index.d.ts.map +0 -1
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { SpatialViewComponent } from './component';
|
|
2
|
-
import { Spatial } from './Spatial';
|
|
3
|
-
import { Vec3 } from './SpatialTransform';
|
|
4
|
-
/**
|
|
5
|
-
* Helper class used to quickly add spatial content to standard web pages
|
|
6
|
-
* [Experimental] expect APIs to potentially change in future versions
|
|
7
|
-
*/
|
|
8
|
-
export class SpatialHelper {
|
|
9
|
-
session;
|
|
10
|
-
static _instance = null;
|
|
11
|
-
static get instance() {
|
|
12
|
-
if (this._instance) {
|
|
13
|
-
return this._instance;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
let spatial = new Spatial();
|
|
17
|
-
if (spatial.isSupported()) {
|
|
18
|
-
let session = spatial.requestSession();
|
|
19
|
-
if (session) {
|
|
20
|
-
this._instance = new SpatialHelper(session);
|
|
21
|
-
return this._instance;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
constructor(session) {
|
|
28
|
-
this.session = session;
|
|
29
|
-
}
|
|
30
|
-
shape = {
|
|
31
|
-
createShapeEntity: async (shape = 'box') => {
|
|
32
|
-
var box = await this.session.createMeshResource({ shape: shape });
|
|
33
|
-
var mat = await this.session.createPhysicallyBasedMaterialResource();
|
|
34
|
-
await mat.update();
|
|
35
|
-
var customModel = await this.session.createModelComponent();
|
|
36
|
-
customModel.setMaterials([mat]);
|
|
37
|
-
customModel.setMesh(box);
|
|
38
|
-
var boxEntity = await this.session.createEntity();
|
|
39
|
-
await boxEntity.setComponent(customModel);
|
|
40
|
-
boxEntity.transform.position.z = 0;
|
|
41
|
-
boxEntity.transform.scale = new Vec3(0.5, 0.5, 0.5);
|
|
42
|
-
await boxEntity.updateTransform();
|
|
43
|
-
return boxEntity;
|
|
44
|
-
},
|
|
45
|
-
createModelEntity: async (url) => {
|
|
46
|
-
var customModel = await this.session.createModelComponent({ url });
|
|
47
|
-
var boxEntity = await this.session.createEntity();
|
|
48
|
-
await boxEntity.setComponent(customModel);
|
|
49
|
-
await boxEntity.updateTransform();
|
|
50
|
-
return boxEntity;
|
|
51
|
-
},
|
|
52
|
-
wrapInBoundingBoxEntity: async (entityToWrap) => {
|
|
53
|
-
var bb = await entityToWrap.getBoundingBox();
|
|
54
|
-
// Scale to fit
|
|
55
|
-
var targetSize = 1.0;
|
|
56
|
-
var scale = targetSize / Math.max(bb.extents.x, bb.extents.y, bb.extents.z);
|
|
57
|
-
entityToWrap.transform.scale.x = scale;
|
|
58
|
-
entityToWrap.transform.scale.y = scale;
|
|
59
|
-
entityToWrap.transform.scale.z = scale;
|
|
60
|
-
// Center within view
|
|
61
|
-
entityToWrap.transform.position.x = -bb.center.x * scale;
|
|
62
|
-
entityToWrap.transform.position.y = -bb.center.y * scale;
|
|
63
|
-
entityToWrap.transform.position.z = -bb.center.z * scale;
|
|
64
|
-
await entityToWrap.updateTransform();
|
|
65
|
-
// wrap in boudning box
|
|
66
|
-
var boudningEntity = await SpatialHelper.instance?.session.createEntity();
|
|
67
|
-
await entityToWrap.setParent(boudningEntity);
|
|
68
|
-
return boudningEntity;
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
navigation = {
|
|
72
|
-
openPanel: async (url, options) => {
|
|
73
|
-
if (options?.resolution) {
|
|
74
|
-
await this.session
|
|
75
|
-
.getCurrentWindowContainer()
|
|
76
|
-
._setOpenSettings({ resolution: options.resolution });
|
|
77
|
-
}
|
|
78
|
-
// Create window container
|
|
79
|
-
var wg = await this.session.createWindowContainer({
|
|
80
|
-
style: 'Plain',
|
|
81
|
-
windowComponent: null,
|
|
82
|
-
windowContainer: null,
|
|
83
|
-
});
|
|
84
|
-
// Create a root entity displaying a webpage
|
|
85
|
-
var ent = await this.session.createEntity({
|
|
86
|
-
windowComponent: null,
|
|
87
|
-
windowContainer: wg,
|
|
88
|
-
});
|
|
89
|
-
var i = await this.session.createWindowComponent({
|
|
90
|
-
windowComponent: null,
|
|
91
|
-
windowContainer: wg,
|
|
92
|
-
});
|
|
93
|
-
await i.loadURL(url);
|
|
94
|
-
await ent.setCoordinateSpace('Root');
|
|
95
|
-
await ent.setComponent(i);
|
|
96
|
-
// Add enitity the window container
|
|
97
|
-
await wg.setRootEntity(ent);
|
|
98
|
-
// Restore default size
|
|
99
|
-
await this.session
|
|
100
|
-
.getCurrentWindowContainer()
|
|
101
|
-
._setOpenSettings({ resolution: { width: 900, height: 700 } });
|
|
102
|
-
},
|
|
103
|
-
openVolume: async (url, options) => {
|
|
104
|
-
var wg = await this.session.createWindowContainer({
|
|
105
|
-
style: 'Volumetric',
|
|
106
|
-
windowComponent: null,
|
|
107
|
-
windowContainer: null,
|
|
108
|
-
});
|
|
109
|
-
// Create a root view entity within the window container
|
|
110
|
-
var rootEnt = await this.session.createEntity({
|
|
111
|
-
windowComponent: null,
|
|
112
|
-
windowContainer: wg,
|
|
113
|
-
});
|
|
114
|
-
await rootEnt.setComponent(await this.session.createViewComponent({
|
|
115
|
-
windowComponent: null,
|
|
116
|
-
windowContainer: wg,
|
|
117
|
-
}));
|
|
118
|
-
await rootEnt.setCoordinateSpace('Root');
|
|
119
|
-
await wg.setRootEntity(rootEnt);
|
|
120
|
-
// Add webpage to the window container
|
|
121
|
-
var ent = await this.session.createEntity({
|
|
122
|
-
windowComponent: null,
|
|
123
|
-
windowContainer: wg,
|
|
124
|
-
});
|
|
125
|
-
var i = await this.session.createWindowComponent({
|
|
126
|
-
windowComponent: null,
|
|
127
|
-
windowContainer: wg,
|
|
128
|
-
});
|
|
129
|
-
await i.loadURL(url);
|
|
130
|
-
if (options?.resolution) {
|
|
131
|
-
await i.setResolution(options.resolution.width, options.resolution.height);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
await i.setResolution(1000, 1000);
|
|
135
|
-
}
|
|
136
|
-
ent.transform.position.z = -0.49;
|
|
137
|
-
await ent.updateTransform();
|
|
138
|
-
await ent.setCoordinateSpace('App');
|
|
139
|
-
await ent.setComponent(i);
|
|
140
|
-
await ent.setParent(rootEnt);
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
dom = {
|
|
144
|
-
attachSpatialView: async (divOnPage) => {
|
|
145
|
-
// Create SpatialView
|
|
146
|
-
var viewEnt = await this.session.createEntity();
|
|
147
|
-
await viewEnt.setCoordinateSpace('Dom'); // Set coordinate space so its transform is relative to the webpage's pixels
|
|
148
|
-
await viewEnt.setComponent(await this.session.createViewComponent());
|
|
149
|
-
// Add to the root window component to display
|
|
150
|
-
var wc = await this.session.getCurrentWindowComponent();
|
|
151
|
-
var ent = await wc.getEntity();
|
|
152
|
-
await viewEnt.setParent(ent);
|
|
153
|
-
// Keep spatialView positioned where the div is
|
|
154
|
-
var update = () => {
|
|
155
|
-
var rect = divOnPage.getBoundingClientRect();
|
|
156
|
-
viewEnt.transform.position.x = rect.x + rect.width / 2;
|
|
157
|
-
viewEnt.transform.position.y = rect.y + rect.height / 2 + window.scrollY;
|
|
158
|
-
viewEnt.updateTransform();
|
|
159
|
-
viewEnt
|
|
160
|
-
.getComponent(SpatialViewComponent)
|
|
161
|
-
.setResolution(rect.width, rect.height);
|
|
162
|
-
};
|
|
163
|
-
var mo = new MutationObserver(update);
|
|
164
|
-
mo.observe(divOnPage, { attributes: true });
|
|
165
|
-
var ro = new ResizeObserver(update);
|
|
166
|
-
ro.observe(divOnPage);
|
|
167
|
-
const addRemoveObserver = new MutationObserver(mutations => {
|
|
168
|
-
mutations.forEach(mutation => {
|
|
169
|
-
mutation.removedNodes.forEach(node => {
|
|
170
|
-
if (node instanceof HTMLElement) {
|
|
171
|
-
update();
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
mutation.addedNodes.forEach(node => {
|
|
175
|
-
if (node instanceof HTMLElement) {
|
|
176
|
-
update();
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
addRemoveObserver.observe(document.body, {
|
|
182
|
-
childList: true,
|
|
183
|
-
subtree: true,
|
|
184
|
-
});
|
|
185
|
-
update();
|
|
186
|
-
return {
|
|
187
|
-
entity: viewEnt,
|
|
188
|
-
};
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
setBackgroundStyle = async (style, backgroundColor = '#00000000') => {
|
|
192
|
-
document.documentElement.style.backgroundColor = backgroundColor;
|
|
193
|
-
await this.session.getCurrentWindowComponent().setStyle(style);
|
|
194
|
-
};
|
|
195
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { WebSpatialResource } from './private/WebSpatial';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
* Parent class of spatial objects, should not be used directly
|
|
5
|
-
*/
|
|
6
|
-
export declare class SpatialObject {
|
|
7
|
-
/** @hidden */
|
|
8
|
-
_resource: WebSpatialResource;
|
|
9
|
-
/** @hidden */
|
|
10
|
-
constructor(
|
|
11
|
-
/** @hidden */
|
|
12
|
-
_resource: WebSpatialResource);
|
|
13
|
-
/**
|
|
14
|
-
* Marks resource to be released (it should no longer be used)
|
|
15
|
-
*/
|
|
16
|
-
destroy(): Promise<void>;
|
|
17
|
-
name: string;
|
|
18
|
-
protected onDestroy(): Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=SpatialObject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialObject.d.ts","sourceRoot":"","sources":["../../src/core/SpatialObject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;;GAGG;AACH,qBAAa,aAAa;IAGtB,cAAc;IACP,SAAS,EAAE,kBAAkB;IAHtC,cAAc;;IAEZ,cAAc;IACP,SAAS,EAAE,kBAAkB;IAGtC;;OAEG;IACG,OAAO;IAKN,IAAI,EAAE,MAAM,CAAK;cAER,SAAS;CAC1B"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { WebSpatial } from './private/WebSpatial';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
* Parent class of spatial objects, should not be used directly
|
|
5
|
-
*/
|
|
6
|
-
export class SpatialObject {
|
|
7
|
-
_resource;
|
|
8
|
-
/** @hidden */
|
|
9
|
-
constructor(
|
|
10
|
-
/** @hidden */
|
|
11
|
-
_resource) {
|
|
12
|
-
this._resource = _resource;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Marks resource to be released (it should no longer be used)
|
|
16
|
-
*/
|
|
17
|
-
async destroy() {
|
|
18
|
-
await WebSpatial.destroyResource(this._resource);
|
|
19
|
-
await this.onDestroy();
|
|
20
|
-
}
|
|
21
|
-
name = '';
|
|
22
|
-
async onDestroy() { }
|
|
23
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { SpatialEntity } from './SpatialEntity';
|
|
2
|
-
import { SpatialWindowContainer } from './SpatialWindowContainer';
|
|
3
|
-
import { LoadingMethodKind, sceneDataShape, WindowStyle } from './types';
|
|
4
|
-
import { SpatialMeshResource, SpatialPhysicallyBasedMaterialResource } from './resource';
|
|
5
|
-
import { SpatialModelComponent, SpatialInputComponent, SpatialWindowComponent, SpatialViewComponent, SpatialModel3DComponent } from './component';
|
|
6
|
-
type CreateResourceOptions = {
|
|
7
|
-
windowContainer?: SpatialWindowContainer | null;
|
|
8
|
-
windowComponent?: SpatialWindowComponent | null;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Animation callback with timestamp
|
|
12
|
-
*/
|
|
13
|
-
type animCallback = (time: DOMHighResTimeStamp) => Promise<any>;
|
|
14
|
-
/**
|
|
15
|
-
* Session use to establish a connection to the spatial renderer of the system. All resources must be created by the session
|
|
16
|
-
*/
|
|
17
|
-
export declare class SpatialSession {
|
|
18
|
-
/** @hidden */
|
|
19
|
-
_engineUpdateListeners: animCallback[];
|
|
20
|
-
/** @hidden */
|
|
21
|
-
_frameLoopStarted: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Add event listener callback to be called each frame
|
|
24
|
-
* @param callback callback to be called each update
|
|
25
|
-
*/
|
|
26
|
-
addOnEngineUpdateEventListener(callback: animCallback): void;
|
|
27
|
-
/**
|
|
28
|
-
* Creates a Entity
|
|
29
|
-
* @returns Entity
|
|
30
|
-
*/
|
|
31
|
-
createEntity(options?: CreateResourceOptions): Promise<SpatialEntity>;
|
|
32
|
-
/**
|
|
33
|
-
* Creates a WindowComponent
|
|
34
|
-
* [TODO] should creation of components be moved to entity? and these made private?
|
|
35
|
-
* @returns WindowComponent
|
|
36
|
-
*/
|
|
37
|
-
createWindowComponent(options?: CreateResourceOptions): Promise<SpatialWindowComponent>;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a ViewComponent used to display 3D content within the entity
|
|
40
|
-
* @returns SpatialViewComponent
|
|
41
|
-
*/
|
|
42
|
-
createViewComponent(options?: CreateResourceOptions): Promise<SpatialViewComponent>;
|
|
43
|
-
/**
|
|
44
|
-
* Creates a ModelComponent used to display geometry + material of a 3D model
|
|
45
|
-
* @returns ModelComponent
|
|
46
|
-
*/
|
|
47
|
-
createModelComponent(options?: {
|
|
48
|
-
url: string;
|
|
49
|
-
} & CreateResourceOptions): Promise<SpatialModelComponent>;
|
|
50
|
-
/**
|
|
51
|
-
* Creates a Model3DComponent
|
|
52
|
-
* @returns Model3DComponent
|
|
53
|
-
*/
|
|
54
|
-
createModel3DComponent(options?: {
|
|
55
|
-
url: string;
|
|
56
|
-
} & CreateResourceOptions): Promise<SpatialModel3DComponent>;
|
|
57
|
-
/**
|
|
58
|
-
* Creates a InputComponent
|
|
59
|
-
* [Experimental] Creates a InputComponent used to handle click and drag events of the entity containing a model
|
|
60
|
-
* @returns InputComponent
|
|
61
|
-
*/
|
|
62
|
-
createInputComponent(options?: CreateResourceOptions): Promise<SpatialInputComponent>;
|
|
63
|
-
/**
|
|
64
|
-
* Creates a MeshResource containing geometry data
|
|
65
|
-
* @returns MeshResource
|
|
66
|
-
*/
|
|
67
|
-
createMeshResource(options?: {
|
|
68
|
-
shape?: string;
|
|
69
|
-
} & CreateResourceOptions): Promise<SpatialMeshResource>;
|
|
70
|
-
/**
|
|
71
|
-
* Creates a PhysicallyBasedMaterial containing PBR material data
|
|
72
|
-
* @returns PhysicallyBasedMaterial
|
|
73
|
-
*/
|
|
74
|
-
createPhysicallyBasedMaterialResource(options?: {} & CreateResourceOptions): Promise<SpatialPhysicallyBasedMaterialResource>;
|
|
75
|
-
/**
|
|
76
|
-
* Creates a WindowContainer
|
|
77
|
-
* @returns SpatialWindowContainer
|
|
78
|
-
* */
|
|
79
|
-
createWindowContainer(options?: {
|
|
80
|
-
style: WindowStyle;
|
|
81
|
-
} & CreateResourceOptions): Promise<SpatialWindowContainer>;
|
|
82
|
-
/**
|
|
83
|
-
* Creates a Scene to display content within an anchored area managed by the OS
|
|
84
|
-
* @hidden
|
|
85
|
-
* @param {WindowStyle} [style='Plain'] - The style of the Scene container to be created with. Defaults to 'Plain'.
|
|
86
|
-
* @param {Object} [cfg={}] - Configuration object for the Scene.
|
|
87
|
-
* @returns Boolean
|
|
88
|
-
*/
|
|
89
|
-
_createScene(style: WindowStyle | undefined, cfg: {
|
|
90
|
-
sceneData: sceneDataShape;
|
|
91
|
-
}): Promise<boolean>;
|
|
92
|
-
/**
|
|
93
|
-
* Retrieves the window for this page
|
|
94
|
-
* @returns the window component corresponding to the js running on this page
|
|
95
|
-
* [TODO] discuss implications of this not being async
|
|
96
|
-
*/
|
|
97
|
-
getCurrentWindowComponent(): SpatialWindowComponent;
|
|
98
|
-
/**
|
|
99
|
-
* Retrieves the parent window for this page or null if this is the root page
|
|
100
|
-
* @returns the window component or null
|
|
101
|
-
*/
|
|
102
|
-
getParentWindowComponent(): Promise<SpatialWindowComponent | null>;
|
|
103
|
-
/**
|
|
104
|
-
* Logs a message to the native apps console
|
|
105
|
-
* @param msg mesage to log
|
|
106
|
-
*/
|
|
107
|
-
log(...msg: any[]): Promise<void>;
|
|
108
|
-
/**
|
|
109
|
-
* @hidden
|
|
110
|
-
* Debugging only, used to ping the native renderer
|
|
111
|
-
*/
|
|
112
|
-
_ping(msg: string): Promise<unknown>;
|
|
113
|
-
/**
|
|
114
|
-
* @hidden
|
|
115
|
-
* Debugging to get internal state from native code
|
|
116
|
-
* @returns data as a js object
|
|
117
|
-
*/
|
|
118
|
-
_getStats(): Promise<{
|
|
119
|
-
objects: any;
|
|
120
|
-
refObjects: any;
|
|
121
|
-
}>;
|
|
122
|
-
/**
|
|
123
|
-
* @hidden
|
|
124
|
-
*/
|
|
125
|
-
_inspect(spatialObjectId?: string): Promise<any>;
|
|
126
|
-
/**
|
|
127
|
-
* @hidden
|
|
128
|
-
*/
|
|
129
|
-
_inspectRootWindowContainer(): Promise<any>;
|
|
130
|
-
/** Opens the immersive space */
|
|
131
|
-
openImmersiveSpace(): Promise<void>;
|
|
132
|
-
/** Closes the immersive space */
|
|
133
|
-
dismissImmersiveSpace(): Promise<void>;
|
|
134
|
-
private static _immersiveWindowContainer;
|
|
135
|
-
/**
|
|
136
|
-
* Retreives the window container corresponding to the Immersive space
|
|
137
|
-
* @returns the immersive window container
|
|
138
|
-
*/
|
|
139
|
-
getImmersiveWindowContainer(): Promise<SpatialWindowContainer>;
|
|
140
|
-
private static _currentWindowContainer;
|
|
141
|
-
/**
|
|
142
|
-
* Gets the current window container for the window
|
|
143
|
-
* [TODO] discuss what happens if it doesnt yet have a window container
|
|
144
|
-
* @returns the current window container for the window
|
|
145
|
-
*/
|
|
146
|
-
getCurrentWindowContainer(): SpatialWindowContainer;
|
|
147
|
-
/**
|
|
148
|
-
* Start a transaction that queues up commands to submit them all at once to reduce ipc overhead
|
|
149
|
-
* @param fn function to be run, within this function, promises will not resolve
|
|
150
|
-
* @returns promise for the entire transaction completion
|
|
151
|
-
*/
|
|
152
|
-
transaction(fn: Function): Promise<unknown>;
|
|
153
|
-
/**
|
|
154
|
-
* Creates a window context object that is compatable with SpatialWindowComponent's setFromWindow API
|
|
155
|
-
* @returns window context
|
|
156
|
-
*/
|
|
157
|
-
createWindowContext(): Promise<Window | null>;
|
|
158
|
-
/** @hidden */
|
|
159
|
-
_getEntity(id: string): Promise<SpatialEntity>;
|
|
160
|
-
/** @hidden */
|
|
161
|
-
setLoading(method: LoadingMethodKind, style?: string): Promise<unknown>;
|
|
162
|
-
}
|
|
163
|
-
export {};
|
|
164
|
-
//# sourceMappingURL=SpatialSession.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialSession.d.ts","sourceRoot":"","sources":["../../src/core/SpatialSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAMjE,OAAO,EACL,iBAAiB,EACjB,cAAc,EAEd,WAAW,EACZ,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EACvC,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAGpB,KAAK,qBAAqB,GAAG;IAC3B,eAAe,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAA;IAC/C,eAAe,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,KAAK,YAAY,GAAG,CAAC,IAAI,EAAE,mBAAmB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;AA2B/D;;GAEG;AACH,qBAAa,cAAc;IACzB,cAAc;IACd,sBAAsB,iBAAwB;IAC9C,cAAc;IACd,iBAAiB,UAAQ;IAEzB;;;OAGG;IACH,8BAA8B,CAAC,QAAQ,EAAE,YAAY;IAerD;;;OAGG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,qBAAqB;IAUlD;;;;OAIG;IACG,qBAAqB,CAAC,OAAO,CAAC,EAAE,qBAAqB;IAU3D;;;OAGG;IACG,mBAAmB,CAAC,OAAO,CAAC,EAAE,qBAAqB;IAUzD;;;OAGG;IACG,oBAAoB,CACxB,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,qBAAqB;IAgBnD;;;OAGG;IACG,sBAAsB,CAC1B,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,qBAAqB;IAgBnD;;;;OAIG;IACG,oBAAoB,CAAC,OAAO,CAAC,EAAE,qBAAqB;IAU1D;;;OAGG;IACG,kBAAkB,CACtB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,qBAAqB;IAYtD;;;OAGG;IACG,qCAAqC,CACzC,OAAO,CAAC,EAAE,EAAE,GAAG,qBAAqB;IAWtC;;;SAGK;IACC,qBAAqB,CACzB,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,WAAW,CAAA;KACnB,GAAG,qBAAqB;IAa3B;;;;;;OAMG;IACG,YAAY,CAChB,KAAK,EAAE,WAAW,YAAU,EAC5B,GAAG,EAAE;QACH,SAAS,EAAE,cAAc,CAAA;KAC1B;IAKH;;;;OAIG;IACH,yBAAyB;IAIzB;;;OAGG;IACG,wBAAwB;IAgB9B;;;OAGG;IACG,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE;IAUvB;;;OAGG;IACG,KAAK,CAAC,GAAG,EAAE,MAAM;IAIvB;;;;OAIG;IACG,SAAS;iBACsC,GAAG;oBAAc,GAAG;;IAGzE;;OAEG;IACG,QAAQ,CAAC,eAAe,GAAE,MAA2C;IAI3E;;OAEG;IACG,2BAA2B;IAIjC,gCAAgC;IAC1B,kBAAkB;IAIxB,iCAAiC;IAC3B,qBAAqB;IAI3B,OAAO,CAAC,MAAM,CAAC,yBAAyB,CACD;IACvC;;;OAGG;IACG,2BAA2B;IAYjC,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAwC;IAE9E;;;;OAIG;IACH,yBAAyB;IAWzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,EAAE,QAAQ;IAMxB;;;OAGG;IACG,mBAAmB;IAgCzB,cAAc;IACR,UAAU,CAAC,EAAE,EAAE,MAAM;IAoB3B,cAAc;IACR,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,MAAM;CAG3D"}
|