@dcl/sdk 7.0.0-3008112906.commit-524d1bd → 7.0.0-3039764556.commit-d9e186e

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.
@@ -548,13 +548,13 @@ export function Component(componentName: string, classId?: number): <TFunction e
548
548
 
549
549
  // @public (undocumented)
550
550
  export class ComponentAdded {
551
- constructor(entity: IEntity, componentName: string, classId: number | null);
551
+ constructor(entity: Entity, componentName: string, classId: number | null);
552
552
  // (undocumented)
553
553
  classId: number | null;
554
554
  // (undocumented)
555
555
  componentName: string;
556
556
  // (undocumented)
557
- entity: IEntity;
557
+ entity: Entity;
558
558
  }
559
559
 
560
560
  // @public (undocumented)
@@ -573,9 +573,9 @@ export class ComponentGroup {
573
573
  // (undocumented)
574
574
  active: boolean;
575
575
  // (undocumented)
576
- readonly entities: ReadonlyArray<IEntity>;
576
+ readonly entities: ReadonlyArray<Entity>;
577
577
  // (undocumented)
578
- hasEntity(entity: IEntity): boolean;
578
+ hasEntity(entity: Entity): boolean;
579
579
  // (undocumented)
580
580
  readonly requires: ReadonlyArray<ComponentConstructor<any>>;
581
581
  // (undocumented)
@@ -588,13 +588,13 @@ export interface ComponentLike {
588
588
 
589
589
  // @public (undocumented)
590
590
  export class ComponentRemoved {
591
- constructor(entity: IEntity, componentName: string, component: ComponentLike);
591
+ constructor(entity: Entity, componentName: string, component: ComponentLike);
592
592
  // (undocumented)
593
593
  component: ComponentLike;
594
594
  // (undocumented)
595
595
  componentName: string;
596
596
  // (undocumented)
597
- entity: IEntity;
597
+ entity: Entity;
598
598
  }
599
599
 
600
600
  // @public (undocumented)
@@ -718,39 +718,39 @@ export type EcsMathReadOnlyVector4 = {
718
718
 
719
719
  // @public (undocumented)
720
720
  export class Engine implements IEngine {
721
- constructor(rootEntity: IEntity);
721
+ constructor(rootEntity: Entity);
722
722
  // (undocumented)
723
- addEntity(entity: IEntity): IEntity;
723
+ addEntity(entity: Entity): Entity;
724
724
  // (undocumented)
725
725
  addSystem(system: ISystem, priority?: number): ISystem;
726
726
  // (undocumented)
727
- readonly avatarEntity: IEntity;
727
+ readonly avatarEntity: Entity;
728
728
  // (undocumented)
729
729
  get disposableComponents(): Readonly<Record<string, DisposableComponentLike>>;
730
730
  // (undocumented)
731
731
  disposeComponent(component: DisposableComponentLike): boolean;
732
732
  // (undocumented)
733
- get entities(): Readonly<Record<string, IEntity>>;
733
+ get entities(): Readonly<Record<string, Entity>>;
734
734
  // (undocumented)
735
735
  readonly eventManager: EventManager;
736
736
  // (undocumented)
737
- readonly firstPersonCameraEntity: IEntity;
737
+ readonly firstPersonCameraEntity: Entity;
738
738
  // (undocumented)
739
739
  getComponentGroup(...requires: ComponentConstructor<any>[]): ComponentGroup;
740
740
  // (undocumented)
741
741
  getEntitiesWithComponent(component: string): Record<string, any>;
742
742
  // (undocumented)
743
- getEntitiesWithComponent(component: ComponentConstructor<any>): Record<string, IEntity>;
743
+ getEntitiesWithComponent(component: ComponentConstructor<any>): Record<string, Entity>;
744
744
  // (undocumented)
745
745
  registerComponent(component: DisposableComponentLike): void;
746
746
  // (undocumented)
747
747
  removeComponentGroup(componentGroup: ComponentGroup): boolean;
748
748
  // (undocumented)
749
- removeEntity(entity: IEntity): boolean;
749
+ removeEntity(entity: Entity): boolean;
750
750
  // (undocumented)
751
751
  removeSystem(system: ISystem): boolean;
752
752
  // (undocumented)
753
- readonly rootEntity: IEntity;
753
+ readonly rootEntity: Entity;
754
754
  // (undocumented)
755
755
  update(dt: number): this;
756
756
  // (undocumented)
@@ -761,14 +761,14 @@ export class Engine implements IEngine {
761
761
  export const engine: Engine;
762
762
 
763
763
  // @public (undocumented)
764
- export class Entity implements IEntity {
764
+ export class Entity implements Entity {
765
765
  constructor(name?: string | undefined);
766
766
  addComponent<T extends object>(component: T): T;
767
767
  addComponentOrReplace<T extends object>(component: T): T;
768
768
  // (undocumented)
769
769
  alive: boolean;
770
770
  // (undocumented)
771
- children: Record<string, IEntity>;
771
+ children: Record<string, Entity>;
772
772
  // (undocumented)
773
773
  readonly components: Record<string, any>;
774
774
  // (undocumented)
@@ -782,7 +782,7 @@ export class Entity implements IEntity {
782
782
  getComponentOrNull<T = any>(component: string): T | null;
783
783
  // (undocumented)
784
784
  getComponentOrNull<T>(component: ComponentConstructor<T>): T | null;
785
- getParent(): IEntity | null;
785
+ getParent(): Entity | null;
786
786
  hasComponent<T = any>(component: string): boolean;
787
787
  // (undocumented)
788
788
  hasComponent<T>(component: ComponentConstructor<T>): boolean;
@@ -796,7 +796,7 @@ export class Entity implements IEntity {
796
796
  removeComponent<T extends object>(component: T, triggerRemovedEvent?: boolean): void;
797
797
  // (undocumented)
798
798
  removeComponent(component: ComponentConstructor<any>, triggerRemovedEvent?: boolean): void;
799
- setParent(_parent: IEntity | Attachable | null): IEntity;
799
+ setParent(_parent: Entity | Attachable | null): Entity;
800
800
  // (undocumented)
801
801
  readonly uuid: string;
802
802
  }
@@ -933,32 +933,32 @@ export interface HitEntityInfo {
933
933
  // @public (undocumented)
934
934
  export interface IEngine {
935
935
  // (undocumented)
936
- addEntity(entity: IEntity): void;
936
+ addEntity(entity: Entity): void;
937
937
  // (undocumented)
938
938
  addSystem(system: ISystem, priority: number): void;
939
939
  // (undocumented)
940
- readonly avatarEntity: IEntity;
940
+ readonly avatarEntity: Entity;
941
941
  // (undocumented)
942
- readonly entities: Readonly<Record<string, IEntity>>;
942
+ readonly entities: Readonly<Record<string, Entity>>;
943
943
  // (undocumented)
944
- readonly firstPersonCameraEntity: IEntity;
944
+ readonly firstPersonCameraEntity: Entity;
945
945
  // (undocumented)
946
- removeEntity(entity: IEntity): void;
946
+ removeEntity(entity: Entity): void;
947
947
  // (undocumented)
948
948
  removeSystem(system: ISystem): void;
949
949
  // (undocumented)
950
- rootEntity: IEntity;
950
+ rootEntity: Entity;
951
951
  }
952
952
 
953
953
  // @public (undocumented)
954
- export interface IEntity {
954
+ export interface Entity {
955
955
  addComponent<T extends object>(component: T): void;
956
956
  // (undocumented)
957
957
  addComponentOrReplace<T extends object>(component: T): void;
958
958
  // (undocumented)
959
959
  alive: boolean;
960
960
  // (undocumented)
961
- children: Record<string, IEntity>;
961
+ children: Record<string, Entity>;
962
962
  // (undocumented)
963
963
  readonly components: Record<string, any>;
964
964
  // (undocumented)
@@ -979,7 +979,7 @@ export interface IEntity {
979
979
  // (undocumented)
980
980
  getComponentOrNull<T>(component: ComponentConstructor<T> | string): T | null;
981
981
  // (undocumented)
982
- getParent(): IEntity | null;
982
+ getParent(): Entity | null;
983
983
  // (undocumented)
984
984
  hasComponent<T = any>(component: string): boolean;
985
985
  // (undocumented)
@@ -999,7 +999,7 @@ export interface IEntity {
999
999
  // (undocumented)
1000
1000
  removeComponent(component: object | string | Function, triggerRemovedEvent: any): void;
1001
1001
  // (undocumented)
1002
- setParent(e: IEntity | Attachable | null): void;
1002
+ setParent(e: Entity | Attachable | null): void;
1003
1003
  // (undocumented)
1004
1004
  readonly uuid: string;
1005
1005
  }
@@ -1067,9 +1067,9 @@ export interface ISystem {
1067
1067
  // (undocumented)
1068
1068
  deactivate?(): void;
1069
1069
  // (undocumented)
1070
- onAddEntity?(entity: IEntity): void;
1070
+ onAddEntity?(entity: Entity): void;
1071
1071
  // (undocumented)
1072
- onRemoveEntity?(entity: IEntity): void;
1072
+ onRemoveEntity?(entity: Entity): void;
1073
1073
  // (undocumented)
1074
1074
  update?(dt: number): void;
1075
1075
  }
@@ -1587,11 +1587,11 @@ export type ParcelsWithAccess = Array<{
1587
1587
 
1588
1588
  // @public (undocumented)
1589
1589
  export class ParentChanged {
1590
- constructor(entity: IEntity, parent: IEntity | null);
1590
+ constructor(entity: Entity, parent: Entity | null);
1591
1591
  // (undocumented)
1592
- entity: IEntity;
1592
+ entity: Entity;
1593
1593
  // (undocumented)
1594
- parent: IEntity | null;
1594
+ parent: Entity | null;
1595
1595
  }
1596
1596
 
1597
1597
  // @public
@@ -2397,9 +2397,9 @@ export class UUIDEventSystem implements ISystem {
2397
2397
  [uuid: string]: OnUUIDEvent<any>;
2398
2398
  };
2399
2399
  // (undocumented)
2400
- onAddEntity(entity: IEntity): void;
2400
+ onAddEntity(entity: Entity): void;
2401
2401
  // (undocumented)
2402
- onRemoveEntity(entity: IEntity): void;
2402
+ onRemoveEntity(entity: Entity): void;
2403
2403
  }
2404
2404
 
2405
2405
  // @public
@@ -247,14 +247,24 @@ declare namespace Components {
247
247
  /** @public */
248
248
  const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
249
249
  /** @public */
250
+ const PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
251
+ /** @public */
252
+ const PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
253
+ /** @public */
250
254
  const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
251
255
  /** @public */
256
+ const Raycast: ComponentDefinition<ISchema<PBRaycast>, PBRaycast>;
257
+ /** @public */
258
+ const RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
259
+ /** @public */
252
260
  const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
253
261
  /** @public */
254
262
  const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
255
263
  /** @public */
256
264
  const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
257
265
  /** @public */
266
+ const UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
267
+ /** @public */
258
268
  const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
259
269
  }
260
270
 
@@ -480,10 +490,15 @@ declare function defineSdkComponents(engine: PreEngine): {
480
490
  OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
481
491
  OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
482
492
  PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
493
+ PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
494
+ PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
483
495
  PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
496
+ Raycast: ComponentDefinition<ISchema<PBRaycast>, PBRaycast>;
497
+ RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
484
498
  SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
485
499
  TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
486
500
  UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
501
+ UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
487
502
  VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
488
503
  };
489
504
 
@@ -587,13 +602,13 @@ declare type IEngine = {
587
602
  * engine.addSystem(mySystem, 10)
588
603
  * ```
589
604
  */
590
- addSystem(system: Update, priority?: number, name?: string): void;
605
+ addSystem(system: SystemFn, priority?: number, name?: string): void;
591
606
  /**
592
607
  * Remove a system from the engine.
593
608
  * @param selector the function or the unique name to identify
594
609
  * @returns if it was found and removed
595
610
  */
596
- removeSystem(selector: string | Update): boolean;
611
+ removeSystem(selector: string | SystemFn): boolean;
597
612
  /**
598
613
  * Define a component and add it to the engine.
599
614
  * @param spec An object with schema fields
@@ -610,7 +625,7 @@ declare type IEngine = {
610
625
  *
611
626
  * ```
612
627
  */
613
- defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: Partial<Result<T>>): ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
628
+ defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType): ComponentDefinition<ISchema<Result<T>>, Partial<Result<T>>>;
614
629
  /**
615
630
  * Define a component and add it to the engine.
616
631
  * @param spec An object with schema fields
@@ -646,6 +661,7 @@ declare type IEngine = {
646
661
  * ```
647
662
  */
648
663
  getEntitiesWith<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...ReadonlyComponentSchema<T>]>;
664
+ RootEntity: Entity;
649
665
  baseComponents: SdkComponents;
650
666
  };
651
667
 
@@ -700,6 +716,17 @@ declare interface ISize {
700
716
  height: number;
701
717
  }
702
718
 
719
+ /**
720
+ * Check if a pointer event has been emited in the last tick-update.
721
+ * @param entity the entity to query, for global clicks use `engine.RootEntity`
722
+ * @param actionButton
723
+ * @param pointerEventType
724
+ * @returns
725
+ */
726
+ declare function isPointerEventActive(entity: Entity, actionButton: ActionButton, pointerEventType: PointerEventType): boolean;
727
+
728
+ declare function isPointerEventActiveGenerator(engine: IEngine): (entity: Entity, actionButton: ActionButton, pointerEventType: PointerEventType) => boolean;
729
+
703
730
  declare const log: (...a: any[]) => void;
704
731
 
705
732
  /** @public */
@@ -2072,10 +2099,63 @@ declare interface PBPlaneShape {
2072
2099
  uvs: number[];
2073
2100
  }
2074
2101
 
2102
+ declare interface PBPointerEvents {
2103
+ pointerEvents: PBPointerEvents_Entry[];
2104
+ }
2105
+
2106
+ declare interface PBPointerEvents_Entry {
2107
+ eventType: PointerEventType;
2108
+ eventInfo: PBPointerEvents_Info | undefined;
2109
+ }
2110
+
2111
+ declare interface PBPointerEvents_Info {
2112
+ /** default=ActionButton.ANY */
2113
+ button?: ActionButton | undefined;
2114
+ /** default='Interact' */
2115
+ hoverText?: string | undefined;
2116
+ /** default=10 */
2117
+ maxDistance?: number | undefined;
2118
+ /** default=true */
2119
+ showFeedback?: boolean | undefined;
2120
+ }
2121
+
2122
+ /** the renderer will set this component to the root entity once per frame with all the events */
2123
+ declare interface PBPointerEventsResult {
2124
+ /** a list of the last N pointer commands (from the engine) */
2125
+ commands: PBPointerEventsResult_PointerCommand[];
2126
+ }
2127
+
2128
+ /** this message represents a pointer event, used both for UP and DOWN actions */
2129
+ declare interface PBPointerEventsResult_PointerCommand {
2130
+ /** identifier of the input */
2131
+ button: ActionButton;
2132
+ hit: RaycastHit | undefined;
2133
+ state: PointerEventType;
2134
+ /** could be a Lamport timestamp */
2135
+ timestamp: number;
2136
+ /** if the input is analog then we store it here */
2137
+ analog?: number | undefined;
2138
+ }
2139
+
2075
2140
  declare interface PBPointerLock {
2076
2141
  isPointerLocked: boolean;
2077
2142
  }
2078
2143
 
2144
+ declare interface PBRaycast {
2145
+ timestamp: number;
2146
+ origin: Vector3_2 | undefined;
2147
+ direction: Vector3_2 | undefined;
2148
+ maxDistance: number;
2149
+ queryType: RaycastQueryType;
2150
+ }
2151
+
2152
+ declare interface PBRaycastResult {
2153
+ timestamp: number;
2154
+ origin: Vector3_2 | undefined;
2155
+ direction: Vector3_2 | undefined;
2156
+ hits: RaycastHit[];
2157
+ }
2158
+
2079
2159
  declare interface PBSphereShape {
2080
2160
  /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
2081
2161
  withCollisions?: boolean | undefined;
@@ -2127,6 +2207,67 @@ declare interface PBUiText {
2127
2207
  textColor: Color3 | undefined;
2128
2208
  }
2129
2209
 
2210
+ declare interface PBUiTransform {
2211
+ parent: number;
2212
+ rightOf: number;
2213
+ positionType: YGPositionType;
2214
+ alignContent: YGAlign;
2215
+ alignItems: YGAlign;
2216
+ alignSelf: YGAlign;
2217
+ flexDirection: YGFlexDirection;
2218
+ flexWrap: YGWrap;
2219
+ justifyContent: YGJustify;
2220
+ overflow: YGOverflow;
2221
+ display: YGDisplay;
2222
+ direction: YGDirection;
2223
+ flex: number;
2224
+ flexBasisUnit: YGUnit;
2225
+ flexBasis: number;
2226
+ flexGrow: number;
2227
+ flexShrink: number;
2228
+ widthUnit: YGUnit;
2229
+ width: number;
2230
+ heightUnit: YGUnit;
2231
+ height: number;
2232
+ minWidthUnit: YGUnit;
2233
+ minWidth: number;
2234
+ minHeightUnit: YGUnit;
2235
+ minHeight: number;
2236
+ maxWidthUnit: YGUnit;
2237
+ maxWidth: number;
2238
+ maxHeightUnit: YGUnit;
2239
+ maxHeight: number;
2240
+ positionLeftUnit: YGUnit;
2241
+ positionLeft: number;
2242
+ positionTopUnit: YGUnit;
2243
+ positionTop: number;
2244
+ positionRightUnit: YGUnit;
2245
+ positionRight: number;
2246
+ positionBottomUnit: YGUnit;
2247
+ positionBottom: number;
2248
+ /** margin */
2249
+ marginLeftUnit: YGUnit;
2250
+ marginLeft: number;
2251
+ marginTopUnit: YGUnit;
2252
+ marginTop: number;
2253
+ marginRightUnit: YGUnit;
2254
+ marginRight: number;
2255
+ marginBottomUnit: YGUnit;
2256
+ marginBottom: number;
2257
+ paddingLeftUnit: YGUnit;
2258
+ paddingLeft: number;
2259
+ paddingTopUnit: YGUnit;
2260
+ paddingTop: number;
2261
+ paddingRightUnit: YGUnit;
2262
+ paddingRight: number;
2263
+ paddingBottomUnit: YGUnit;
2264
+ paddingBottom: number;
2265
+ borderLeft: number;
2266
+ borderTop: number;
2267
+ borderRight: number;
2268
+ borderBottom: number;
2269
+ }
2270
+
2130
2271
  declare interface PBVisibilityComponent {
2131
2272
  /** default=true */
2132
2273
  visible?: boolean | undefined;
@@ -2244,6 +2385,20 @@ declare namespace Plane {
2244
2385
  /** @public */
2245
2386
  declare const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
2246
2387
 
2388
+ /** @public */
2389
+ declare const PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
2390
+
2391
+ /** @public */
2392
+ declare const PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
2393
+
2394
+ declare const enum PointerEventType {
2395
+ UP = 0,
2396
+ DOWN = 1,
2397
+ HOVER_ENTER = 2,
2398
+ HOVER_LEAVE = 3,
2399
+ UNRECOGNIZED = -1
2400
+ }
2401
+
2247
2402
  /** @public */
2248
2403
  declare const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
2249
2404
 
@@ -2258,13 +2413,13 @@ declare function preEngine(): {
2258
2413
  addEntity: (dynamic?: boolean) => Entity;
2259
2414
  addDynamicEntity: () => Entity;
2260
2415
  removeEntity: (entity: Entity) => boolean;
2261
- addSystem: (fn: Update, priority?: number, name?: string | undefined) => void;
2416
+ addSystem: (fn: SystemFn, priority?: number, name?: string | undefined) => void;
2262
2417
  getSystems: () => {
2263
- fn: Update;
2418
+ fn: SystemFn;
2264
2419
  priority: number;
2265
2420
  name?: string | undefined;
2266
2421
  }[];
2267
- removeSystem: (selector: string | Update) => boolean;
2422
+ removeSystem: (selector: string | SystemFn) => boolean;
2268
2423
  defineComponent: <T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType | undefined) => ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
2269
2424
  defineComponentFromSchema: <T_1 extends ISchema<any>, ConstructorType_1 = EcsResult<T_1>>(spec: T_1, componentId: number, constructorDefault?: ConstructorType_1 | undefined) => ComponentDefinition<T_1, ConstructorType_1>;
2270
2425
  getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...ReadonlyComponentSchema<T_2>]>;
@@ -2442,6 +2597,29 @@ declare namespace Quaternion {
2442
2597
  */
2443
2598
  declare const RAD2DEG: number;
2444
2599
 
2600
+ /** @public */
2601
+ declare const Raycast: ComponentDefinition<ISchema<PBRaycast>, PBRaycast>;
2602
+
2603
+ /** Position will be relative to the scene */
2604
+ declare interface RaycastHit {
2605
+ position: Vector3_2 | undefined;
2606
+ origin: Vector3_2 | undefined;
2607
+ direction: Vector3_2 | undefined;
2608
+ normalHit: Vector3_2 | undefined;
2609
+ length: number;
2610
+ meshName?: string | undefined;
2611
+ entityId?: number | undefined;
2612
+ }
2613
+
2614
+ declare const enum RaycastQueryType {
2615
+ HIT_FIRST = 0,
2616
+ QUERY_ALL = 1,
2617
+ UNRECOGNIZED = -1
2618
+ }
2619
+
2620
+ /** @public */
2621
+ declare const RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
2622
+
2445
2623
  /**
2446
2624
  * @public
2447
2625
  */
@@ -2519,6 +2697,11 @@ declare interface Spec {
2519
2697
  /** @public */
2520
2698
  declare const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
2521
2699
 
2700
+ /**
2701
+ * @public
2702
+ */
2703
+ declare type SystemFn = (dt: number) => void;
2704
+
2522
2705
  /** @public */
2523
2706
  declare const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
2524
2707
 
@@ -2593,15 +2776,13 @@ declare type Uint32 = number;
2593
2776
  /** @public */
2594
2777
  declare const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
2595
2778
 
2596
- /**
2597
- * @public
2598
- */
2599
- declare type Unpacked<T> = T extends (infer U)[] ? U : T;
2779
+ /** @public */
2780
+ declare const UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
2600
2781
 
2601
2782
  /**
2602
2783
  * @public
2603
2784
  */
2604
- declare type Update = (dt: number) => void;
2785
+ declare type Unpacked<T> = T extends (infer U)[] ? U : T;
2605
2786
 
2606
2787
  /**
2607
2788
  * @public
@@ -2815,6 +2996,16 @@ declare interface Vector3_2 {
2815
2996
  /** @public */
2816
2997
  declare const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
2817
2998
 
2999
+ /**
3000
+ * Check if an entity emitted a clicked event
3001
+ * @param entity the entity to query, for global clicks use `engine.RootEntity`
3002
+ * @param actionButton
3003
+ * @returns true if the entity was clicked in the last tick-update
3004
+ */
3005
+ declare function wasEntityClicked(entity: Entity, actionButton: ActionButton): boolean;
3006
+
3007
+ declare function wasEntityClickedGenerator(engine: IEngine): (entity: Entity, actionButton: ActionButton) => boolean;
3008
+
2818
3009
  declare namespace WireMessage {
2819
3010
  enum Enum {
2820
3011
  RESERVED = 0,
@@ -2839,4 +3030,76 @@ declare namespace WireMessage {
2839
3030
  function readHeader(buf: ByteBuffer): Header | null;
2840
3031
  }
2841
3032
 
3033
+ declare const enum YGAlign {
3034
+ YGAlignAuto = 0,
3035
+ YGAlignFlexStart = 1,
3036
+ YGAlignCenter = 2,
3037
+ YGAlignFlexEnd = 3,
3038
+ YGAlignStretch = 4,
3039
+ YGAlignBaseline = 5,
3040
+ YGAlignSpaceBetween = 6,
3041
+ YGAlignSpaceAround = 7,
3042
+ UNRECOGNIZED = -1
3043
+ }
3044
+
3045
+ declare const enum YGDirection {
3046
+ YGDirectionInherit = 0,
3047
+ YGDirectionLTR = 1,
3048
+ YGDirectionRTL = 2,
3049
+ UNRECOGNIZED = -1
3050
+ }
3051
+
3052
+ declare const enum YGDisplay {
3053
+ YGDisplayFlex = 0,
3054
+ YGDisplayNone = 1,
3055
+ UNRECOGNIZED = -1
3056
+ }
3057
+
3058
+ declare const enum YGFlexDirection {
3059
+ YGFlexDirectionColumn = 0,
3060
+ YGFlexDirectionColumnReverse = 1,
3061
+ YGFlexDirectionRow = 2,
3062
+ YGFlexDirectionRowReverse = 3,
3063
+ UNRECOGNIZED = -1
3064
+ }
3065
+
3066
+ declare const enum YGJustify {
3067
+ YGJustifyFlexStart = 0,
3068
+ YGJustifyCenter = 1,
3069
+ YGJustifyFlexEnd = 2,
3070
+ YGJustifySpaceBetween = 3,
3071
+ YGJustifySpaceAround = 4,
3072
+ YGJustifySpaceEvenly = 5,
3073
+ UNRECOGNIZED = -1
3074
+ }
3075
+
3076
+ declare const enum YGOverflow {
3077
+ YGOverflowVisible = 0,
3078
+ YGOverflowHidden = 1,
3079
+ YGOverflowScroll = 2,
3080
+ UNRECOGNIZED = -1
3081
+ }
3082
+
3083
+ declare const enum YGPositionType {
3084
+ YGPositionTypeStatic = 0,
3085
+ YGPositionTypeRelative = 1,
3086
+ YGPositionTypeAbsolute = 2,
3087
+ UNRECOGNIZED = -1
3088
+ }
3089
+
3090
+ declare const enum YGUnit {
3091
+ YGUnitUndefined = 0,
3092
+ YGUnitPoint = 1,
3093
+ YGUnitPercent = 2,
3094
+ YGUnitAuto = 3,
3095
+ UNRECOGNIZED = -1
3096
+ }
3097
+
3098
+ declare const enum YGWrap {
3099
+ YGWrapNoWrap = 0,
3100
+ YGWrapWrap = 1,
3101
+ YGWrapWrapReverse = 2,
3102
+ UNRECOGNIZED = -1
3103
+ }
3104
+
2842
3105
 
@@ -16,6 +16,8 @@
16
16
  "useDefineForClassFields": false,
17
17
  "preserveConstEnums": true,
18
18
  "allowJs": true,
19
+ "jsx": "react",
20
+ "jsxFactory": "ReactEcs.createElement",
19
21
  "lib": [
20
22
  "ES2020"
21
23
  ],