@dcl/sdk 7.0.0-3015711272.commit-6716e5a → 7.0.0-3040253589.commit-8782388

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.
@@ -253,6 +253,8 @@ export declare namespace Components {
253
253
  /** @public */
254
254
  const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
255
255
  /** @public */
256
+ const Raycast: ComponentDefinition<ISchema<PBRaycast>, PBRaycast>;
257
+ /** @public */
256
258
  const RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
257
259
  /** @public */
258
260
  const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
@@ -261,6 +263,8 @@ export declare namespace Components {
261
263
  /** @public */
262
264
  const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
263
265
  /** @public */
266
+ const UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
267
+ /** @public */
264
268
  const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
265
269
  }
266
270
 
@@ -489,10 +493,12 @@ declare function defineSdkComponents(engine: PreEngine): {
489
493
  PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
490
494
  PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
491
495
  PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
496
+ Raycast: ComponentDefinition<ISchema<PBRaycast>, PBRaycast>;
492
497
  RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
493
498
  SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
494
499
  TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
495
500
  UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
501
+ UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
496
502
  VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
497
503
  };
498
504
 
@@ -552,6 +558,12 @@ export declare type float = number;
552
558
  /** @public */
553
559
  export declare type FloatArray = number[];
554
560
 
561
+ declare const enum Font {
562
+ LiberationSans = 0,
563
+ SansSerif = 1,
564
+ UNRECOGNIZED = -1
565
+ }
566
+
555
567
  /** @public */
556
568
  export declare const GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>, PBGLTFShape>;
557
569
 
@@ -596,13 +608,13 @@ export declare type IEngine = {
596
608
  * engine.addSystem(mySystem, 10)
597
609
  * ```
598
610
  */
599
- addSystem(system: Update, priority?: number, name?: string): void;
611
+ addSystem(system: SystemFn, priority?: number, name?: string): void;
600
612
  /**
601
613
  * Remove a system from the engine.
602
614
  * @param selector the function or the unique name to identify
603
615
  * @returns if it was found and removed
604
616
  */
605
- removeSystem(selector: string | Update): boolean;
617
+ removeSystem(selector: string | SystemFn): boolean;
606
618
  /**
607
619
  * Define a component and add it to the engine.
608
620
  * @param spec An object with schema fields
@@ -2135,6 +2147,14 @@ declare interface PBPointerLock {
2135
2147
  isPointerLocked: boolean;
2136
2148
  }
2137
2149
 
2150
+ declare interface PBRaycast {
2151
+ timestamp: number;
2152
+ origin: Vector3_2 | undefined;
2153
+ direction: Vector3_2 | undefined;
2154
+ maxDistance: number;
2155
+ queryType: RaycastQueryType;
2156
+ }
2157
+
2138
2158
  declare interface PBRaycastResult {
2139
2159
  timestamp: number;
2140
2160
  origin: Vector3_2 | undefined;
@@ -2189,8 +2209,76 @@ declare interface PBTextShape {
2189
2209
  }
2190
2210
 
2191
2211
  declare interface PBUiText {
2192
- text: string;
2193
- textColor: Color3 | undefined;
2212
+ value: string;
2213
+ /** default=(1.0,1.0,1.0) */
2214
+ color?: Color3 | undefined;
2215
+ /** default='center' */
2216
+ textAlign?: TextAlign | undefined;
2217
+ /** default=0 */
2218
+ font?: Font | undefined;
2219
+ /** default=10 */
2220
+ fontSize?: number | undefined;
2221
+ }
2222
+
2223
+ declare interface PBUiTransform {
2224
+ parent: number;
2225
+ rightOf: number;
2226
+ positionType: YGPositionType;
2227
+ alignContent: YGAlign;
2228
+ alignItems: YGAlign;
2229
+ alignSelf: YGAlign;
2230
+ flexDirection: YGFlexDirection;
2231
+ flexWrap: YGWrap;
2232
+ justifyContent: YGJustify;
2233
+ overflow: YGOverflow;
2234
+ display: YGDisplay;
2235
+ direction: YGDirection;
2236
+ flex: number;
2237
+ flexBasisUnit: YGUnit;
2238
+ flexBasis: number;
2239
+ flexGrow: number;
2240
+ flexShrink: number;
2241
+ widthUnit: YGUnit;
2242
+ width: number;
2243
+ heightUnit: YGUnit;
2244
+ height: number;
2245
+ minWidthUnit: YGUnit;
2246
+ minWidth: number;
2247
+ minHeightUnit: YGUnit;
2248
+ minHeight: number;
2249
+ maxWidthUnit: YGUnit;
2250
+ maxWidth: number;
2251
+ maxHeightUnit: YGUnit;
2252
+ maxHeight: number;
2253
+ positionLeftUnit: YGUnit;
2254
+ positionLeft: number;
2255
+ positionTopUnit: YGUnit;
2256
+ positionTop: number;
2257
+ positionRightUnit: YGUnit;
2258
+ positionRight: number;
2259
+ positionBottomUnit: YGUnit;
2260
+ positionBottom: number;
2261
+ /** margin */
2262
+ marginLeftUnit: YGUnit;
2263
+ marginLeft: number;
2264
+ marginTopUnit: YGUnit;
2265
+ marginTop: number;
2266
+ marginRightUnit: YGUnit;
2267
+ marginRight: number;
2268
+ marginBottomUnit: YGUnit;
2269
+ marginBottom: number;
2270
+ paddingLeftUnit: YGUnit;
2271
+ paddingLeft: number;
2272
+ paddingTopUnit: YGUnit;
2273
+ paddingTop: number;
2274
+ paddingRightUnit: YGUnit;
2275
+ paddingRight: number;
2276
+ paddingBottomUnit: YGUnit;
2277
+ paddingBottom: number;
2278
+ borderLeft: number;
2279
+ borderTop: number;
2280
+ borderRight: number;
2281
+ borderBottom: number;
2194
2282
  }
2195
2283
 
2196
2284
  declare interface PBVisibilityComponent {
@@ -2338,13 +2426,13 @@ declare function preEngine(): {
2338
2426
  addEntity: (dynamic?: boolean) => Entity;
2339
2427
  addDynamicEntity: () => Entity;
2340
2428
  removeEntity: (entity: Entity) => boolean;
2341
- addSystem: (fn: Update, priority?: number, name?: string | undefined) => void;
2429
+ addSystem: (fn: SystemFn, priority?: number, name?: string | undefined) => void;
2342
2430
  getSystems: () => {
2343
- fn: Update;
2431
+ fn: SystemFn;
2344
2432
  priority: number;
2345
2433
  name?: string | undefined;
2346
2434
  }[];
2347
- removeSystem: (selector: string | Update) => boolean;
2435
+ removeSystem: (selector: string | SystemFn) => boolean;
2348
2436
  defineComponent: <T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType | undefined) => ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
2349
2437
  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
2438
  getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...ReadonlyComponentSchema<T_2>]>;
@@ -2522,6 +2610,9 @@ export declare namespace Quaternion {
2522
2610
  */
2523
2611
  export declare const RAD2DEG: number;
2524
2612
 
2613
+ /** @public */
2614
+ export declare const Raycast: ComponentDefinition<ISchema<PBRaycast>, PBRaycast>;
2615
+
2525
2616
  /** Position will be relative to the scene */
2526
2617
  declare interface RaycastHit {
2527
2618
  position: Vector3_2 | undefined;
@@ -2533,6 +2624,12 @@ declare interface RaycastHit {
2533
2624
  entityId?: number | undefined;
2534
2625
  }
2535
2626
 
2627
+ declare const enum RaycastQueryType {
2628
+ HIT_FIRST = 0,
2629
+ QUERY_ALL = 1,
2630
+ UNRECOGNIZED = -1
2631
+ }
2632
+
2536
2633
  /** @public */
2537
2634
  export declare const RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
2538
2635
 
@@ -2613,6 +2710,18 @@ export declare interface Spec {
2613
2710
  /** @public */
2614
2711
  export declare const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
2615
2712
 
2713
+ /**
2714
+ * @public
2715
+ */
2716
+ export declare type SystemFn = (dt: number) => void;
2717
+
2718
+ declare const enum TextAlign {
2719
+ Center = 0,
2720
+ Left = 1,
2721
+ Right = 2,
2722
+ UNRECOGNIZED = -1
2723
+ }
2724
+
2616
2725
  /** @public */
2617
2726
  export declare const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
2618
2727
 
@@ -2687,15 +2796,13 @@ declare type Uint32 = number;
2687
2796
  /** @public */
2688
2797
  export declare const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
2689
2798
 
2690
- /**
2691
- * @public
2692
- */
2693
- export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
2799
+ /** @public */
2800
+ export declare const UiTransform: ComponentDefinition<ISchema<PBUiTransform>, PBUiTransform>;
2694
2801
 
2695
2802
  /**
2696
2803
  * @public
2697
2804
  */
2698
- export declare type Update = (dt: number) => void;
2805
+ export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
2699
2806
 
2700
2807
  /**
2701
2808
  * @public
@@ -2943,4 +3050,76 @@ declare namespace WireMessage {
2943
3050
  function readHeader(buf: ByteBuffer): Header | null;
2944
3051
  }
2945
3052
 
3053
+ declare const enum YGAlign {
3054
+ YGAlignAuto = 0,
3055
+ YGAlignFlexStart = 1,
3056
+ YGAlignCenter = 2,
3057
+ YGAlignFlexEnd = 3,
3058
+ YGAlignStretch = 4,
3059
+ YGAlignBaseline = 5,
3060
+ YGAlignSpaceBetween = 6,
3061
+ YGAlignSpaceAround = 7,
3062
+ UNRECOGNIZED = -1
3063
+ }
3064
+
3065
+ declare const enum YGDirection {
3066
+ YGDirectionInherit = 0,
3067
+ YGDirectionLTR = 1,
3068
+ YGDirectionRTL = 2,
3069
+ UNRECOGNIZED = -1
3070
+ }
3071
+
3072
+ declare const enum YGDisplay {
3073
+ YGDisplayFlex = 0,
3074
+ YGDisplayNone = 1,
3075
+ UNRECOGNIZED = -1
3076
+ }
3077
+
3078
+ declare const enum YGFlexDirection {
3079
+ YGFlexDirectionColumn = 0,
3080
+ YGFlexDirectionColumnReverse = 1,
3081
+ YGFlexDirectionRow = 2,
3082
+ YGFlexDirectionRowReverse = 3,
3083
+ UNRECOGNIZED = -1
3084
+ }
3085
+
3086
+ declare const enum YGJustify {
3087
+ YGJustifyFlexStart = 0,
3088
+ YGJustifyCenter = 1,
3089
+ YGJustifyFlexEnd = 2,
3090
+ YGJustifySpaceBetween = 3,
3091
+ YGJustifySpaceAround = 4,
3092
+ YGJustifySpaceEvenly = 5,
3093
+ UNRECOGNIZED = -1
3094
+ }
3095
+
3096
+ declare const enum YGOverflow {
3097
+ YGOverflowVisible = 0,
3098
+ YGOverflowHidden = 1,
3099
+ YGOverflowScroll = 2,
3100
+ UNRECOGNIZED = -1
3101
+ }
3102
+
3103
+ declare const enum YGPositionType {
3104
+ YGPositionTypeStatic = 0,
3105
+ YGPositionTypeRelative = 1,
3106
+ YGPositionTypeAbsolute = 2,
3107
+ UNRECOGNIZED = -1
3108
+ }
3109
+
3110
+ declare const enum YGUnit {
3111
+ YGUnitUndefined = 0,
3112
+ YGUnitPoint = 1,
3113
+ YGUnitPercent = 2,
3114
+ YGUnitAuto = 3,
3115
+ UNRECOGNIZED = -1
3116
+ }
3117
+
3118
+ declare const enum YGWrap {
3119
+ YGWrapNoWrap = 0,
3120
+ YGWrapWrap = 1,
3121
+ YGWrapWrapReverse = 2,
3122
+ UNRECOGNIZED = -1
3123
+ }
3124
+
2946
3125
  export { }