@playcanvas/web-components 0.20.0 → 0.21.0

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 (100) hide show
  1. package/dist/app.d.cts +5 -113
  2. package/dist/app.d.ts +5 -113
  3. package/dist/asset-binding.d.cts +1 -0
  4. package/dist/asset-binding.d.ts +1 -0
  5. package/dist/components/anim-clip.d.cts +8 -10
  6. package/dist/components/anim-clip.d.ts +8 -10
  7. package/dist/components/anim-component.d.cts +5 -4
  8. package/dist/components/anim-component.d.ts +5 -4
  9. package/dist/components/audio-listener-component.d.cts +5 -4
  10. package/dist/components/audio-listener-component.d.ts +5 -4
  11. package/dist/components/button-component.d.cts +5 -4
  12. package/dist/components/button-component.d.ts +5 -4
  13. package/dist/components/camera-component.d.cts +5 -4
  14. package/dist/components/camera-component.d.ts +5 -4
  15. package/dist/components/collision-component.d.cts +5 -4
  16. package/dist/components/collision-component.d.ts +5 -4
  17. package/dist/components/component.d.cts +2 -2
  18. package/dist/components/component.d.ts +2 -2
  19. package/dist/components/element-component.d.cts +5 -4
  20. package/dist/components/element-component.d.ts +5 -4
  21. package/dist/components/gsplat-component.d.cts +5 -4
  22. package/dist/components/gsplat-component.d.ts +5 -4
  23. package/dist/components/joint-component.d.cts +5 -4
  24. package/dist/components/joint-component.d.ts +5 -4
  25. package/dist/components/layout-child-component.d.cts +5 -4
  26. package/dist/components/layout-child-component.d.ts +5 -4
  27. package/dist/components/layout-group-component.d.cts +5 -4
  28. package/dist/components/layout-group-component.d.ts +5 -4
  29. package/dist/components/light-component.d.cts +5 -4
  30. package/dist/components/light-component.d.ts +5 -4
  31. package/dist/components/particle-system-component.d.cts +22 -5
  32. package/dist/components/particle-system-component.d.ts +22 -5
  33. package/dist/components/render-component.d.cts +5 -4
  34. package/dist/components/render-component.d.ts +5 -4
  35. package/dist/components/rigid-body-component.d.cts +5 -4
  36. package/dist/components/rigid-body-component.d.ts +5 -4
  37. package/dist/components/screen-component.d.cts +5 -4
  38. package/dist/components/screen-component.d.ts +5 -4
  39. package/dist/components/script-component.d.cts +5 -4
  40. package/dist/components/script-component.d.ts +5 -4
  41. package/dist/components/scroll-view-component.d.cts +5 -4
  42. package/dist/components/scroll-view-component.d.ts +5 -4
  43. package/dist/components/scrollbar-component.d.cts +5 -4
  44. package/dist/components/scrollbar-component.d.ts +5 -4
  45. package/dist/components/sound-component.d.cts +5 -4
  46. package/dist/components/sound-component.d.ts +5 -4
  47. package/dist/custom-elements.json +38 -38
  48. package/dist/entity-reference.d.cts +13 -0
  49. package/dist/entity-reference.d.ts +13 -0
  50. package/dist/material.d.cts +8 -6
  51. package/dist/material.d.ts +8 -6
  52. package/dist/model.d.cts +8 -9
  53. package/dist/model.d.ts +8 -9
  54. package/dist/parse.d.cts +0 -8
  55. package/dist/parse.d.ts +0 -8
  56. package/dist/pointer-controller.d.cts +1 -0
  57. package/dist/pointer-controller.d.ts +1 -0
  58. package/dist/pwc.cjs +1360 -1186
  59. package/dist/pwc.cjs.map +1 -1
  60. package/dist/pwc.js +1360 -1186
  61. package/dist/pwc.js.map +1 -1
  62. package/dist/pwc.min.js +1 -1
  63. package/dist/pwc.min.js.map +1 -1
  64. package/dist/pwc.min.mjs +1 -1
  65. package/dist/pwc.min.mjs.map +1 -1
  66. package/dist/pwc.mjs +1361 -1187
  67. package/dist/pwc.mjs.map +1 -1
  68. package/dist/sky.d.cts +6 -7
  69. package/dist/sky.d.ts +6 -7
  70. package/dist/web-types.json +39 -39
  71. package/package.json +2 -2
  72. package/src/app.ts +16 -451
  73. package/src/asset-binding.ts +141 -0
  74. package/src/components/anim-clip.ts +22 -45
  75. package/src/components/anim-component.ts +10 -6
  76. package/src/components/audio-listener-component.ts +6 -5
  77. package/src/components/button-component.ts +8 -6
  78. package/src/components/camera-component.ts +6 -5
  79. package/src/components/collision-component.ts +6 -5
  80. package/src/components/component.ts +6 -4
  81. package/src/components/element-component.ts +6 -5
  82. package/src/components/gsplat-component.ts +6 -5
  83. package/src/components/joint-component.ts +8 -6
  84. package/src/components/layout-child-component.ts +6 -5
  85. package/src/components/layout-group-component.ts +6 -5
  86. package/src/components/light-component.ts +6 -5
  87. package/src/components/particle-system-component.ts +56 -30
  88. package/src/components/render-component.ts +6 -5
  89. package/src/components/rigid-body-component.ts +6 -5
  90. package/src/components/screen-component.ts +6 -5
  91. package/src/components/script-component.ts +8 -10
  92. package/src/components/scroll-view-component.ts +8 -6
  93. package/src/components/scrollbar-component.ts +8 -6
  94. package/src/components/sound-component.ts +6 -5
  95. package/src/entity-reference.ts +237 -0
  96. package/src/material.ts +25 -29
  97. package/src/model.ts +24 -48
  98. package/src/parse.ts +0 -232
  99. package/src/pointer-controller.ts +550 -0
  100. package/src/sky.ts +19 -30
