@mappedin/blue-dot 6.9.1-beta.0 → 6.10.0-beta.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.
@@ -1,6 +1,6 @@
1
1
  import { Coordinate, Floor, MapView, Model } from "@mappedin/mappedin-js";
2
2
 
3
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/primitive.d.ts
3
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/primitive.d.ts
4
4
 
5
5
  /**
6
6
  Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
@@ -9,27 +9,81 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
9
9
  */
10
10
  type Primitive = null | undefined | string | number | boolean | symbol | bigint;
11
11
  //#endregion
12
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/observable-like.d.ts
13
- declare global {
14
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
15
- interface SymbolConstructor {
16
- readonly observable: symbol;
17
- }
12
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/is-any.d.ts
13
+ /**
14
+ Returns a boolean for whether the given type is `any`.
15
+
16
+ @link https://stackoverflow.com/a/49928360/1490091
17
+
18
+ Useful in type utilities, such as disallowing `any`s to be passed to a function.
19
+
20
+ @example
21
+ ```
22
+ import type {IsAny} from 'type-fest';
23
+
24
+ const typedObject = {a: 1, b: 2} as const;
25
+ const anyObject: any = {a: 1, b: 2};
26
+
27
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
28
+ return obj[key];
18
29
  }
19
30
 
20
- /**
21
- @remarks
22
- The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
23
- As well, some guidance on making an `Observable` to not include `closed` property.
24
- @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
25
- @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
26
- @see https://github.com/benlesh/symbol-observable#making-an-object-observable
27
-
28
- @category Observable
31
+ const typedA = get(typedObject, 'a');
32
+ //=> 1
33
+
34
+ const anyA = get(anyObject, 'a');
35
+ //=> any
36
+ ```
37
+
38
+ @category Type Guard
39
+ @category Utilities
29
40
  */
41
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
42
+ //#endregion
43
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/is-optional-key-of.d.ts
44
+ /**
45
+ Returns a boolean for whether the given key is an optional key of type.
46
+
47
+ This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
48
+
49
+ @example
50
+ ```
51
+ import type {IsOptionalKeyOf} from 'type-fest';
52
+
53
+ interface User {
54
+ name: string;
55
+ surname: string;
56
+
57
+ luckyNumber?: number;
58
+ }
59
+
60
+ interface Admin {
61
+ name: string;
62
+ surname?: string;
63
+ }
64
+
65
+ type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
66
+ //=> true
30
67
 
68
+ type T2 = IsOptionalKeyOf<User, 'name'>;
69
+ //=> false
70
+
71
+ type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
72
+ //=> boolean
73
+
74
+ type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
75
+ //=> false
76
+
77
+ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
78
+ //=> boolean
79
+ ```
80
+
81
+ @category Type Guard
82
+ @category Utilities
83
+ */
84
+ type IsOptionalKeyOf<Type extends object, Key$1 extends keyof Type> = IsAny<Type | Key$1> extends true ? never : Key$1 extends keyof Type ? Type extends Record<Key$1, Type[Key$1]> ? false : true : false;
31
85
  //#endregion
32
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/optional-keys-of.d.ts
86
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/optional-keys-of.d.ts
33
87
  /**
34
88
  Extract all optional keys from the given type.
35
89
 
@@ -63,11 +117,11 @@ const update2: UpdateOperation<User> = {
63
117
 
64
118
  @category Utilities
65
119
  */
66
- type OptionalKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
67
- ? (keyof { [Key in keyof BaseType as BaseType extends Record<Key, BaseType[Key]> ? never : Key]: never }) & (keyof BaseType) // Intersect with `keyof BaseType` to ensure result of `OptionalKeysOf<BaseType>` is always assignable to `keyof BaseType`
120
+ type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
121
+ ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
68
122
  : never;
69
123
  //#endregion
70
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/required-keys-of.d.ts
124
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/required-keys-of.d.ts
71
125
  /**
72
126
  Extract all required keys from the given type.
73
127
 
@@ -92,10 +146,10 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
92
146
 
93
147
  @category Utilities
94
148
  */
95
- type RequiredKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
96
- ? Exclude<keyof BaseType, OptionalKeysOf<BaseType>> : never;
149
+ type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
150
+ ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
97
151
  //#endregion
98
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-never.d.ts
152
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/is-never.d.ts
99
153
  /**
100
154
  Returns a boolean for whether the given type is `never`.
101
155
 
@@ -139,64 +193,120 @@ endIfEqual('abc', '123');
139
193
  */
140
194
  type IsNever<T> = [T] extends [never] ? true : false;
141
195
  //#endregion
142
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/if-never.d.ts
196
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/if.d.ts
143
197
  /**
144
- An if-else-like type that resolves depending on whether the given type is `never`.
198
+ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
199
+
200
+ Use-cases:
201
+ - You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
145
202
 
146
- @see {@link IsNever}
203
+ Note:
204
+ - Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
205
+ - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
147
206
 
148
207
  @example
149
208
  ```
150
- import type {IfNever} from 'type-fest';
209
+ import {If} from 'type-fest';
151
210
 
152
- type ShouldBeTrue = IfNever<never>;
153
- //=> true
211
+ type A = If<true, 'yes', 'no'>;
212
+ //=> 'yes'
154
213
 
155
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
156
- //=> 'bar'
157
- ```
214
+ type B = If<false, 'yes', 'no'>;
215
+ //=> 'no'
158
216
 
159
- @category Type Guard
160
- @category Utilities
161
- */
162
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (IsNever<T> extends true ? TypeIfNever : TypeIfNotNever);
163
- //#endregion
164
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-any.d.ts
165
- // Can eventually be replaced with the built-in once this library supports
166
- // TS5.4+ only. Tracked in https://github.com/sindresorhus/type-fest/issues/848
167
- type NoInfer<T> = T extends infer U ? U : never;
217
+ type C = If<boolean, 'yes', 'no'>;
218
+ //=> 'yes' | 'no'
168
219
 
169
- /**
170
- Returns a boolean for whether the given type is `any`.
220
+ type D = If<any, 'yes', 'no'>;
221
+ //=> 'yes' | 'no'
171
222
 
172
- @link https://stackoverflow.com/a/49928360/1490091
223
+ type E = If<never, 'yes', 'no'>;
224
+ //=> 'no'
225
+ ```
173
226
 
174
- Useful in type utilities, such as disallowing `any`s to be passed to a function.
227
+ @example
228
+ ```
229
+ import {If, IsAny, IsNever} from 'type-fest';
230
+
231
+ type A = If<IsAny<unknown>, 'is any', 'not any'>;
232
+ //=> 'not any'
233
+
234
+ type B = If<IsNever<never>, 'is never', 'not never'>;
235
+ //=> 'is never'
236
+ ```
175
237
 
176
238
  @example
177
239
  ```
178
- import type {IsAny} from 'type-fest';
240
+ import {If, IsEqual} from 'type-fest';
179
241
 
180
- const typedObject = {a: 1, b: 2} as const;
181
- const anyObject: any = {a: 1, b: 2};
242
+ type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
182
243
 
183
- function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
184
- return obj[key];
185
- }
244
+ type A = IfEqual<string, string, 'equal', 'not equal'>;
245
+ //=> 'equal'
186
246
 
187
- const typedA = get(typedObject, 'a');
188
- //=> 1
247
+ type B = IfEqual<string, number, 'equal', 'not equal'>;
248
+ //=> 'not equal'
249
+ ```
189
250
 
190
- const anyA = get(anyObject, 'a');
191
- //=> any
251
+ Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
252
+
253
+ @example
254
+ ```
255
+ import type {If, IsEqual, StringRepeat} from 'type-fest';
256
+
257
+ type HundredZeroes = StringRepeat<'0', 100>;
258
+
259
+ // The following implementation is not tail recursive
260
+ type Includes<S extends string, Char extends string> =
261
+ S extends `${infer First}${infer Rest}`
262
+ ? If<IsEqual<First, Char>,
263
+ 'found',
264
+ Includes<Rest, Char>>
265
+ : 'not found';
266
+
267
+ // Hence, instantiations with long strings will fail
268
+ // @ts-expect-error
269
+ type Fails = Includes<HundredZeroes, '1'>;
270
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
271
+ // Error: Type instantiation is excessively deep and possibly infinite.
272
+
273
+ // However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
274
+ type IncludesWithoutIf<S extends string, Char extends string> =
275
+ S extends `${infer First}${infer Rest}`
276
+ ? IsEqual<First, Char> extends true
277
+ ? 'found'
278
+ : IncludesWithoutIf<Rest, Char>
279
+ : 'not found';
280
+
281
+ // Now, instantiations with long strings will work
282
+ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
283
+ //=> 'not found'
192
284
  ```
193
285
 
194
286
  @category Type Guard
195
287
  @category Utilities
196
288
  */
197
- type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
289
+ type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
290
+ //#endregion
291
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/internal/type.d.ts
292
+ /**
293
+ Matches any primitive, `void`, `Date`, or `RegExp` value.
294
+ */
295
+ type BuiltIns = Primitive | void | Date | RegExp;
296
+ /**
297
+ Test if the given function has multiple call signatures.
298
+
299
+ Needed to handle the case of a single call signature with properties.
300
+
301
+ Multiple call signatures cannot currently be supported due to a TypeScript limitation.
302
+ @see https://github.com/microsoft/TypeScript/issues/29732
303
+ */
304
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
305
+ (...arguments_: infer A): unknown;
306
+ (...arguments_: infer B): unknown;
307
+ } ? B extends A ? A extends B ? false : true : true : false;
198
308
  //#endregion
