@dcl/sdk 7.0.0-3015711272.commit-6716e5a → 7.0.0-3038080345.commit-de046a3

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
@@ -261,6 +261,8 @@ declare namespace Components {
261
261
  /** @public */
262
262
  const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
263
263
  /** @public */
264
+ const UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
265
+ /** @public */
264
266
  const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
265
267
  }
266
268
 
@@ -493,6 +495,7 @@ declare function defineSdkComponents(engine: PreEngine): {
493
495
  SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
494
496
  TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
495
497
  UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
498
+ UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
496
499
  VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
497
500
  };
498
501
 
@@ -596,13 +599,13 @@ declare type IEngine = {
596
599
  * engine.addSystem(mySystem, 10)
597
600
  * ```
598
601
  */
599
- addSystem(system: Update, priority?: number, name?: string): void;
602
+ addSystem(system: SystemFn, priority?: number, name?: string): void;
600
603
  /**
601
604
  * Remove a system from the engine.
602
605
  * @param selector the function or the unique name to identify
603
606
  * @returns if it was found and removed
604
607
  */
605
- removeSystem(selector: string | Update): boolean;
608
+ removeSystem(selector: string | SystemFn): boolean;
606
609
  /**
607
610
  * Define a component and add it to the engine.
608
611
  * @param spec An object with schema fields
@@ -2193,6 +2196,67 @@ declare interface PBUiText {
2193
2196
  textColor: Color3 | undefined;
2194
2197
  }
2195
2198
 
2199
+ declare interface PBUiTransform {
2200
+ parent: number;
2201
+ rightOf: number;
2202
+ positionType: YGPositionType;
2203
+ alignContent: YGAlign;
2204
+ alignItems: YGAlign;
2205
+ alignSelf: YGAlign;
2206
+ flexDirection: YGFlexDirection;
2207
+ flexWrap: YGWrap;
2208
+ justifyContent: YGJustify;
2209
+ overflow: YGOverflow;
2210
+ display: YGDisplay;
2211
+ direction: YGDirection;
2212
+ flex: number;
2213
+ flexBasisUnit: YGUnit;
2214
+ flexBasis: number;
2215
+ flexGrow: number;
2216
+ flexShrink: number;
2217
+ widthUnit: YGUnit;
2218
+ width: number;
2219
+ heightUnit: YGUnit;
2220
+ height: number;
2221
+ minWidthUnit: YGUnit;
2222
+ minWidth: number;
2223
+ minHeightUnit: YGUnit;
2224
+ minHeight: number;
2225
+ maxWidthUnit: YGUnit;
2226
+ maxWidth: number;
2227
+ maxHeightUnit: YGUnit;
2228
+ maxHeight: number;
2229
+ positionLeftUnit: YGUnit;
2230
+ positionLeft: number;
2231
+ positionTopUnit: YGUnit;
2232
+ positionTop: number;
2233
+ positionRightUnit: YGUnit;
2234
+ positionRight: number;
2235
+ positionBottomUnit: YGUnit;
2236
+ positionBottom: number;
2237
+ /** margin */
2238
+ marginLeftUnit: YGUnit;
2239
+ marginLeft: number;
2240
+ marginTopUnit: YGUnit;
2241
+ marginTop: number;
2242
+ marginRightUnit: YGUnit;
2243
+ marginRight: number;
2244
+ marginBottomUnit: YGUnit;
2245
+ marginBottom: number;
2246
+ paddingLeftUnit: YGUnit;
2247
+ paddingLeft: number;
2248
+ paddingTopUnit: YGUnit;
2249
+ paddingTop: number;
2250
+ paddingRightUnit: YGUnit;
2251
+ paddingRight: number;
2252
+ paddingBottomUnit: YGUnit;
2253
+ paddingBottom: number;
2254
+ borderLeft: number;
2255
+ borderTop: number;
2256
+ borderRight: number;
2257
+ borderBottom: number;
2258
+ }
2259
+
2196
2260
  declare interface PBVisibilityComponent {
2197
2261
  /** default=true */
2198
2262
  visible?: boolean | undefined;
@@ -2338,13 +2402,13 @@ declare function preEngine(): {
2338
2402
  addEntity: (dynamic?: boolean) => Entity;
2339
2403
  addDynamicEntity: () => Entity;
2340
2404
  removeEntity: (entity: Entity) => boolean;
2341
- addSystem: (fn: Update, priority?: number, name?: string | undefined) => void;
2405
+ addSystem: (fn: SystemFn, priority?: number, name?: string | undefined) => void;
2342
2406
  getSystems: () => {
2343
- fn: Update;
2407
+ fn: SystemFn;
2344
2408
  priority: number;
2345
2409
  name?: string | undefined;
2346
2410
  }[];
2347
- removeSystem: (selector: string | Update) => boolean;
2411
+ removeSystem: (selector: string | SystemFn) => boolean;
2348
2412
  defineComponent: <T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType | undefined) => ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
2349
2413
  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>;
2350
2414
  getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...ReadonlyComponentSchema<T_2>]>;
@@ -2613,6 +2677,11 @@ declare interface Spec {
2613
2677
  /** @public */
2614
2678
  declare const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
2615
2679
 
2680
+ /**
2681
+ * @public
2682
+ */
2683
+ declare type SystemFn = (dt: number) => void;
2684
+
2616
2685
  /** @public */
2617
2686
  declare const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
2618
2687
 
@@ -2687,15 +2756,13 @@ declare type Uint32 = number;
2687
2756
  /** @public */
2688
2757
  declare const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
2689
2758
 
2690
- /**
2691
- * @public
2692
- */
2693
- declare type Unpacked<T> = T extends (infer U)[] ? U : T;
2759
+ /** @public */
2760
+ declare const UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
2694
2761
 
2695
2762
  /**
2696
2763
  * @public
2697
2764
  */
2698
- declare type Update = (dt: number) => void;
2765
+ declare type Unpacked<T> = T extends (infer U)[] ? U : T;
2699
2766
 
2700
2767
  /**
2701
2768
  * @public
@@ -2943,4 +3010,76 @@ declare namespace WireMessage {
2943
3010
  function readHeader(buf: ByteBuffer): Header | null;
2944
3011
  }
2945
3012
 
3013
+ declare const enum YGAlign {
3014
+ YGAlignAuto = 0,
3015
+ YGAlignFlexStart = 1,
3016
+ YGAlignCenter = 2,
3017
+ YGAlignFlexEnd = 3,
3018
+ YGAlignStretch = 4,
3019
+ YGAlignBaseline = 5,
3020
+ YGAlignSpaceBetween = 6,
3021
+ YGAlignSpaceAround = 7,
3022
+ UNRECOGNIZED = -1
3023
+ }
3024
+
3025
+ declare const enum YGDirection {
3026
+ YGDirectionInherit = 0,
3027
+ YGDirectionLTR = 1,
3028
+ YGDirectionRTL = 2,
3029
+ UNRECOGNIZED = -1
3030
+ }
3031
+
3032
+ declare const enum YGDisplay {
3033
+ YGDisplayFlex = 0,
3034
+ YGDisplayNone = 1,
3035
+ UNRECOGNIZED = -1
3036
+ }
3037
+
3038
+ declare const enum YGFlexDirection {
3039
+ YGFlexDirectionColumn = 0,
3040
+ YGFlexDirectionColumnReverse = 1,
3041
+ YGFlexDirectionRow = 2,
3042
+ YGFlexDirectionRowReverse = 3,
3043
+ UNRECOGNIZED = -1
3044
+ }
3045
+
3046
+ declare const enum YGJustify {
3047
+ YGJustifyFlexStart = 0,
3048
+ YGJustifyCenter = 1,
3049
+ YGJustifyFlexEnd = 2,
3050
+ YGJustifySpaceBetween = 3,
3051
+ YGJustifySpaceAround = 4,
3052
+ YGJustifySpaceEvenly = 5,
3053
+ UNRECOGNIZED = -1
3054
+ }
3055
+
3056
+ declare const enum YGOverflow {
3057
+ YGOverflowVisible = 0,
3058
+ YGOverflowHidden = 1,
3059
+ YGOverflowScroll = 2,
3060
+ UNRECOGNIZED = -1
3061
+ }
3062
+
3063
+ declare const enum YGPositionType {
3064
+ YGPositionTypeStatic = 0,
3065
+ YGPositionTypeRelative = 1,
3066
+ YGPositionTypeAbsolute = 2,
3067
+ UNRECOGNIZED = -1
3068
+ }
3069
+
3070
+ declare const enum YGUnit {
3071
+ YGUnitUndefined = 0,
3072
+ YGUnitPoint = 1,
3073
+ YGUnitPercent = 2,
3074
+ YGUnitAuto = 3,
3075
+ UNRECOGNIZED = -1
3076
+ }
3077
+
3078
+ declare const enum YGWrap {
3079
+ YGWrapNoWrap = 0,
3080
+ YGWrapWrap = 1,
3081
+ YGWrapWrapReverse = 2,
3082
+ UNRECOGNIZED = -1
3083
+ }
3084
+
2946
3085
 
@@ -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
  ],