@@ -20,7 +20,7 @@ import { ComponentElement } from './component.cjs';
20
20
  *
21
21
  * @category Components
22
22
  */
23
- declare class ElementComponentElement extends ComponentElement {
23
+ declare class ElementComponentElement extends ComponentElement<ElementComponent> {
24
24
  private _anchor;
25
25
  private _autoWidth;
26
26
  private _autoHeight;
@@ -52,10 +52,11 @@ declare class ElementComponentElement extends ComponentElement {
52
52
  protected initComponent(): void;
53
53
  protected getInitialComponentData(): Record<string, any>;
54
54
  /**
55
- * Gets the underlying PlayCanvas element component.
56
- * @returns The element component.
55
+ * Gets the underlying PlayCanvas element component. `null` until the element is
56
+ * ready see {@link ComponentElement.component}.
57
+ * @returns The element component, or `null`.
57
58
  */
58
- get component(): ElementComponent;
59
+ get component(): ElementComponent | null;
59
60
  /**
60
61
  * Sets the anchor of the element component.
61
62
  * @param value - The anchor.
@@ -20,7 +20,7 @@ import { ComponentElement } from './component.js';
20
20
  *
21
21
  * @category Components
22
22
  */
23
- declare class ElementComponentElement extends ComponentElement {
23
+ declare class ElementComponentElement extends ComponentElement<ElementComponent> {
24
24
  private _anchor;
25
25
  private _autoWidth;
26
26
  private _autoHeight;
@@ -52,10 +52,11 @@ declare class ElementComponentElement extends ComponentElement {
52
52
  protected initComponent(): void;
53
53
  protected getInitialComponentData(): Record<string, any>;
54
54
  /**
55
- * Gets the underlying PlayCanvas element component.
56
- * @returns The element component.
55
+ * Gets the underlying PlayCanvas element component. `null` until the element is
56
+ * ready see {@link ComponentElement.component}.
57
+ * @returns The element component, or `null`.
57
58
  */
58
- get component(): ElementComponent;
59
+ get component(): ElementComponent | null;
59
60
  /**
60
61
  * Sets the anchor of the element component.
61
62
  * @param value - The anchor.
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.cjs';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class GSplatComponentElement extends ComponentElement {
17
+ declare class GSplatComponentElement extends ComponentElement<GSplatComponent> {
18
18
  private _asset;
19
19
  private _castShadows;
20
20
  private _lodBaseDistance;
@@ -32,10 +32,11 @@ declare class GSplatComponentElement extends ComponentElement {
32
32
  lodRangeMax: number;
33
33
  };
34
34
  /**
35
- * Gets the underlying PlayCanvas gsplat component.
36
- * @returns The gsplat component.
35
+ * Gets the underlying PlayCanvas gsplat component. `null` until the element is
36
+ * ready see {@link ComponentElement.component}.
37
+ * @returns The gsplat component, or `null`.
37
38
  */
38
- get component(): GSplatComponent;
39
+ get component(): GSplatComponent | null;
39
40
  /**
40
41
  * Sets id of the `pc-asset` to use for the splat.
41
42
  * @param value - The asset ID.
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.js';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class GSplatComponentElement extends ComponentElement {
17
+ declare class GSplatComponentElement extends ComponentElement<GSplatComponent> {
18
18
  private _asset;
19
19
  private _castShadows;
20
20
  private _lodBaseDistance;
@@ -32,10 +32,11 @@ declare class GSplatComponentElement extends ComponentElement {
32
32
  lodRangeMax: number;
33
33
  };
34
34
  /**
35
- * Gets the underlying PlayCanvas gsplat component.
36
- * @returns The gsplat component.
35
+ * Gets the underlying PlayCanvas gsplat component. `null` until the element is
36
+ * ready see {@link ComponentElement.component}.
37
+ * @returns The gsplat component, or `null`.
37
38
  */
38
- get component(): GSplatComponent;
39
+ get component(): GSplatComponent | null;
39
40
  /**
40
41
  * Sets id of the `pc-asset` to use for the splat.
41
42
  * @param value - The asset ID.
@@ -39,7 +39,7 @@ export type MotionMode = 'locked' | 'limited' | 'free';
39
39
  *
40
40
  * @category Components
41
41
  */
42
- declare class JointComponentElement extends ComponentElement {
42
+ declare class JointComponentElement extends ComponentElement<JointComponent> {
43
43
  /**
44
44
  * The spring damping of the joint per angular axis.
45
45
  */
@@ -197,10 +197,11 @@ declare class JointComponentElement extends ComponentElement {
197
197
  private _onBreak;
198
198
  protected initComponent(): void;
199
199
  /**
200
- * Gets the underlying PlayCanvas joint component.
201
- * @returns The joint component.
200
+ * Gets the underlying PlayCanvas joint component. `null` until the element is
201
+ * ready see {@link ComponentElement.component}.
202
+ * @returns The joint component, or `null`.
202
203
  */
203
- get component(): JointComponent;
204
+ get component(): JointComponent | null;
204
205
  /**
205
206
  * Sets the spring damping of a 6dof joint per angular axis, used on axes with a non-zero
206
207
  * angular-stiffness.
@@ -39,7 +39,7 @@ export type MotionMode = 'locked' | 'limited' | 'free';
39
39
  *
40
40
  * @category Components
41
41
  */
42
- declare class JointComponentElement extends ComponentElement {
42
+ declare class JointComponentElement extends ComponentElement<JointComponent> {
43
43
  /**
44
44
  * The spring damping of the joint per angular axis.
45
45
  */
@@ -197,10 +197,11 @@ declare class JointComponentElement extends ComponentElement {
197
197
  private _onBreak;
198
198
  protected initComponent(): void;
199
199
  /**
200
- * Gets the underlying PlayCanvas joint component.
201
- * @returns The joint component.
200
+ * Gets the underlying PlayCanvas joint component. `null` until the element is
201
+ * ready see {@link ComponentElement.component}.
202
+ * @returns The joint component, or `null`.
202
203
  */
203
- get component(): JointComponent;
204
+ get component(): JointComponent | null;
204
205
  /**
205
206
  * Sets the spring damping of a 6dof joint per angular axis, used on axes with a non-zero
206
207
  * angular-stiffness.
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.cjs';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class LayoutChildComponentElement extends ComponentElement {
17
+ declare class LayoutChildComponentElement extends ComponentElement<LayoutChildComponent> {
18
18
  private _minWidth;
19
19
  private _minHeight;
20
20
  private _maxWidth;
@@ -34,10 +34,11 @@ declare class LayoutChildComponentElement extends ComponentElement {
34
34
  excludeFromLayout: boolean;
35
35
  };
36
36
  /**
37
- * Gets the underlying PlayCanvas layout child component.
38
- * @returns The layout child component.
37
+ * Gets the underlying PlayCanvas layout child component. `null` until the element is
38
+ * ready see {@link ComponentElement.component}.
39
+ * @returns The layout child component, or `null`.
39
40
  */
40
- get component(): LayoutChildComponent;
41
+ get component(): LayoutChildComponent | null;
41
42
  /**
42
43
  * Sets the minimum width the element should be laid out with.
43
44
  * @param value - The minimum width.
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.js';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class LayoutChildComponentElement extends ComponentElement {
17
+ declare class LayoutChildComponentElement extends ComponentElement<LayoutChildComponent> {
18
18
  private _minWidth;
19
19
  private _minHeight;
20
20
  private _maxWidth;
@@ -34,10 +34,11 @@ declare class LayoutChildComponentElement extends ComponentElement {
34
34
  excludeFromLayout: boolean;
35
35
  };
36
36
  /**
37
- * Gets the underlying PlayCanvas layout child component.
38
- * @returns The layout child component.
37
+ * Gets the underlying PlayCanvas layout child component. `null` until the element is
38
+ * ready see {@link ComponentElement.component}.
39
+ * @returns The layout child component, or `null`.
39
40
  */
40
- get component(): LayoutChildComponent;
41
+ get component(): LayoutChildComponent | null;
41
42
  /**
42
43
  * Sets the minimum width the element should be laid out with.
43
44
  * @param value - The minimum width.
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.cjs';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class LayoutGroupComponentElement extends ComponentElement {
18
+ declare class LayoutGroupComponentElement extends ComponentElement<LayoutGroupComponent> {
19
19
  private _orientation;
20
20
  private _reverseX;
21
21
  private _reverseY;
@@ -39,10 +39,11 @@ declare class LayoutGroupComponentElement extends ComponentElement {
39
39
  wrap: boolean;
40
40
  };
41
41
  /**
42
- * Gets the underlying PlayCanvas layout group component.
43
- * @returns The layout group component.
42
+ * Gets the underlying PlayCanvas layout group component. `null` until the element is
43
+ * ready see {@link ComponentElement.component}.
44
+ * @returns The layout group component, or `null`.
44
45
  */
45
- get component(): LayoutGroupComponent;
46
+ get component(): LayoutGroupComponent | null;
46
47
  /**
47
48
  * Sets the orientation of the layout group. Can be `horizontal` or `vertical`. Defaults to
48
49
  * `horizontal`.
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.js';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class LayoutGroupComponentElement extends ComponentElement {
18
+ declare class LayoutGroupComponentElement extends ComponentElement<LayoutGroupComponent> {
19
19
  private _orientation;
20
20
  private _reverseX;
21
21
  private _reverseY;
@@ -39,10 +39,11 @@ declare class LayoutGroupComponentElement extends ComponentElement {
39
39
  wrap: boolean;
40
40
  };
41
41
  /**
42
- * Gets the underlying PlayCanvas layout group component.
43
- * @returns The layout group component.
42
+ * Gets the underlying PlayCanvas layout group component. `null` until the element is
43
+ * ready see {@link ComponentElement.component}.
44
+ * @returns The layout group component, or `null`.
44
45
  */
45
- get component(): LayoutGroupComponent;
46
+ get component(): LayoutGroupComponent | null;
46
47
  /**
47
48
  * Sets the orientation of the layout group. Can be `horizontal` or `vertical`. Defaults to
48
49
  * `horizontal`.
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.cjs';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class LightComponentElement extends ComponentElement {
18
+ declare class LightComponentElement extends ComponentElement<LightComponent> {
19
19
  private _cascadeBlend;
20
20
  private _cascadeDistribution;
21
21
  private _castShadows;
@@ -65,10 +65,11 @@ declare class LightComponentElement extends ComponentElement {
65
65
  vsmBlurSize: number;
66
66
  };
67
67
  /**
68
- * Gets the underlying PlayCanvas light component.
69
- * @returns The light component.
68
+ * Gets the underlying PlayCanvas light component. `null` until the element is
69
+ * ready see {@link ComponentElement.component}.
70
+ * @returns The light component, or `null`.
70
71
  */
71
- get component(): LightComponent;
72
+ get component(): LightComponent | null;
72
73
  /**
73
74
  * Sets the fraction of each shadow cascade that is blended into the next one, from 0 (no
74
75
  * blending) to 1, which applies only to `directional` lights with `num-cascades` greater than
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.js';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class LightComponentElement extends ComponentElement {
18
+ declare class LightComponentElement extends ComponentElement<LightComponent> {
19
19
  private _cascadeBlend;
20
20
  private _cascadeDistribution;
21
21
  private _castShadows;
@@ -65,10 +65,11 @@ declare class LightComponentElement extends ComponentElement {
65
65
  vsmBlurSize: number;
66
66
  };
67
67
  /**
68
- * Gets the underlying PlayCanvas light component.
69
- * @returns The light component.
68
+ * Gets the underlying PlayCanvas light component. `null` until the element is
69
+ * ready see {@link ComponentElement.component}.
70
+ * @returns The light component, or `null`.
70
71
  */
71
- get component(): LightComponent;
72
+ get component(): LightComponent | null;
72
73
  /**
73
74
  * Sets the fraction of each shadow cascade that is blended into the next one, from 0 (no
74
75
  * blending) to 1, which applies only to `directional` lights with `num-cascades` greater than
@@ -14,18 +14,35 @@ import { ComponentElement } from './component.cjs';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class ParticleSystemComponentElement extends ComponentElement {
17
+ declare class ParticleSystemComponentElement extends ComponentElement<ParticleSystemComponent> {
18
18
  private _asset;
19
+ /**
20
+ * The subscription to the current config asset while its load is in flight. Rebinding
21
+ * supersedes it and disconnect cancels it, so a superseded config — an earlier asset that
22
+ * finishes loading after its replacement, or a callback left behind by a previous
23
+ * connection — can never configure the component.
24
+ */
25
+ private _binding;
19
26
  /** @ignore */
20
27
  constructor();
21
28
  protected getInitialComponentData(): object;
29
+ protected initComponent(): void;
30
+ disconnectedCallback(): void;
31
+ /**
32
+ * Gets the underlying PlayCanvas particle system component. `null` until the element is
33
+ * ready — see {@link ComponentElement.component}.
34
+ * @returns The particle system component, or `null`.
35
+ */
36
+ get component(): ParticleSystemComponent | null;
22
37
  /**
23
- * Gets the underlying PlayCanvas particle system component.
24
- * @returns The particle system component.
38
+ * Rewrites the config's `colorMapAsset` from the `pc-asset` id it is authored with to the
39
+ * engine asset id the component resolves, starting the texture's load if it is lazy. The
40
+ * rewrite is in place, so a config applied again — a host cycle, a reconnection — is already
41
+ * resolved and passes through unchanged.
25
42
  */
26
- get component(): ParticleSystemComponent;
43
+ private _resolveColorMap;
27
44
  private applyConfig;
28
- private _loadAsset;
45
+ private _bindConfig;
29
46
  /**
30
47
  * Sets the id of the `pc-asset` to use for the model.
31
48
  * @param value - The asset ID.
@@ -14,18 +14,35 @@ import { ComponentElement } from './component.js';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class ParticleSystemComponentElement extends ComponentElement {
17
+ declare class ParticleSystemComponentElement extends ComponentElement<ParticleSystemComponent> {
18
18
  private _asset;
19
+ /**
20
+ * The subscription to the current config asset while its load is in flight. Rebinding
21
+ * supersedes it and disconnect cancels it, so a superseded config — an earlier asset that
22
+ * finishes loading after its replacement, or a callback left behind by a previous
23
+ * connection — can never configure the component.
24
+ */
25
+ private _binding;
19
26
  /** @ignore */
20
27
  constructor();
21
28
  protected getInitialComponentData(): object;
29
+ protected initComponent(): void;
30
+ disconnectedCallback(): void;
31
+ /**
32
+ * Gets the underlying PlayCanvas particle system component. `null` until the element is
33
+ * ready — see {@link ComponentElement.component}.
34
+ * @returns The particle system component, or `null`.
35
+ */
36
+ get component(): ParticleSystemComponent | null;
22
37
  /**
23
- * Gets the underlying PlayCanvas particle system component.
24
- * @returns The particle system component.
38
+ * Rewrites the config's `colorMapAsset` from the `pc-asset` id it is authored with to the
39
+ * engine asset id the component resolves, starting the texture's load if it is lazy. The
40
+ * rewrite is in place, so a config applied again — a host cycle, a reconnection — is already
41
+ * resolved and passes through unchanged.
25
42
  */
26
- get component(): ParticleSystemComponent;
43
+ private _resolveColorMap;
27
44
  private applyConfig;
28
- private _loadAsset;
45
+ private _bindConfig;
29
46
  /**
30
47
  * Sets the id of the `pc-asset` to use for the model.
31
48
  * @param value - The asset ID.
@@ -19,7 +19,7 @@ import { ComponentElement } from './component.cjs';
19
19
  *
20
20
  * @category Components
21
21
  */
22
- declare class RenderComponentElement extends ComponentElement {
22
+ declare class RenderComponentElement extends ComponentElement<RenderComponent> {
23
23
  private _castShadows;
24
24
  private _material;
25
25
  private _receiveShadows;
@@ -33,10 +33,11 @@ declare class RenderComponentElement extends ComponentElement {
33
33
  receiveShadows: boolean;
34
34
  };
35
35
  /**
36
- * Gets the underlying PlayCanvas render component.
37
- * @returns The render component.
36
+ * Gets the underlying PlayCanvas render component. `null` until the element is
37
+ * ready see {@link ComponentElement.component}.
38
+ * @returns The render component, or `null`.
38
39
  */
39
- get component(): RenderComponent;
40
+ get component(): RenderComponent | null;
40
41
  /**
41
42
  * Sets the type of the render component.
42
43
  * @param value - The type.
@@ -19,7 +19,7 @@ import { ComponentElement } from './component.js';
19
19
  *
20
20
  * @category Components
21
21
  */
22
- declare class RenderComponentElement extends ComponentElement {
22
+ declare class RenderComponentElement extends ComponentElement<RenderComponent> {
23
23
  private _castShadows;
24
24
  private _material;
25
25
  private _receiveShadows;
@@ -33,10 +33,11 @@ declare class RenderComponentElement extends ComponentElement {
33
33
  receiveShadows: boolean;
34
34
  };
35
35
  /**
36
- * Gets the underlying PlayCanvas render component.
37
- * @returns The render component.
36
+ * Gets the underlying PlayCanvas render component. `null` until the element is
37
+ * ready see {@link ComponentElement.component}.
38
+ * @returns The render component, or `null`.
38
39
  */
39
- get component(): RenderComponent;
40
+ get component(): RenderComponent | null;
40
41
  /**
41
42
  * Sets the type of the render component.
42
43
  * @param value - The type.
@@ -16,7 +16,7 @@ import { ComponentElement } from './component.cjs';
16
16
  *
17
17
  * @category Components
18
18
  */
19
- declare class RigidBodyComponentElement extends ComponentElement {
19
+ declare class RigidBodyComponentElement extends ComponentElement<RigidBodyComponent> {
20
20
  /**
21
21
  * The angular damping of the rigidbody.
22
22
  */
@@ -67,10 +67,11 @@ declare class RigidBodyComponentElement extends ComponentElement {
67
67
  type: "static" | "dynamic" | "kinematic";
68
68
  };
69
69
  /**
70
- * Gets the underlying PlayCanvas rigidbody component.
71
- * @returns The rigidbody component.
70
+ * Gets the underlying PlayCanvas rigidbody component. `null` until the element is
71
+ * ready see {@link ComponentElement.component}.
72
+ * @returns The rigidbody component, or `null`.
72
73
  */
73
- get component(): RigidBodyComponent;
74
+ get component(): RigidBodyComponent | null;
74
75
  set angularDamping(value: number);
75
76
  get angularDamping(): number;
76
77
  set angularFactor(value: Vec3);
@@ -16,7 +16,7 @@ import { ComponentElement } from './component.js';
16
16
  *
17
17
  * @category Components
18
18
  */
19
- declare class RigidBodyComponentElement extends ComponentElement {
19
+ declare class RigidBodyComponentElement extends ComponentElement<RigidBodyComponent> {
20
20
  /**
21
21
  * The angular damping of the rigidbody.
22
22
  */
@@ -67,10 +67,11 @@ declare class RigidBodyComponentElement extends ComponentElement {
67
67
  type: "static" | "dynamic" | "kinematic";
68
68
  };
69
69
  /**
70
- * Gets the underlying PlayCanvas rigidbody component.
71
- * @returns The rigidbody component.
70
+ * Gets the underlying PlayCanvas rigidbody component. `null` until the element is
71
+ * ready see {@link ComponentElement.component}.
72
+ * @returns The rigidbody component, or `null`.
72
73
  */
73
- get component(): RigidBodyComponent;
74
+ get component(): RigidBodyComponent | null;
74
75
  set angularDamping(value: number);
75
76
  get angularDamping(): number;
76
77
  set angularFactor(value: Vec3);
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.cjs';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class ScreenComponentElement extends ComponentElement {
18
+ declare class ScreenComponentElement extends ComponentElement<ScreenComponent> {
19
19
  private _screenSpace;
20
20
  private _resolution;
21
21
  private _referenceResolution;
@@ -33,10 +33,11 @@ declare class ScreenComponentElement extends ComponentElement {
33
33
  screenSpace: boolean;
34
34
  };
35
35
  /**
36
- * Gets the underlying PlayCanvas screen component.
37
- * @returns The screen component.
36
+ * Gets the underlying PlayCanvas screen component. `null` until the element is
37
+ * ready see {@link ComponentElement.component}.
38
+ * @returns The screen component, or `null`.
38
39
  */
39
- get component(): ScreenComponent;
40
+ get component(): ScreenComponent | null;
40
41
  set priority(value: number);
41
42
  get priority(): number;
42
43
  set referenceResolution(value: Vec2);
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.js';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class ScreenComponentElement extends ComponentElement {
18
+ declare class ScreenComponentElement extends ComponentElement<ScreenComponent> {
19
19
  private _screenSpace;
20
20
  private _resolution;
21
21
  private _referenceResolution;
@@ -33,10 +33,11 @@ declare class ScreenComponentElement extends ComponentElement {
33
33
  screenSpace: boolean;
34
34
  };
35
35
  /**
36
- * Gets the underlying PlayCanvas screen component.
37
- * @returns The screen component.
36
+ * Gets the underlying PlayCanvas screen component. `null` until the element is
37
+ * ready see {@link ComponentElement.component}.
38
+ * @returns The screen component, or `null`.
38
39
  */
39
- get component(): ScreenComponent;
40
+ get component(): ScreenComponent | null;
40
41
  set priority(value: number);
41
42
  get priority(): number;
42
43
  set referenceResolution(value: Vec2);
@@ -29,7 +29,7 @@ export type ScriptNameChangeEvent = {
29
29
  *
30
30
  * @category Components
31
31
  */
32
- declare class ScriptComponentElement extends ComponentElement {
32
+ declare class ScriptComponentElement extends ComponentElement<ScriptComponent> {
33
33
  private observer;
34
34
  /** @ignore */
35
35
  constructor();
@@ -171,9 +171,10 @@ declare class ScriptComponentElement extends ComponentElement {
171
171
  private handleMutations;
172
172
  disconnectedCallback(): void;
173
173
  /**
174
- * Gets the underlying PlayCanvas script component.
175
- * @returns The script component.
174
+ * Gets the underlying PlayCanvas script component. `null` until the element is
175
+ * ready see {@link ComponentElement.component}.
176
+ * @returns The script component, or `null`.
176
177
  */
177
- get component(): ScriptComponent;
178
+ get component(): ScriptComponent | null;
178
179
  }
179
180
  export { ScriptComponentElement };
@@ -29,7 +29,7 @@ export type ScriptNameChangeEvent = {
29
29
  *
30
30
  * @category Components
31
31
  */
32
- declare class ScriptComponentElement extends ComponentElement {
32
+ declare class ScriptComponentElement extends ComponentElement<ScriptComponent> {
33
33
  private observer;
34
34
  /** @ignore */
35
35
  constructor();
@@ -171,9 +171,10 @@ declare class ScriptComponentElement extends ComponentElement {
171
171
  private handleMutations;
172
172
  disconnectedCallback(): void;
173
173
  /**
174
- * Gets the underlying PlayCanvas script component.
175
- * @returns The script component.
174
+ * Gets the underlying PlayCanvas script component. `null` until the element is
175
+ * ready see {@link ComponentElement.component}.
176
+ * @returns The script component, or `null`.
176
177
  */
177
- get component(): ScriptComponent;
178
+ get component(): ScriptComponent | null;
178
179
  }
179
180
  export { ScriptComponentElement };
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.cjs';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class ScrollViewComponentElement extends ComponentElement {
18
+ declare class ScrollViewComponentElement extends ComponentElement<ScrollViewComponent> {
19
19
  private _horizontal;
20
20
  private _vertical;
21
21
  private _scrollMode;
@@ -33,10 +33,11 @@ declare class ScrollViewComponentElement extends ComponentElement {
33
33
  constructor();
34
34
  protected getInitialComponentData(): Record<string, any>;
35
35
  /**
36
- * Gets the underlying PlayCanvas scroll view component.
37
- * @returns The scroll view component.
36
+ * Gets the underlying PlayCanvas scroll view component. `null` until the element is
37
+ * ready see {@link ComponentElement.component}.
38
+ * @returns The scroll view component, or `null`.
38
39
  */
39
- get component(): ScrollViewComponent;
40
+ get component(): ScrollViewComponent | null;
40
41
  /**
41
42
  * Sets whether scrolling along the horizontal axis is enabled. This is a toggle, unlike the
42
43
  * `orientation` of a `<pc-scrollbar>`, for which `horizontal` is one of the accepted values.
@@ -15,7 +15,7 @@ import { ComponentElement } from './component.js';
15
15
  *
16
16
  * @category Components
17
17
  */
18
- declare class ScrollViewComponentElement extends ComponentElement {
18
+ declare class ScrollViewComponentElement extends ComponentElement<ScrollViewComponent> {
19
19
  private _horizontal;
20
20
  private _vertical;
21
21
  private _scrollMode;
@@ -33,10 +33,11 @@ declare class ScrollViewComponentElement extends ComponentElement {
33
33
  constructor();
34
34
  protected getInitialComponentData(): Record<string, any>;
35
35
  /**
36
- * Gets the underlying PlayCanvas scroll view component.
37
- * @returns The scroll view component.
36
+ * Gets the underlying PlayCanvas scroll view component. `null` until the element is
37
+ * ready see {@link ComponentElement.component}.
38
+ * @returns The scroll view component, or `null`.
38
39
  */
39
- get component(): ScrollViewComponent;
40
+ get component(): ScrollViewComponent | null;
40
41
  /**
41
42
  * Sets whether scrolling along the horizontal axis is enabled. This is a toggle, unlike the
42
43
  * `orientation` of a `<pc-scrollbar>`, for which `horizontal` is one of the accepted values.
@@ -14,7 +14,7 @@ import { ComponentElement } from './component.cjs';
14
14
  *
15
15
  * @category Components
16
16
  */
17
- declare class ScrollbarComponentElement extends ComponentElement {
17
+ declare class ScrollbarComponentElement extends ComponentElement<ScrollbarComponent> {
18
18
  private _orientation;
19
19
  private _value;
20
20
  private _handleSize;
@@ -23,10 +23,11 @@ declare class ScrollbarComponentElement extends ComponentElement {
23
23
  constructor();
24
24
  protected getInitialComponentData(): Record<string, any>;
25
25
  /**
26
- * Gets the underlying PlayCanvas scrollbar component.
27
- * @returns The scrollbar component.
26
+ * Gets the underlying PlayCanvas scrollbar component. `null` until the element is
27
+ * ready see {@link ComponentElement.component}.
28
+ * @returns The scrollbar component, or `null`.
28
29
  */
29
- get component(): ScrollbarComponent;
30
+ get component(): ScrollbarComponent | null;
30
31
  /**
31
32
  * Sets the orientation of the scrollbar. Can be `horizontal` or `vertical`. Defaults to
32
33
  * `horizontal`.