199
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/simplify.d.ts
309
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/simplify.d.ts
200
310
  /**
201
311
  Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
202
312
 
@@ -251,12 +361,12 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
251
361
  ```
252
362
 
253
363
  @link https://github.com/microsoft/TypeScript/issues/15300
254
- @see SimplifyDeep
364
+ @see {@link SimplifyDeep}
255
365
  @category Object
256
366
  */
257
367
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
258
368
  //#endregion
259
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/omit-index-signature.d.ts
369
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/omit-index-signature.d.ts
260
370
  /**
261
371
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
262
372
 
@@ -344,12 +454,12 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
344
454
  // => { foo: 'bar'; qux?: 'baz' | undefined; }
345
455
  ```
346
456
 
347
- @see PickIndexSignature
457
+ @see {@link PickIndexSignature}
348
458
  @category Object
349
459
  */
350
460
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
351
461
  //#endregion
352
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/pick-index-signature.d.ts
462
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/pick-index-signature.d.ts
353
463
  /**
354
464
  Pick only index signatures from the given object type, leaving out all explicitly defined properties.
355
465
 
@@ -392,12 +502,12 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
392
502
  // }
393
503
  ```
394
504
 
395
- @see OmitIndexSignature
505
+ @see {@link OmitIndexSignature}
396
506
  @category Object
397
507
  */
