@playcanvas/web-components 0.1.8 → 0.1.10

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.
Files changed (58) hide show
  1. package/README.md +2 -2
  2. package/dist/app.d.ts +21 -1
  3. package/dist/asset.d.ts +3 -1
  4. package/dist/async-element.d.ts +2 -1
  5. package/dist/components/camera-component.d.ts +28 -4
  6. package/dist/components/collision-component.d.ts +4 -4
  7. package/dist/components/component.d.ts +3 -1
  8. package/dist/components/element-component.d.ts +4 -1
  9. package/dist/components/gsplat-component.d.ts +4 -1
  10. package/dist/components/light-component.d.ts +50 -4
  11. package/dist/components/listener-component.d.ts +4 -1
  12. package/dist/components/render-component.d.ts +4 -1
  13. package/dist/components/rigidbody-component.d.ts +4 -4
  14. package/dist/components/screen-component.d.ts +4 -1
  15. package/dist/components/script-component.d.ts +4 -1
  16. package/dist/components/script.d.ts +3 -1
  17. package/dist/components/sound-component.d.ts +5 -2
  18. package/dist/components/sound-slot.d.ts +3 -1
  19. package/dist/entity.d.ts +14 -3
  20. package/dist/fog.d.ts +28 -0
  21. package/dist/material.d.ts +3 -1
  22. package/dist/model.d.ts +3 -1
  23. package/dist/module.d.ts +6 -0
  24. package/dist/pwc.cjs +569 -96
  25. package/dist/pwc.cjs.map +1 -1
  26. package/dist/pwc.js +569 -96
  27. package/dist/pwc.js.map +1 -1
  28. package/dist/pwc.min.js +1 -1
  29. package/dist/pwc.min.js.map +1 -1
  30. package/dist/pwc.mjs +570 -97
  31. package/dist/pwc.mjs.map +1 -1
  32. package/dist/scene.d.ts +3 -1
  33. package/dist/sky.d.ts +3 -1
  34. package/package.json +10 -9
  35. package/src/app.ts +208 -2
  36. package/src/asset.ts +3 -1
  37. package/src/async-element.ts +2 -1
  38. package/src/components/camera-component.ts +69 -7
  39. package/src/components/collision-component.ts +4 -4
  40. package/src/components/component.ts +3 -1
  41. package/src/components/element-component.ts +4 -2
  42. package/src/components/gsplat-component.ts +4 -1
  43. package/src/components/light-component.ts +107 -7
  44. package/src/components/listener-component.ts +4 -1
  45. package/src/components/render-component.ts +4 -1
  46. package/src/components/rigidbody-component.ts +4 -4
  47. package/src/components/screen-component.ts +4 -1
  48. package/src/components/script-component.ts +26 -14
  49. package/src/components/script.ts +3 -1
  50. package/src/components/sound-component.ts +4 -1
  51. package/src/components/sound-slot.ts +3 -1
  52. package/src/entity.ts +149 -32
  53. package/src/fog.ts +121 -0
  54. package/src/material.ts +5 -3
  55. package/src/model.ts +3 -1
  56. package/src/module.ts +6 -0
  57. package/src/scene.ts +13 -11
  58. package/src/sky.ts +3 -1
package/README.md CHANGED
@@ -43,13 +43,13 @@ Or you can include it directly in your HTML file from a CDN.
43
43
  ES Modules:
44
44
 
45
45
  ```html
46
- <script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.5/dist/pwc.mjs"></script>
46
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.9/dist/pwc.mjs"></script>
47
47
  ```
48
48
 
49
49
  UMD:
50
50
 
51
51
  ```html
52
- <script src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.5"></script>
52
+ <script src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.9"></script>
53
53
  ```
54
54
 
55
55
  ## Tag Reference 📖
