@mappedin/dynamic-focus 6.13.0-beta.0 → 6.15.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.
- package/lib/esm/chunk-BJFA6MKA.js +1 -0
- package/lib/esm/index.d.ts +110 -87
- package/lib/esm/index.js +1 -1
- package/lib/esm/react/index.d.ts +110 -87
- package/lib/esm/react/index.js +1 -1
- package/lib/rn/building.d.ts +2 -5
- package/lib/rn/index-rn.js +5 -5
- package/lib/rn/types.d.ts +8 -6
- package/package.json +5 -6
- package/lib/esm/chunk-DMFERG3B.js +0 -1
package/lib/esm/react/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { Facade, Floor, FloorStack, MapView, VisibilityState as BuildingFloorStackState } from "@mappedin/mappedin-js";
|
|
1
|
+
import { Facade, Floor, FloorStack, MapView, TFloorAltitudeData, VisibilityState as BuildingFloorStackState } from "@mappedin/mappedin-js";
|
|
2
2
|
|
|
3
3
|
//#region src/types.d.ts
|
|
4
|
-
type MultiFloorVisibilityState = (floors: Floor[], currentFloor: Floor,
|
|
5
|
-
|
|
6
|
-
effectiveHeight: number;
|
|
7
|
-
}>, footprintConfig?: {
|
|
8
|
-
color?: string;
|
|
4
|
+
type MultiFloorVisibilityState = (floors: Floor[], currentFloor: Floor, floorIdsInNavigation: Floor['id'][], floorsVisualHeightMap: Map<number, TFloorAltitudeData>, footprintConfig?: {
|
|
5
|
+
color?: string | Partial<Record<string, string>>;
|
|
9
6
|
opacity?: number;
|
|
10
7
|
outline?: boolean;
|
|
11
8
|
spacesOpenToBelowEnabled?: boolean;
|
|
@@ -132,7 +129,7 @@ type DynamicFocusEventPayload<EventName extends keyof DynamicFocusEvents> = Dyna
|
|
|
132
129
|
data: null;
|
|
133
130
|
} ? DynamicFocusEvents[EventName]['data'] : DynamicFocusEvents[EventName];
|
|
134
131
|
//#endregion
|
|
135
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
132
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/primitive.d.ts
|
|
136
133
|
/**
|
|
137
134
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
138
135
|
|
|
@@ -140,7 +137,7 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
|
|
|
140
137
|
*/
|
|
141
138
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
142
139
|
//#endregion
|
|
143
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
140
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-any.d.ts
|
|
144
141
|
/**
|
|
145
142
|
Returns a boolean for whether the given type is `any`.
|
|
146
143
|
|
|
@@ -155,8 +152,8 @@ import type {IsAny} from 'type-fest';
|
|
|
155
152
|
const typedObject = {a: 1, b: 2} as const;
|
|
156
153
|
const anyObject: any = {a: 1, b: 2};
|
|
157
154
|
|
|
158
|
-
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(
|
|
159
|
-
return
|
|
155
|
+
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
|
|
156
|
+
return object[key];
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
const typedA = get(typedObject, 'a');
|
|
@@ -171,7 +168,7 @@ const anyA = get(anyObject, 'a');
|
|
|
171
168
|
*/
|
|
172
169
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
173
170
|
//#endregion
|
|
174
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
171
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
175
172
|
/**
|
|
176
173
|
Returns a boolean for whether the given key is an optional key of type.
|
|
177
174
|
|
|
@@ -181,17 +178,17 @@ This is useful when writing utility types or schema validators that need to diff
|
|
|
181
178
|
```
|
|
182
179
|
import type {IsOptionalKeyOf} from 'type-fest';
|
|
183
180
|
|
|
184
|
-
|
|
181
|
+
type User = {
|
|
185
182
|
name: string;
|
|
186
183
|
surname: string;
|
|
187
184
|
|
|
188
185
|
luckyNumber?: number;
|
|
189
|
-
}
|
|
186
|
+
};
|
|
190
187
|
|
|
191
|
-
|
|
188
|
+
type Admin = {
|
|
192
189
|
name: string;
|
|
193
190
|
surname?: string;
|
|
194
|
-
}
|
|
191
|
+
};
|
|
195
192
|
|
|
196
193
|
type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
|
|
197
194
|
//=> true
|
|
@@ -214,7 +211,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
214
211
|
*/
|
|
215
212
|
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;
|
|
216
213
|
//#endregion
|
|
217
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
214
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
218
215
|
/**
|
|
219
216
|
Extract all optional keys from the given type.
|
|
220
217
|
|
|
@@ -224,12 +221,12 @@ This is useful when you want to create a new type that contains different type v
|
|
|
224
221
|
```
|
|
225
222
|
import type {OptionalKeysOf, Except} from 'type-fest';
|
|
226
223
|
|
|
227
|
-
|
|
224
|
+
type User = {
|
|
228
225
|
name: string;
|
|
229
226
|
surname: string;
|
|
230
227
|
|
|
231
228
|
luckyNumber?: number;
|
|
232
|
-
}
|
|
229
|
+
};
|
|
233
230
|
|
|
234
231
|
const REMOVE_FIELD = Symbol('remove field symbol');
|
|
235
232
|
type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
|
|
@@ -237,12 +234,12 @@ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKe
|
|
|
237
234
|
};
|
|
238
235
|
|
|
239
236
|
const update1: UpdateOperation<User> = {
|
|
240
|
-
name: 'Alice'
|
|
237
|
+
name: 'Alice',
|
|
241
238
|
};
|
|
242
239
|
|
|
243
240
|
const update2: UpdateOperation<User> = {
|
|
244
241
|
name: 'Bob',
|
|
245
|
-
luckyNumber: REMOVE_FIELD
|
|
242
|
+
luckyNumber: REMOVE_FIELD,
|
|
246
243
|
};
|
|
247
244
|
```
|
|
248
245
|
|
|
@@ -252,7 +249,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
252
249
|
? (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`
|
|
253
250
|
: never;
|
|
254
251
|
//#endregion
|
|
255
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
252
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/required-keys-of.d.ts
|
|
256
253
|
/**
|
|
257
254
|
Extract all required keys from the given type.
|
|
258
255
|
|
|
@@ -262,17 +259,23 @@ This is useful when you want to create a new type that contains different type v
|
|
|
262
259
|
```
|
|
263
260
|
import type {RequiredKeysOf} from 'type-fest';
|
|
264
261
|
|
|
265
|
-
declare function createValidation<
|
|
262
|
+
declare function createValidation<
|
|
263
|
+
Entity extends object,
|
|
264
|
+
Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
|
|
265
|
+
>(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
type User = {
|
|
268
268
|
name: string;
|
|
269
269
|
surname: string;
|
|
270
|
-
|
|
271
270
|
luckyNumber?: number;
|
|
272
|
-
}
|
|
271
|
+
};
|
|
273
272
|
|
|
274
273
|
const validator1 = createValidation<User>('name', value => value.length < 25);
|
|
275
274
|
const validator2 = createValidation<User>('surname', value => value.length < 25);
|
|
275
|
+
|
|
276
|
+
// @ts-expect-error
|
|
277
|
+
const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
278
|
+
// Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
|
|
276
279
|
```
|
|
277
280
|
|
|
278
281
|
@category Utilities
|
|
@@ -280,7 +283,7 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
|
|
|
280
283
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
281
284
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
282
285
|
//#endregion
|
|
283
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
286
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-never.d.ts
|
|
284
287
|
/**
|
|
285
288
|
Returns a boolean for whether the given type is `never`.
|
|
286
289
|
|
|
@@ -294,29 +297,41 @@ Useful in type utilities, such as checking if something does not occur.
|
|
|
294
297
|
```
|
|
295
298
|
import type {IsNever, And} from 'type-fest';
|
|
296
299
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
300
|
+
type A = IsNever<never>;
|
|
301
|
+
//=> true
|
|
302
|
+
|
|
303
|
+
type B = IsNever<any>;
|
|
304
|
+
//=> false
|
|
305
|
+
|
|
306
|
+
type C = IsNever<unknown>;
|
|
307
|
+
//=> false
|
|
308
|
+
|
|
309
|
+
type D = IsNever<never[]>;
|
|
310
|
+
//=> false
|
|
311
|
+
|
|
312
|
+
type E = IsNever<object>;
|
|
313
|
+
//=> false
|
|
314
|
+
|
|
315
|
+
type F = IsNever<string>;
|
|
316
|
+
//=> false
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
@example
|
|
320
|
+
```
|
|
321
|
+
import type {IsNever} from 'type-fest';
|
|
314
322
|
|
|
315
|
-
|
|
323
|
+
type IsTrue<T> = T extends true ? true : false;
|
|
324
|
+
|
|
325
|
+
// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
|
|
326
|
+
type A = IsTrue<never>;
|
|
316
327
|
//=> never
|
|
317
328
|
|
|
318
|
-
|
|
319
|
-
|
|
329
|
+
// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
|
|
330
|
+
type IsTrueFixed<T> =
|
|
331
|
+
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
332
|
+
|
|
333
|
+
type B = IsTrueFixed<never>;
|
|
334
|
+
//=> false
|
|
320
335
|
```
|
|
321
336
|
|
|
322
337
|
@category Type Guard
|
|
@@ -324,7 +339,7 @@ endIfEqual('abc', '123');
|
|
|
324
339
|
*/
|
|
325
340
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
326
341
|
//#endregion
|
|
327
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
342
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/if.d.ts
|
|
328
343
|
/**
|
|
329
344
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
330
345
|
|
|
@@ -337,7 +352,7 @@ Note:
|
|
|
337
352
|
|
|
338
353
|
@example
|
|
339
354
|
```
|
|
340
|
-
import {If} from 'type-fest';
|
|
355
|
+
import type {If} from 'type-fest';
|
|
341
356
|
|
|
342
357
|
type A = If<true, 'yes', 'no'>;
|
|
343
358
|
//=> 'yes'
|
|
@@ -357,7 +372,7 @@ type E = If<never, 'yes', 'no'>;
|
|
|
357
372
|
|
|
358
373
|
@example
|
|
359
374
|
```
|
|
360
|
-
import {If, IsAny, IsNever} from 'type-fest';
|
|
375
|
+
import type {If, IsAny, IsNever} from 'type-fest';
|
|
361
376
|
|
|
362
377
|
type A = If<IsAny<unknown>, 'is any', 'not any'>;
|
|
363
378
|
//=> 'not any'
|
|
@@ -368,7 +383,7 @@ type B = If<IsNever<never>, 'is never', 'not never'>;
|
|
|
368
383
|
|
|
369
384
|
@example
|
|
370
385
|
```
|
|
371
|
-
import {If, IsEqual} from 'type-fest';
|
|
386
|
+
import type {If, IsEqual} from 'type-fest';
|
|
372
387
|
|
|
373
388
|
type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
|
|
374
389
|
|
|
@@ -419,7 +434,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
419
434
|
*/
|
|
420
435
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
421
436
|
//#endregion
|
|
422
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
437
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/internal/type.d.ts
|
|
423
438
|
/**
|
|
424
439
|
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
425
440
|
*/
|
|
@@ -437,7 +452,7 @@ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T
|
|
|
437
452
|
(...arguments_: infer B): unknown;
|
|
438
453
|
} ? B extends A ? A extends B ? false : true : true : false;
|
|
439
454
|
//#endregion
|
|
440
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
455
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/simplify.d.ts
|
|
441
456
|
/**
|
|
442
457
|
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.
|
|
443
458
|
|
|
@@ -483,10 +498,11 @@ const literal = {foo: 123, bar: 'hello', baz: 456};
|
|
|
483
498
|
const someType: SomeType = literal;
|
|
484
499
|
const someInterface: SomeInterface = literal;
|
|
485
500
|
|
|
486
|
-
function fn(object: Record<string, unknown>): void
|
|
501
|
+
declare function fn(object: Record<string, unknown>): void;
|
|
487
502
|
|
|
488
503
|
fn(literal); // Good: literal object type is sealed
|
|
489
504
|
fn(someType); // Good: type is sealed
|
|
505
|
+
// @ts-expect-error
|
|
490
506
|
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
|
491
507
|
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
|
492
508
|
```
|
|
@@ -497,7 +513,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
497
513
|
*/
|
|
498
514
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
499
515
|
//#endregion
|
|
500
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
516
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
501
517
|
/**
|
|
502
518
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
503
519
|
|
|
@@ -515,8 +531,9 @@ It relies on the fact that an empty object (`{}`) is assignable to an object wit
|
|
|
515
531
|
```
|
|
516
532
|
const indexed: Record<string, unknown> = {}; // Allowed
|
|
517
533
|
|
|
534
|
+
// @ts-expect-error
|
|
518
535
|
const keyed: Record<'foo', unknown> = {}; // Error
|
|
519
|
-
//
|
|
536
|
+
// TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
|
|
520
537
|
```
|
|
521
538
|
|
|
522
539
|
Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
|
|
@@ -525,19 +542,21 @@ Instead of causing a type error like the above, you can also use a [conditional
|
|
|
525
542
|
type Indexed = {} extends Record<string, unknown>
|
|
526
543
|
? '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
527
544
|
: '❌ `{}` is NOT assignable to `Record<string, unknown>`';
|
|
528
|
-
|
|
545
|
+
|
|
546
|
+
type IndexedResult = Indexed;
|
|
547
|
+
//=> '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
529
548
|
|
|
530
549
|
type Keyed = {} extends Record<'foo' | 'bar', unknown>
|
|
531
|
-
?
|
|
532
|
-
:
|
|
533
|
-
|
|
550
|
+
? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
551
|
+
: '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
|
|
552
|
+
|
|
553
|
+
type KeyedResult = Keyed;
|
|
554
|
+
//=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
534
555
|
```
|
|
535
556
|
|
|
536
557
|
Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
|
|
537
558
|
|
|
538
559
|
```
|
|
539
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
540
|
-
|
|
541
560
|
type OmitIndexSignature<ObjectType> = {
|
|
542
561
|
[KeyType in keyof ObjectType // Map each key of `ObjectType`...
|
|
543
562
|
]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
|
|
@@ -547,14 +566,12 @@ type OmitIndexSignature<ObjectType> = {
|
|
|
547
566
|
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
|
|
548
567
|
|
|
549
568
|
```
|
|
550
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
551
|
-
|
|
552
569
|
type OmitIndexSignature<ObjectType> = {
|
|
553
570
|
[KeyType in keyof ObjectType
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
571
|
+
// Is `{}` assignable to `Record<KeyType, unknown>`?
|
|
572
|
+
as {} extends Record<KeyType, unknown>
|
|
573
|
+
? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
|
|
574
|
+
: KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
|
|
558
575
|
]: ObjectType[KeyType];
|
|
559
576
|
};
|
|
560
577
|
```
|
|
@@ -565,24 +582,24 @@ If `{}` is assignable, it means that `KeyType` is an index signature and we want
|
|
|
565
582
|
```
|
|
566
583
|
import type {OmitIndexSignature} from 'type-fest';
|
|
567
584
|
|
|
568
|
-
|
|
585
|
+
type Example = {
|
|
569
586
|
// These index signatures will be removed.
|
|
570
|
-
[x: string]: any
|
|
571
|
-
[x: number]: any
|
|
572
|
-
[x: symbol]: any
|
|
573
|
-
[x: `head-${string}`]: string
|
|
574
|
-
[x: `${string}-tail`]: string
|
|
575
|
-
[x: `head-${string}-tail`]: string
|
|
576
|
-
[x: `${bigint}`]: string
|
|
577
|
-
[x: `embedded-${number}`]: string
|
|
587
|
+
[x: string]: any;
|
|
588
|
+
[x: number]: any;
|
|
589
|
+
[x: symbol]: any;
|
|
590
|
+
[x: `head-${string}`]: string;
|
|
591
|
+
[x: `${string}-tail`]: string;
|
|
592
|
+
[x: `head-${string}-tail`]: string;
|
|
593
|
+
[x: `${bigint}`]: string;
|
|
594
|
+
[x: `embedded-${number}`]: string;
|
|
578
595
|
|
|
579
596
|
// These explicitly defined keys will remain.
|
|
580
597
|
foo: 'bar';
|
|
581
598
|
qux?: 'baz';
|
|
582
|
-
}
|
|
599
|
+
};
|
|
583
600
|
|
|
584
601
|
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
585
|
-
|
|
602
|
+
//=> {foo: 'bar'; qux?: 'baz'}
|
|
586
603
|
```
|
|
587
604
|
|
|
588
605
|
@see {@link PickIndexSignature}
|
|
@@ -590,7 +607,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
590
607
|
*/
|
|
591
608
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
592
609
|
//#endregion
|
|
593
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
610
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
594
611
|
/**
|
|
595
612
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
596
613
|
|
|
@@ -638,9 +655,9 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
638
655
|
*/
|
|
639
656
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
640
657
|
//#endregion
|
|
641
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
658
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/merge.d.ts
|
|
642
659
|
// Merges two objects without worrying about index signatures.
|
|
643
|
-
type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source
|
|
660
|
+
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
644
661
|
|
|
645
662
|
/**
|
|
646
663
|
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
@@ -649,12 +666,12 @@ Merge two types into a new type. Keys of the second type overrides keys of the f
|
|
|
649
666
|
```
|
|
650
667
|
import type {Merge} from 'type-fest';
|
|
651
668
|
|
|
652
|
-
|
|
669
|
+
type Foo = {
|
|
653
670
|
[x: string]: unknown;
|
|
654
671
|
[x: number]: unknown;
|
|
655
672
|
foo: string;
|
|
656
673
|
bar: symbol;
|
|
657
|
-
}
|
|
674
|
+
};
|
|
658
675
|
|
|
659
676
|
type Bar = {
|
|
660
677
|
[x: number]: number;
|
|
@@ -664,7 +681,7 @@ type Bar = {
|
|
|
664
681
|
};
|
|
665
682
|
|
|
666
683
|
export type FooBar = Merge<Foo, Bar>;
|
|
667
|
-
|
|
684
|
+
//=> {
|
|
668
685
|
// [x: string]: unknown;
|
|
669
686
|
// [x: number]: number;
|
|
670
687
|
// [x: symbol]: unknown;
|
|
@@ -674,11 +691,17 @@ export type FooBar = Merge<Foo, Bar>;
|
|
|
674
691
|
// }
|
|
675
692
|
```
|
|
676
693
|
|
|
694
|
+
Note: If you want a merge type that more accurately reflects the runtime behavior of object spread or `Object.assign`, refer to the {@link ObjectMerge} type.
|
|
695
|
+
|
|
696
|
+
@see {@link ObjectMerge}
|
|
677
697
|
@category Object
|
|
678
698
|
*/
|
|
679
|
-
type Merge<Destination, Source> =
|
|
699
|
+
type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
|
|
700
|
+
? Source extends unknown // For distributing `Source`
|
|
701
|
+
? Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>> : never // Should never happen
|
|
702
|
+
: never;
|
|
680
703
|
//#endregion
|
|
681
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
704
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/internal/object.d.ts
|
|
682
705
|
|
|
683
706
|
/**
|
|
684
707
|
Merges user specified options with default options.
|
|
@@ -734,7 +757,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
734
757
|
*/
|
|
735
758
|
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>>>>;
|
|
736
759
|
//#endregion
|
|
737
|
-
//#region ../../node_modules/.pnpm/type-fest@5.2
|
|
760
|
+
//#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/partial-deep.d.ts
|
|
738
761
|
/**
|
|
739
762
|
@see {@link PartialDeep}
|
|
740
763
|
*/
|
package/lib/esm/react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,d as a}from"../chunk-
|
|
1
|
+
import{a as t,d as a}from"../chunk-BJFA6MKA.js";import{useCallback as y,useState as p,useMemo as F}from"react";import{useMap as l,useMapViewExtension as D}from"@mappedin/react-sdk";function d(){let[,n]=p({});return y(()=>n({}),[])}t(d,"useForceUpdate");function i(){let{mapView:n}=l(),r=d(),{register:o}=D("dynamic-focus",{onRegister:t(()=>{let e=new a(n);return e.on("state-change",r),e},"onRegister"),onDeregister:t(e=>{e.off("state-change",r),e.destroy()},"onDeregister")}),s=o();if(!s)throw new Error("DynamicFocus is not initialized");return F(()=>{let e=new WeakMap;return new Proxy(s,{get(u,m){let c=u[m];return typeof c=="function"?(e.has(c)||e.set(c,c.bind(u)),e.get(c)):c}})},[s])}t(i,"useDynamicFocus");import{useCallback as w,useEffect as E,useRef as k}from"react";function x(n,r){let o=i(),s=k(r);s.current=r;let e=w(u=>{s.current(u)},[]);E(()=>{if(o!=null)return o.on(n,e),()=>{o!=null&&o.off(n,e)}},[o,n,e])}t(x,"useDynamicFocusEvent");export{i as useDynamicFocus,x as useDynamicFocusEvent};
|
package/lib/rn/building.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MapView, TAnimateStateResult, TFacadeState } from '@mappedin/mappedin-js';
|
|
1
|
+
import type { MapView, TAnimateStateResult, TFacadeState, TFloorAltitudeData } from '@mappedin/mappedin-js';
|
|
2
2
|
import { Facade, Floor, FloorStack } from '@mappedin/mappedin-js';
|
|
3
3
|
import type { DynamicFocusAnimationOptions } from './types';
|
|
4
4
|
export declare class Building {
|
|
@@ -7,10 +7,7 @@ export declare class Building {
|
|
|
7
7
|
defaultFloor: Floor;
|
|
8
8
|
activeFloor: Floor;
|
|
9
9
|
excluded: boolean;
|
|
10
|
-
floorsAltitudesMap: Map<number,
|
|
11
|
-
altitude: number;
|
|
12
|
-
effectiveHeight: number;
|
|
13
|
-
}>;
|
|
10
|
+
floorsAltitudesMap: Map<number, TFloorAltitudeData>;
|
|
14
11
|
aboveGroundFloors: Floor[];
|
|
15
12
|
constructor(floorStack: FloorStack, mapView: MapView);
|
|
16
13
|
get id(): string;
|