398
508
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
399
509
  //#endregion
400
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/merge.d.ts
510
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/merge.d.ts
401
511
  // Merges two objects without worrying about index signatures.
402
512
  type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
403
513
 
@@ -437,47 +547,7 @@ export type FooBar = Merge<Foo, Bar>;
437
547
  */
438
548
  type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
439
549
  //#endregion
440
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/if-any.d.ts
441
- /**
442
- An if-else-like type that resolves depending on whether the given type is `any`.
443
-
444
- @see {@link IsAny}
445
-
446
- @example
447
- ```
448
- import type {IfAny} from 'type-fest';
449
-
450
- type ShouldBeTrue = IfAny<any>;
451
- //=> true
452
-
453
- type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
454
- //=> 'bar'
455
- ```
456
-
457
- @category Type Guard
458
- @category Utilities
459
- */
460
- type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny<T> extends true ? TypeIfAny : TypeIfNotAny);
461
- //#endregion
462
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/internal/type.d.ts
463
- /**
464
- Matches any primitive, `void`, `Date`, or `RegExp` value.
465
- */
466
- type BuiltIns = Primitive | void | Date | RegExp;
467
- /**
468
- Test if the given function has multiple call signatures.
469
-
470
- Needed to handle the case of a single call signature with properties.
471
-
472
- Multiple call signatures cannot currently be supported due to a TypeScript limitation.
473
- @see https://github.com/microsoft/TypeScript/issues/29732
474
- */
475
- type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
476
- (...arguments_: infer A): unknown;
477
- (...arguments_: infer B): unknown;
478
- } ? B extends A ? A extends B ? false : true : true : false;
479
- //#endregion
480
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/internal/object.d.ts
550
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/internal/object.d.ts
481
551
 