package/dist/app.d.ts CHANGED
@@ -13,17 +13,31 @@ declare class AppElement extends AsyncElement {
13
13
  private _depth;
14
14
  private _stencil;
15
15
  private _highResolution;
16
+ private _hierarchyReady;
17
+ private _picker;
18
+ private _hasPointerListeners;
19
+ private _hoveredEntity;
20
+ private _pointerHandlers;
16
21
  /**
17
22
  * The PlayCanvas application instance.
18
23
  */
19
24
  app: Application | null;
20
25
  /**
21
- * Creates a new AppElement.
26
+ * Creates a new AppElement instance.
27
+ *
28
+ * @ignore
22
29
  */
23
30
  constructor();
24
31
  connectedCallback(): Promise<void>;
25
32
  disconnectedCallback(): void;
26
33
  _onWindowResize(): void;
34
+ _pickerCreate(): void;
35
+ _pickerDestroy(): void;
36
+ _onPointerMove(event: PointerEvent): void;
37
+ _onPointerDown(event: PointerEvent): void;
38
+ _onPointerUp(event: PointerEvent): void;
39
+ _onPointerListenerAdded(type: string): void;
40
+ _onPointerListenerRemoved(type: string): void;
27
41
  /**
28
42
  * Sets the alpha flag.
29
43
  * @param value - The alpha flag.
@@ -54,6 +68,12 @@ declare class AppElement extends AsyncElement {
54
68
  * @returns The depth flag.
55
69
  */
56
70
  get depth(): boolean;
71
+ /**
72
+ * Gets the hierarchy ready flag.
73
+ * @returns The hierarchy ready flag.
74
+ * @ignore
75
+ */
76
+ get hierarchyReady(): boolean;
57
77
  /**
58
78
  * Sets the high resolution flag. When true, the application will render at the device's
59
79
  * physical resolution. When false, the application will render at CSS resolution.
package/dist/asset.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { Asset } from 'playcanvas';
2
2
  /**
3
- * Loads an asset into the PlayCanvas engine.
3
+ * The AssetElement interface provides properties and methods for manipulating
4
+ * `<pc-asset>` elements. The AssetElement interface also inherits the properties and
5
+ * methods of the {@link HTMLElement} interface.
4
6
  */
5
7
  declare class AssetElement extends HTMLElement {
6
8
  private _preload;
@@ -1,11 +1,12 @@
1
1
  import { AppElement } from './app';
2
2
  import { EntityElement } from './entity';
3
3
  /**
4
- * Base class for all PlayCanvas web components that initialize asynchronously.
4
+ * Base class for all PlayCanvas Web Components that initialize asynchronously.
5
5
  */
6
6
  declare class AsyncElement extends HTMLElement {
7
7
  private _readyPromise;
8
8
  private _readyResolve;
9
+ /** @ignore */
9
10
  constructor();
10
11
  get closestApp(): AppElement;
11
12
  get closestEntity(): EntityElement;
@@ -1,7 +1,9 @@
1
1
  import { CameraComponent, Color, Vec4 } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a camera component in the PlayCanvas engine.
4
+ * The CameraComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-camera>` elements. The CameraComponentElement interface also inherits the properties and
6
+ * methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
@@ -15,15 +17,15 @@ declare class CameraComponentElement extends ComponentElement {
15
17
  private _flipFaces;
16
18
  private _fov;
17
19
  private _frustumCulling;
20
+ private _gamma;
18
21
  private _nearClip;
19
22
  private _orthographic;
20
23
  private _orthoHeight;
21
24
  private _priority;
22
25
  private _rect;
23
26
  private _scissorRect;
24
- /**
25
- * Creates a new CameraComponentElement.
26
- */
27
+ private _tonemap;
28
+ /** @ignore */
27
29
  constructor();
28
30
  getInitialComponentData(): {
29
31
  clearColor: Color;
@@ -35,12 +37,14 @@ declare class CameraComponentElement extends ComponentElement {
35
37
  flipFaces: boolean;
36
38
  fov: number;
37
39
  frustumCulling: boolean;
40
+ gammaCorrection: number;
38
41
  nearClip: number;
39
42
  orthographic: boolean;
40
43
  orthoHeight: number;
41
44
  priority: number;
42
45
  rect: Vec4;
43
46
  scissorRect: Vec4;
47
+ toneMapping: number | undefined;
44
48
  };
45
49
  get xrAvailable(): boolean | null | undefined;
46
50
  startXr(type: 'immersive-ar' | 'immersive-vr', space: 'bounded-floor' | 'local' | 'local-floor' | 'unbounded' | 'viewer'): void;
@@ -140,6 +144,16 @@ declare class CameraComponentElement extends ComponentElement {
140
144
  * @returns The frustum culling.
141
145
  */
142
146
  get frustumCulling(): boolean;
147
+ /**
148
+ * Sets the gamma correction of the camera.
149
+ * @param value - The gamma correction.
150
+ */
151
+ set gamma(value: 'none' | 'srgb');
152
+ /**
153
+ * Gets the gamma correction of the camera.
154
+ * @returns The gamma correction.
155
+ */
156
+ get gamma(): 'none' | 'srgb';
143
157
  /**
144
158
  * Sets the near clip distance of the camera.
145
159
  * @param value - The near clip distance.
@@ -200,6 +214,16 @@ declare class CameraComponentElement extends ComponentElement {
200
214
  * @returns The scissor rect.
201
215
  */
202
216
  get scissorRect(): Vec4;
217
+ /**
218
+ * Sets the tone mapping of the camera.
219
+ * @param value - The tone mapping.
220
+ */
221
+ set tonemap(value: 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral');
222
+ /**
223
+ * Gets the tone mapping of the camera.
224
+ * @returns The tone mapping.
225
+ */
226
+ get tonemap(): 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral';
203
227
  static get observedAttributes(): string[];
204
228
  attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
205
229
  }
@@ -1,7 +1,9 @@
1
1
  import { CollisionComponent, Quat, Vec3 } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a collision component in the PlayCanvas engine.
4
+ * The CollisionComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-collision>` elements. The CollisionComponentElement interface also inherits the properties
6
+ * and methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
@@ -14,9 +16,7 @@ declare class CollisionComponentElement extends ComponentElement {
14
16
  private _linearOffset;
15
17
  private _radius;
16
18
  private _type;
17
- /**
18
- * Creates a new CollisionComponentElement.
19
- */
19
+ /** @ignore */
20
20
  constructor();
21
21
  getInitialComponentData(): {
22
22
  axis: number;
@@ -10,8 +10,10 @@ declare class ComponentElement extends AsyncElement {
10
10
  private _enabled;
11
11
  private _component;
12
12
  /**
13
- * Constructor for the ComponentElement.
13
+ * Creates a new ComponentElement instance.
14
+ *
14
15
  * @param componentName - The name of the component.
16
+ * @ignore
15
17
  */
16
18
  constructor(componentName: string);
17
19
  getInitialComponentData(): {};
@@ -1,7 +1,9 @@
1
1
  import { Color, ElementComponent, Vec2, Vec4 } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents an element component in the PlayCanvas engine.
4
+ * The ElementComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-element>` elements. The ElementComponentElement interface also inherits the properties and
6
+ * methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
@@ -17,6 +19,7 @@ declare class ElementComponentElement extends ComponentElement {
17
19
  private _type;
18
20
  private _width;
19
21
  private _wrapLines;
22
+ /** @ignore */
20
23
  constructor();
21
24
  initComponent(): void;
22
25
  getInitialComponentData(): {
@@ -1,12 +1,15 @@
1
1
  import { GSplatComponent } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a gsplat component in the PlayCanvas engine.
4
+ * The GSplatComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-splat>` elements. The GSplatComponentElement interface also inherits the properties and
6
+ * methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
8
10
  declare class GSplatComponentElement extends ComponentElement {
9
11
  private _asset;
12
+ /** @ignore */
10
13
  constructor();
11
14
  getInitialComponentData(): {
12
15
  asset: import("playcanvas").Asset | null | undefined;
@@ -1,7 +1,9 @@
1
1
  import { Color, LightComponent } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a light component in the PlayCanvas engine.
4
+ * The LightComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-light>` elements. The LightComponentElement interface also inherits the properties and
6
+ * methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
@@ -15,11 +17,12 @@ declare class LightComponentElement extends ComponentElement {
15
17
  private _range;
16
18
  private _shadowBias;
17
19
  private _shadowDistance;
20
+ private _shadowIntensity;
18
21
  private _shadowResolution;
22
+ private _shadowType;
19
23
  private _type;
20
- /**
21
- * Creates a new LightComponentElement.
22
- */
24
+ private _vsmBias;
25
+ /** @ignore */
23
26
  constructor();
24
27
  getInitialComponentData(): {
25
28
  castShadows: boolean;
@@ -31,8 +34,11 @@ declare class LightComponentElement extends ComponentElement {
31
34
  range: number;
32
35
  shadowBias: number;
33
36
  shadowDistance: number;
37
+ shadowIntensity: number;
34
38
  shadowResolution: number;
39
+ shadowType: number | undefined;
35
40
  type: string;
41
+ vsmBias: number;
36
42
  };
37
43
  /**
38
44
  * Gets the light component.
@@ -129,6 +135,16 @@ declare class LightComponentElement extends ComponentElement {
129
135
  * @returns The shadow distance.
130
136
  */
131
137
  get shadowDistance(): number;
138
+ /**
139
+ * Sets the shadow intensity of the light.
140
+ * @param value - The shadow intensity.
141
+ */
142
+ set shadowIntensity(value: number);
143
+ /**
144
+ * Gets the shadow intensity of the light.
145
+ * @returns The shadow intensity.
146
+ */
147
+ get shadowIntensity(): number;
132
148
  /**
133
149
  * Sets the shadow resolution of the light.
134
150
  * @param value - The shadow resolution.
@@ -139,6 +155,26 @@ declare class LightComponentElement extends ComponentElement {
139
155
  * @returns The shadow resolution.
140
156
  */
141
157
  get shadowResolution(): number;
158
+ /**
159
+ * Sets the shadow type of the light.
160
+ * @param value - The shadow type. Can be:
161
+ *
162
+ * - `pcf1-16f` - 1-tap percentage-closer filtered shadow map with 16-bit depth.
163
+ * - `pcf1-32f` - 1-tap percentage-closer filtered shadow map with 32-bit depth.
164
+ * - `pcf3-16f` - 3-tap percentage-closer filtered shadow map with 16-bit depth.
165
+ * - `pcf3-32f` - 3-tap percentage-closer filtered shadow map with 32-bit depth.
166
+ * - `pcf5-16f` - 5-tap percentage-closer filtered shadow map with 16-bit depth.
167
+ * - `pcf5-32f` - 5-tap percentage-closer filtered shadow map with 32-bit depth.
168
+ * - `vsm-16f` - Variance shadow map with 16-bit depth.
169
+ * - `vsm-32f` - Variance shadow map with 32-bit depth.
170
+ * - `pcss-32f` - Percentage-closer soft shadow with 32-bit depth.
171
+ */
172
+ set shadowType(value: 'pcf1-16f' | 'pcf1-32f' | 'pcf3-16f' | 'pcf3-32f' | 'pcf5-16f' | 'pcf5-32f' | 'vsm-16f' | 'vsm-32f' | 'pcss-32f');
173
+ /**
174
+ * Gets the shadow type of the light.
175
+ * @returns The shadow type.
176
+ */
177
+ get shadowType(): "pcf1-16f" | "pcf1-32f" | "pcf3-16f" | "pcf3-32f" | "pcf5-16f" | "pcf5-32f" | "vsm-16f" | "vsm-32f" | "pcss-32f";
142
178
  /**
143
179
  * Sets the type of the light.
144
180
  * @param value - The type.
@@ -149,6 +185,16 @@ declare class LightComponentElement extends ComponentElement {
149
185
  * @returns The type.
150
186
  */
151
187
  get type(): string;
188
+ /**
189
+ * Sets the VSM bias of the light.
190
+ * @param value - The VSM bias.
191
+ */
192
+ set vsmBias(value: number);
193
+ /**
194
+ * Gets the VSM bias of the light.
195
+ * @returns The VSM bias.
196
+ */
197
+ get vsmBias(): number;
152
198
  static get observedAttributes(): string[];
153
199
  attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
154
200
  }
@@ -1,11 +1,14 @@
1
1
  import { AudioListenerComponent } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a audio listener component in the PlayCanvas engine.
4
+ * The ListenerComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-listener>` elements. The ListenerComponentElement interface also inherits the properties
6
+ * and methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
8
10
  declare class ListenerComponentElement extends ComponentElement {
11
+ /** @ignore */
9
12
  constructor();
10
13
  /**
11
14
  * Gets the audio listener component.
@@ -1,7 +1,9 @@
1
1
  import { RenderComponent, StandardMaterial } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a render component in the PlayCanvas engine.
4
+ * The RenderComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-render>` elements. The RenderComponentElement interface also inherits the properties and
6
+ * methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
@@ -10,6 +12,7 @@ declare class RenderComponentElement extends ComponentElement {
10
12
  private _material;
11
13
  private _receiveShadows;
12
14
  private _type;
15
+ /** @ignore */
13
16
  constructor();
14
17
  getInitialComponentData(): {
15
18
  type: "box" | "asset" | "capsule" | "cone" | "cylinder" | "plane" | "sphere";
@@ -1,7 +1,9 @@
1
1
  import { RigidBodyComponent, Vec3 } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a rigidbody component in the PlayCanvas engine.
4
+ * The RigidBodyComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-rigidbody>` elements. The RigidBodyComponentElement interface also inherits the properties
6
+ * and methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
@@ -42,9 +44,7 @@ declare class RigidBodyComponentElement extends ComponentElement {
42
44
  * The type of the rigidbody.
43
45
  */
44
46
  private _type;
45
- /**
46
- * Creates a new RigidBodyComponentElement.
47
- */
47
+ /** @ignore */
48
48
  constructor();
49
49
  getInitialComponentData(): {
50
50
  angularDamping: number;
@@ -1,7 +1,9 @@
1
1
  import { ScreenComponent, Vec2 } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a screen component in the PlayCanvas engine.
4
+ * The ScreenComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-screen>` elements. The ScreenComponentElement interface also inherits the properties and
6
+ * methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
@@ -12,6 +14,7 @@ declare class ScreenComponentElement extends ComponentElement {
12
14
  private _priority;
13
15
  private _blend;
14
16
  private _scaleBlend;
17
+ /** @ignore */
15
18
  constructor();
16
19
  getInitialComponentData(): {
17
20
  priority: number;
@@ -17,12 +17,15 @@ declare global {
17
17
  }
18
18
  }
19
19
  /**
20
- * Represents a script component in the PlayCanvas engine.
20
+ * The ScriptComponentElement interface provides properties and methods for manipulating
21
+ * `<pc-scripts>` elements. The ScriptComponentElement interface also inherits the properties and
22
+ * methods of the {@link HTMLElement} interface.
21
23
  *
22
24
  * @category Components
23
25
  */
24
26
  declare class ScriptComponentElement extends ComponentElement {
25
27
  private observer;
28
+ /** @ignore */
26
29
  constructor();
27
30
  initComponent(): void;
28
31
  private applyAttributes;
@@ -1,5 +1,7 @@
1
1
  /**
2
- * Represents a script in the PlayCanvas engine.
2
+ * The ScriptElement interface provides properties and methods for manipulating
3
+ * `<pc-script>` elements. The ScriptElement interface also inherits the properties and
4
+ * methods of the {@link HTMLElement} interface.
3
5
  */
4
6
  declare class ScriptElement extends HTMLElement {
5
7
  private _attributes;
@@ -1,7 +1,9 @@
1
1
  import { SoundComponent } from 'playcanvas';
2
2
  import { ComponentElement } from './component';
3
3
  /**
4
- * Represents a sound component in the PlayCanvas engine.
4
+ * The SoundComponentElement interface provides properties and methods for manipulating
5
+ * `<pc-sounds>` elements. The SoundComponentElement interface also inherits the properties and
6
+ * methods of the {@link HTMLElement} interface.
5
7
  *
6
8
  * @category Components
7
9
  */
@@ -13,9 +15,10 @@ declare class SoundComponentElement extends ComponentElement {
13
15
  private _refDistance;
14
16
  private _rollOffFactor;
15
17
  private _volume;
18
+ /** @ignore */
16
19
  constructor();
17
20
  getInitialComponentData(): {
18
- distanceModel: "exponential" | "inverse" | "linear";
21
+ distanceModel: "linear" | "exponential" | "inverse";
19
22
  maxDistance: number;
20
23
  pitch: number;
21
24
  positional: boolean;
@@ -2,7 +2,9 @@ import { SoundSlot } from 'playcanvas';
2
2
  import { AsyncElement } from '../async-element';
3
3
  import { SoundComponentElement } from './sound-component';
4
4
  /**
5
- * Represents a sound slot in the PlayCanvas engine.
5
+ * The SoundSlotElement interface provides properties and methods for manipulating
6
+ * `<pc-sound>` elements. The SoundSlotElement interface also inherits the properties and
7
+ * methods of the {@link AsyncElement} interface.
6
8
  */
7
9
  declare class SoundSlotElement extends AsyncElement {
8
10
  private _asset;
package/dist/entity.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { Entity, Vec3 } from 'playcanvas';
1
+ import { Application, Entity, Vec3 } from 'playcanvas';
2
2
  import { AsyncElement } from './async-element';
3
3
  /**
4
- * Represents an entity in the PlayCanvas engine.
4
+ * The EntityElement interface provides properties and methods for manipulating
5
+ * `<pc-entity>` elements. The EntityElement interface also inherits the properties and
6
+ * methods of the {@link HTMLElement} interface.
5
7
  */
6
8
  declare class EntityElement extends AsyncElement {
7
9
  /**
@@ -28,11 +30,17 @@ declare class EntityElement extends AsyncElement {
28
30
  * The tags of the entity.
29
31
  */
30
32
  private _tags;
33
+ /**
34
+ * The pointer event listeners for the entity.
35
+ */
36
+ private _listeners;
31
37
  /**
32
38
  * The PlayCanvas entity instance.
33
39
  */
34
40
  entity: Entity | null;
35
- connectedCallback(): Promise<void>;
41
+ createEntity(app: Application): void;
42
+ buildHierarchy(app: Application): void;
43
+ connectedCallback(): void;
36
44
  disconnectedCallback(): void;
37
45
  /**
38
46
  * Sets the enabled state of the entity.
@@ -96,5 +104,8 @@ declare class EntityElement extends AsyncElement {
96
104
  get tags(): string[];
97
105
  static get observedAttributes(): string[];
98
106
  attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
107
+ addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
108
+ removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void;
109
+ hasListeners(type: string): boolean;
99
110
  }
100
111
  export { EntityElement };
package/dist/fog.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ import { Color } from 'playcanvas';
2
+ /**
3
+ * The FogElement interface provides properties and methods for manipulating
4
+ * `<pc-fog>` elements. The FogElement interface also inherits the properties and
5
+ * methods of the {@link HTMLElement} interface.
6
+ */
7
+ declare class FogElement extends HTMLElement {
8
+ private _color;
9
+ private _density;
10
+ private _end;
11
+ private _start;
12
+ private _type;
13
+ private dispatchFogUpdate;
14
+ set color(value: Color);
15
+ get color(): Color;
16
+ set density(value: number);
17
+ get density(): number;
18
+ set end(value: number);
19
+ get end(): number;
20
+ set start(value: number);
21
+ get start(): number;
22
+ set type(value: 'linear' | 'exp' | 'exp2');
23
+ get type(): 'linear' | 'exp' | 'exp2';
24
+ static get observedAttributes(): string[];
25
+ attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
26
+ constructor();
27
+ }
28
+ export { FogElement };
@@ -1,6 +1,8 @@
1
1
  import { Color, StandardMaterial } from 'playcanvas';
2
2
  /**
3
- * Represents a material in the PlayCanvas engine.
3
+ * The MaterialElement interface provides properties and methods for manipulating
4
+ * `<pc-material>` elements. The MaterialElement interface also inherits the properties and
5
+ * methods of the {@link HTMLElement} interface.
4
6
  */
5
7
  declare class MaterialElement extends HTMLElement {
6
8
  private _diffuse;
package/dist/model.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { AsyncElement } from './async-element';
2
2
  /**
3
- * Represents a model in the PlayCanvas engine.
3
+ * The ModelElement interface provides properties and methods for manipulating
4
+ * `<pc-model>` elements. The ModelElement interface also inherits the properties and
5
+ * methods of the {@link HTMLElement} interface.
4
6
  */
5
7
  declare class ModelElement extends AsyncElement {
6
8
  private _asset;
package/dist/module.d.ts CHANGED
@@ -1,5 +1,11 @@
1
+ /**
2
+ * The ModuleElement interface provides properties and methods for manipulating
3
+ * `<pc-module>` elements. The ModuleElement interface also inherits the properties and
4
+ * methods of the {@link HTMLElement} interface.
5
+ */
1
6
  declare class ModuleElement extends HTMLElement {
2
7
  private loadPromise;
8
+ /** @ignore */
3
9
  constructor();
4
10
  private loadModule;
5
11
  getLoadPromise(): Promise<void>;