482
552
  /**
483
553
  Merges user specified options with default options.
@@ -531,10 +601,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
531
601
  // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
532
602
  ```
533
603
  */
534
- type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = IfAny<SpecifiedOptions, Defaults, IfNever<SpecifiedOptions, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? Extract<SpecifiedOptions[Key], undefined> extends never ? Key : never : Key]: SpecifiedOptions[Key] }> & Required<Options>> // `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
535
- >>;
604
+ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
536
605
  //#endregion
537
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/partial-deep.d.ts
606
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/partial-deep.d.ts
538
607
  /**
539
608
  @see {@link PartialDeep}
540
609
  */
@@ -549,24 +618,23 @@ type PartialDeepOptions = {
549
618
  Allows `undefined` values in non-tuple arrays.
550
619
  - When set to `true`, elements of non-tuple arrays can be `undefined`.
551
620
  - When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
552
- @default true
621
+ @default false
553
622
  @example
554
- You can prevent `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}` as the second type argument:
623
+ You can allow `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}` as the second type argument:
555
624
  ```
556
625
  import type {PartialDeep} from 'type-fest';
557
626
  type Settings = {
558
627
  languages: string[];
559
628
  };
560
- declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}>;
561
- partialSettings.languages = [undefined]; // Error
562
- partialSettings.languages = []; // Ok
629
+ declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}>;
630
+ partialSettings.languages = [undefined]; // OK
563
631
  ```
564
632
  */
565
633
  readonly allowUndefinedInNonTupleArrays?: boolean;
566
634
  };
567
635
  type DefaultPartialDeepOptions = {
568
636
  recurseIntoArrays: false;
569
- allowUndefinedInNonTupleArrays: true;
637
+ allowUndefinedInNonTupleArrays: false;
570
638
  };
571
639
 
572
640
  /**
@@ -580,19 +648,19 @@ Use-cases:
580
648
  ```
581
649
  import type {PartialDeep} from 'type-fest';
582
650
 
583
- const settings: Settings = {
651
+ let settings = {
584
652
  textEditor: {
585
653
  fontSize: 14,
586
654
  fontColor: '#000000',
587
- fontWeight: 400
655
+ fontWeight: 400,
588
656
  },
589
657
  autocomplete: false,
590
- autosave: true
658
+ autosave: true,
591
659
  };
592
660
 
593
- const applySavedSettings = (savedSettings: PartialDeep<Settings>) => {
594
- return {...settings, ...savedSettings};
595
- }
661
+ const applySavedSettings = (savedSettings: PartialDeep<typeof settings>) => (
662
+ {...settings, ...savedSettings, textEditor: {...settings.textEditor, ...savedSettings.textEditor}}
663
+ );
596
664
 
597
665
  settings = applySavedSettings({textEditor: {fontWeight: 500}});
598
666
  ```
@@ -602,13 +670,15 @@ By default, this does not affect elements in array and tuple types. You can chan
602
670
  ```
603
671
  import type {PartialDeep} from 'type-fest';
604
672
 
605
- type Settings = {
606
- languages: string[];
607
- }
673
+ type Shape = {
674
+ dimensions: [number, number];
675
+ };
608
676
 
609
- const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true}> = {
610
- languages: [undefined]
677
+ const partialShape: PartialDeep<Shape, {recurseIntoArrays: true}> = {
678
+ dimensions: [], // OK
611
679
  };
680
+
681
+ partialShape.dimensions = [15]; // OK
612
682
  ```
613
683
 
614
684
  @see {@link PartialDeepOptions}
@@ -619,8 +689,8 @@ const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true}> = {
619
689
  @category Map
620
690
  */
621
691
  type PartialDeep<T, Options extends PartialDeepOptions = {}> = _PartialDeep<T, ApplyDefaultOptions<PartialDeepOptions, DefaultPartialDeepOptions, Options>>;
622
- type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown)) ? T : IsNever<keyof T> extends true // For functions with no properties
623
- ? T : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType, Options> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType, Options> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType, Options> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType, Options> : T extends object ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
692
+ type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown)) ? T : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType, Options> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType, Options> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType, Options> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType, Options> : T extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T> extends true ? T // For functions with no properties
693
+ : HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & PartialObjectDeep<T, Options> : T extends object ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
624
694
  ? Options['recurseIntoArrays'] extends true ? ItemType[] extends T // Test for arrays (non-tuples) specifically
625
695
  ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
626
696
  ? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : PartialObjectDeep<T, Options> // Tuples behave properly
@@ -650,9 +720,9 @@ type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {
650
720
  /**
651
721
  Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
652
722
  */
653
- type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = (ObjectType extends ((...arguments_: any) => unknown) ? (...arguments_: Parameters<ObjectType>) => ReturnType<ObjectType> : {}) & ({ [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options> });
723
+ type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = { [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options> };
654
724
  //#endregion
655
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/readonly-deep.d.ts
725
+ //#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/readonly-deep.d.ts
656
726
  /**
657
727
  Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively.
658
728
 
@@ -676,7 +746,7 @@ const data: ReadonlyDeep<typeof dataJson> = dataJson;
676
746
  export default data;
677
747
 
678
748
  // test.ts
679
- import data from './main';
749
+ import data from './main.d.ts';
680
750
 
681
751
  data.foo.push('bar');
682
752
  //=> error TS2339: Property 'push' does not exist on type 'readonly string[]'
@@ -690,9 +760,9 @@ Note that types containing overloaded functions are not made deeply readonly due
690
760
  @category Map
691
761
  */
692
762
  type ReadonlyDeep<T> = T extends BuiltIns ? T : T extends (new (...arguments_: any[]) => unknown) ? T // Skip class constructors
693
- : T extends ((...arguments_: any[]) => unknown) ? {} extends ReadonlyObjectDeep<T> ? T : HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & ReadonlyObjectDeep<T> : T extends Readonly<ReadonlyMap<infer KeyType, infer ValueType>> ? ReadonlyMapDeep<KeyType, ValueType> : T extends Readonly<ReadonlySet<infer ItemType>> ? ReadonlySetDeep<ItemType> :
763
+ : T extends ((...arguments_: any[]) => unknown) ? {} extends _ReadonlyObjectDeep<T> ? T : HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & _ReadonlyObjectDeep<T> : T extends Readonly<ReadonlyMap<infer KeyType, infer ValueType>> ? ReadonlyMapDeep<KeyType, ValueType> : T extends Readonly<ReadonlySet<infer ItemType>> ? ReadonlySetDeep<ItemType> :
694
764
  // Identify tuples to avoid converting them to arrays inadvertently; special case `readonly [...never[]]`, as it emerges undesirably from recursive invocations of ReadonlyDeep below.
695
- T extends readonly [] | readonly [...never[]] ? readonly [] : T extends readonly [infer U, ...infer V] ? readonly [ReadonlyDeep<U>, ...ReadonlyDeep<V>] : T extends readonly [...infer U, infer V] ? readonly [...ReadonlyDeep<U>, ReadonlyDeep<V>] : T extends ReadonlyArray<infer ItemType> ? ReadonlyArray<ReadonlyDeep<ItemType>> : T extends object ? ReadonlyObjectDeep<T> : unknown;
765
+ T extends readonly [] | readonly [...never[]] ? readonly [] : T extends readonly [infer U, ...infer V] ? readonly [ReadonlyDeep<U>, ...ReadonlyDeep<V>] : T extends readonly [...infer U, infer V] ? readonly [...ReadonlyDeep<U>, ReadonlyDeep<V>] : T extends ReadonlyArray<infer ItemType> ? ReadonlyArray<ReadonlyDeep<ItemType>> : T extends object ? _ReadonlyObjectDeep<T> : unknown;
696
766
  /**
697
767
  Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`.
698
768
  */
@@ -706,7 +776,7 @@ type ReadonlySetDeep<ItemType$1> = {} & Readonly<ReadonlySet<ReadonlyDeep<ItemTy
706
776
  /**
707
777
  Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`.
708
778
  */
709
- type ReadonlyObjectDeep<ObjectType extends object> = { readonly [KeyType in keyof ObjectType]: ReadonlyDeep<ObjectType[KeyType]> };
779
+ type _ReadonlyObjectDeep<ObjectType extends object> = { readonly [KeyType in keyof ObjectType]: ReadonlyDeep<ObjectType[KeyType]> };
710
780
  //#endregion
711
781
  //#region ../packages/common/extensions.d.ts
712
782
  interface MapViewExtension<T> {
@@ -901,6 +971,11 @@ type BlueDotState = {
901
971
  * @default true
902
972
  */
903
973
  preventOutOfBounds: boolean;
974
+ /**
975
+ * If true, timestamp will be used to discard updates which are received out of order.
976
+ * @default true
977
+ */
978
+ discardStaleUpdates: boolean;
904
979
  };
905
980
  type BlueDotUpdateState = PartialDeep<BlueDotState>;
906
981
  /**
@@ -961,7 +1036,7 @@ type BlueDotUpdateOptions = {
961
1036
  };
962
1037
  type GeolocationPositionExtended = GeolocationPosition & {
963
1038
  coords: GeolocationPosition['coords'] & {
964
- readonly floorLevel?: number;
1039
+ readonly floorLevel?: number | null;
965
1040
  };
966
1041
  };
967
1042
  //#endregion
@@ -1132,18 +1207,26 @@ declare class BlueDot implements MapViewExtension<BlueDotState> {
1132
1207
  */
1133
1208
  watchDeviceOrientation: (watch: boolean) => Promise<void>;
1134
1209
  /**
1135
- * Manually override some position properties of the Blue Dot.
1136
- * Accepts a full GeolocationPosition object or a partial {@link BlueDotPositionUpdate} object.
1210
+ * Set the Blue Dot position to specific coordinates or override some properties of the device geolocation.
1137
1211
  *
1138
- * @remarks This will emit a 'position-update' event.
1212
+ * @remarks If `floorLevel` is provided with {@link GeolocationPositionExtended}, the floor will be resolved asynchronously and the position will not be applied until this is completed.
1139
1213
  *
1140
- * @example Manually set the accuracy and heading
1214
+ * @param position - The position to set. Use {@link BlueDotPositionUpdate} for manual positioning,
1215
+ * a GeolocationPosition object, or undefined to clear the manual position.
1216
+ * @param options - Optional update options (silent, animate).
1217
+ *
1218
+ * @example Set position with floor
1141
1219
  * ```ts
1142
- * api.BlueDot.update({ accuracy: 10, heading: 90 });
1220
+ * blueDot.update({
1221
+ * latitude: 43.123,
1222
+ * longitude: -79.456,
1223
+ * accuracy: 5,
1224
+ * floorOrFloorId: floor
1225
+ * });
1143
1226
  * ```
1144
- * @example Reset accuracy and heading to device values
1227
+ * @example Clear manual position properties and return to device geolocation
1145
1228
  * ```ts
1146
- * api.BlueDot.update({ accuracy: 'device', heading: 'device' });
1229
+ * blueDot.update(undefined);
1147
1230
  * ```
1148
1231
  */
1149
1232
  update: (position: GeolocationPositionExtended | BlueDotPositionUpdate | undefined, options?: BlueDotUpdateOptions) => void;
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{b as o,c as t}from"./chunk-X6CIQEJY.js";o();export{t as BlueDot};
1
+ import{b as o,c as t}from"./chunk-77XV5TVI.js";o();export{t as BlueDot};