import * as _mappedin_mappedin_js0 from "@mappedin/mappedin-js"; import { Label as Label$1, MapData, MapView as MapView$1, Marker as Marker$1, Model as Model$1, Path as Path$1, Shape as Shape$1, TAnimationOptions, TEvents, TGetMapDataOptions, TMapDataEvents, TShow3DMapOptions } from "@mappedin/mappedin-js"; import * as react1 from "react"; import React, { PropsWithChildren, ReactNode } from "react"; //#region src/MapDataProvider.d.ts type MapDataProviderProps = { mapData: MapData; }; declare function MapDataProvider({ mapData, children }: PropsWithChildren): React.JSX.Element; //#endregion //#region src/hooks/useMapData.d.ts /** * Hook to get the MapData and handle loading and error states. * * If used outside of a {@link MapDataProvider} or {@link MapView} component, options are required to fetch the MapData. * If used within a {@link MapDataProvider} or {@link MapView} component, options are optional and will use the MapData from the context if available. * * @category Hooks * * @example * ```tsx * const { mapData, isLoading, error } = useMapData(options); * ``` */ declare function useMapData(options?: TGetMapDataOptions): { mapData?: MapData; isLoading: boolean; error?: Error; }; //#endregion //#region src/hooks/useMapDataEvent.d.ts /** * Hook to subscribe to an event on the MapData. * * Must be used within a {@link MapDataProvider} or {@link MapView} component. * @throws If used outside of a {@link MapDataProvider} or {@link MapView} component. * * @param event - The event to listen for. * @param callback - The callback to call when the event is triggered. * * @category Hooks * * @example * ```tsx * useMapDataEvent('language-change', event => { * console.log(`Map language changed to ${event.name} (${event.code})`); * }); * ``` */ declare function useMapDataEvent(event: T, callback: (payload: TMapDataEvents[T] extends { data: null; } ? TMapDataEvents[T]['data'] : TMapDataEvents[T]) => void): void; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/primitive.d.ts /** Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). @category Type */ type Primitive = null | undefined | string | number | boolean | symbol | bigint; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-any.d.ts /** Returns a boolean for whether the given type is `any`. @link https://stackoverflow.com/a/49928360/1490091 Useful in type utilities, such as disallowing `any`s to be passed to a function. @example ``` import type {IsAny} from 'type-fest'; const typedObject = {a: 1, b: 2} as const; const anyObject: any = {a: 1, b: 2}; function get extends true ? {} : Record), K extends keyof O = keyof O>(object: O, key: K) { return object[key]; } const typedA = get(typedObject, 'a'); //=> 1 const anyA = get(anyObject, 'a'); //=> any ``` @category Type Guard @category Utilities */ type IsAny = 0 extends 1 & NoInfer ? true : false; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-optional-key-of.d.ts /** Returns a boolean for whether the given key is an optional key of type. This is useful when writing utility types or schema validators that need to differentiate `optional` keys. @example ``` import type {IsOptionalKeyOf} from 'type-fest'; type User = { name: string; surname: string; luckyNumber?: number; }; type Admin = { name: string; surname?: string; }; type T1 = IsOptionalKeyOf; //=> true type T2 = IsOptionalKeyOf; //=> false type T3 = IsOptionalKeyOf; //=> boolean type T4 = IsOptionalKeyOf; //=> false type T5 = IsOptionalKeyOf; //=> boolean ``` @category Type Guard @category Utilities */ type IsOptionalKeyOf = IsAny extends true ? never : Key$1 extends keyof Type ? Type extends Record ? false : true : false; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/optional-keys-of.d.ts /** Extract all optional keys from the given type. This is useful when you want to create a new type that contains different type values for the optional keys only. @example ``` import type {OptionalKeysOf, Except} from 'type-fest'; type User = { name: string; surname: string; luckyNumber?: number; }; const REMOVE_FIELD = Symbol('remove field symbol'); type UpdateOperation = Except, OptionalKeysOf> & { [Key in OptionalKeysOf]?: Entity[Key] | typeof REMOVE_FIELD; }; const update1: UpdateOperation = { name: 'Alice', }; const update2: UpdateOperation = { name: 'Bob', luckyNumber: REMOVE_FIELD, }; ``` @category Utilities */ type OptionalKeysOf = Type extends unknown // For distributing `Type` ? (keyof { [Key in keyof Type as IsOptionalKeyOf extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf` is always assignable to `keyof Type` : never; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/required-keys-of.d.ts /** Extract all required keys from the given type. This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc... @example ``` import type {RequiredKeysOf} from 'type-fest'; declare function createValidation< Entity extends object, Key extends RequiredKeysOf = RequiredKeysOf, >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean; type User = { name: string; surname: string; luckyNumber?: number; }; const validator1 = createValidation('name', value => value.length < 25); const validator2 = createValidation('surname', value => value.length < 25); // @ts-expect-error const validator3 = createValidation('luckyNumber', value => value > 0); // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'. ``` @category Utilities */ type RequiredKeysOf = Type extends unknown // For distributing `Type` ? Exclude> : never; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/is-never.d.ts /** Returns a boolean for whether the given type is `never`. @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919 @link https://stackoverflow.com/a/53984913/10292952 @link https://www.zhenghao.io/posts/ts-never Useful in type utilities, such as checking if something does not occur. @example ``` import type {IsNever, And} from 'type-fest'; type A = IsNever; //=> true type B = IsNever; //=> false type C = IsNever; //=> false type D = IsNever; //=> false type E = IsNever; //=> false type F = IsNever; //=> false ``` @example ``` import type {IsNever} from 'type-fest'; type IsTrue = T extends true ? true : false; // When a distributive conditional is instantiated with `never`, the entire conditional results in `never`. type A = IsTrue; //=> never // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional. type IsTrueFixed = IsNever extends true ? false : T extends true ? true : false; type B = IsTrueFixed; //=> false ``` @category Type Guard @category Utilities */ type IsNever = [T] extends [never] ? true : false; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/if.d.ts /** An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`. Use-cases: - You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If, 'is any', 'not any'>`. Note: - Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If` will return `'Y' | 'N'`. - Returns the else branch if the given type is `never`. For example, `If` will return `'N'`. @example ``` import type {If} from 'type-fest'; type A = If; //=> 'yes' type B = If; //=> 'no' type C = If; //=> 'yes' | 'no' type D = If; //=> 'yes' | 'no' type E = If; //=> 'no' ``` @example ``` import type {If, IsAny, IsNever} from 'type-fest'; type A = If, 'is any', 'not any'>; //=> 'not any' type B = If, 'is never', 'not never'>; //=> 'is never' ``` @example ``` import type {If, IsEqual} from 'type-fest'; type IfEqual = If, IfBranch, ElseBranch>; type A = IfEqual; //=> 'equal' type B = IfEqual; //=> 'not equal' ``` 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: @example ``` import type {If, IsEqual, StringRepeat} from 'type-fest'; type HundredZeroes = StringRepeat<'0', 100>; // The following implementation is not tail recursive type Includes = S extends `${infer First}${infer Rest}` ? If, 'found', Includes> : 'not found'; // Hence, instantiations with long strings will fail // @ts-expect-error type Fails = Includes; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Error: Type instantiation is excessively deep and possibly infinite. // However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive type IncludesWithoutIf = S extends `${infer First}${infer Rest}` ? IsEqual extends true ? 'found' : IncludesWithoutIf : 'not found'; // Now, instantiations with long strings will work type Works = IncludesWithoutIf; //=> 'not found' ``` @category Type Guard @category Utilities */ type If = IsNever extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/internal/type.d.ts /** Matches any primitive, `void`, `Date`, or `RegExp` value. */ type BuiltIns = Primitive | void | Date | RegExp; /** Test if the given function has multiple call signatures. Needed to handle the case of a single call signature with properties. Multiple call signatures cannot currently be supported due to a TypeScript limitation. @see https://github.com/microsoft/TypeScript/issues/29732 */ type HasMultipleCallSignatures unknown> = T extends { (...arguments_: infer A): unknown; (...arguments_: infer B): unknown; } ? B extends A ? A extends B ? false : true : true : false; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/simplify.d.ts /** 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. @example ``` import type {Simplify} from 'type-fest'; type PositionProps = { top: number; left: number; }; type SizeProps = { width: number; height: number; }; // In your editor, hovering over `Props` will show a flattened object with all the properties. type Props = Simplify; ``` Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface. If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify` if you can't re-declare the `value`. @example ``` import type {Simplify} from 'type-fest'; interface SomeInterface { foo: number; bar?: string; baz: number | undefined; } type SomeType = { foo: number; bar?: string; baz: number | undefined; }; const literal = {foo: 123, bar: 'hello', baz: 456}; const someType: SomeType = literal; const someInterface: SomeInterface = literal; declare function fn(object: Record): void; fn(literal); // Good: literal object type is sealed fn(someType); // Good: type is sealed // @ts-expect-error fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened fn(someInterface as Simplify); // Good: transform an `interface` into a `type` ``` @link https://github.com/microsoft/TypeScript/issues/15300 @see {@link SimplifyDeep} @category Object */ type Simplify = { [KeyType in keyof T]: T[KeyType] } & {}; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/omit-index-signature.d.ts /** Omit any index signatures from the given object type, leaving only explicitly defined properties. This is the counterpart of `PickIndexSignature`. Use-cases: - Remove overly permissive signatures from third-party types. This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747). It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`. (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.) ``` const indexed: Record = {}; // Allowed // @ts-expect-error const keyed: Record<'foo', unknown> = {}; // Error // TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar ``` 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: ``` type Indexed = {} extends Record ? '✅ `{}` is assignable to `Record`' : '❌ `{}` is NOT assignable to `Record`'; type IndexedResult = Indexed; //=> '✅ `{}` is assignable to `Record`' type Keyed = {} extends Record<'foo' | 'bar', unknown> ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`' : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`'; type KeyedResult = Keyed; //=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`' ``` 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`... ``` type OmitIndexSignature = { [KeyType in keyof ObjectType // Map each key of `ObjectType`... ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature == Foo`. }; ``` ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record`)... ``` type OmitIndexSignature = { [KeyType in keyof ObjectType // Is `{}` assignable to `Record`? as {} extends Record ? never // ✅ `{}` is assignable to `Record` : KeyType // ❌ `{}` is NOT assignable to `Record` ]: ObjectType[KeyType]; }; ``` If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it. @example ``` import type {OmitIndexSignature} from 'type-fest'; type Example = { // These index signatures will be removed. [x: string]: any; [x: number]: any; [x: symbol]: any; [x: `head-${string}`]: string; [x: `${string}-tail`]: string; [x: `head-${string}-tail`]: string; [x: `${bigint}`]: string; [x: `embedded-${number}`]: string; // These explicitly defined keys will remain. foo: 'bar'; qux?: 'baz'; }; type ExampleWithoutIndexSignatures = OmitIndexSignature; //=> {foo: 'bar'; qux?: 'baz'} ``` @see {@link PickIndexSignature} @category Object */ type OmitIndexSignature = { [KeyType in keyof ObjectType as {} extends Record ? never : KeyType]: ObjectType[KeyType] }; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/pick-index-signature.d.ts /** Pick only index signatures from the given object type, leaving out all explicitly defined properties. This is the counterpart of `OmitIndexSignature`. @example ``` import type {PickIndexSignature} from 'type-fest'; declare const symbolKey: unique symbol; type Example = { // These index signatures will remain. [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; [x: `head-${string}`]: string; [x: `${string}-tail`]: string; [x: `head-${string}-tail`]: string; [x: `${bigint}`]: string; [x: `embedded-${number}`]: string; // These explicitly defined keys will be removed. ['kebab-case-key']: string; [symbolKey]: string; foo: 'bar'; qux?: 'baz'; }; type ExampleIndexSignature = PickIndexSignature; // { // [x: string]: unknown; // [x: number]: unknown; // [x: symbol]: unknown; // [x: `head-${string}`]: string; // [x: `${string}-tail`]: string; // [x: `head-${string}-tail`]: string; // [x: `${bigint}`]: string; // [x: `embedded-${number}`]: string; // } ``` @see {@link OmitIndexSignature} @category Object */ type PickIndexSignature = { [KeyType in keyof ObjectType as {} extends Record ? KeyType : never]: ObjectType[KeyType] }; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/merge.d.ts // Merges two objects without worrying about index signatures. type SimpleMerge = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>; /** Merge two types into a new type. Keys of the second type overrides keys of the first type. @example ``` import type {Merge} from 'type-fest'; type Foo = { [x: string]: unknown; [x: number]: unknown; foo: string; bar: symbol; }; type Bar = { [x: number]: number; [x: symbol]: unknown; bar: Date; baz: boolean; }; export type FooBar = Merge; //=> { // [x: string]: unknown; // [x: number]: number; // [x: symbol]: unknown; // foo: string; // bar: Date; // baz: boolean; // } ``` 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. @see {@link ObjectMerge} @category Object */ type Merge = Destination extends unknown // For distributing `Destination` ? Source extends unknown // For distributing `Source` ? Simplify, PickIndexSignature> & SimpleMerge, OmitIndexSignature>> : never // Should never happen : never; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/internal/object.d.ts /** Merges user specified options with default options. @example ``` type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false}; type SpecifiedOptions = {leavesOnly: true}; type Result = ApplyDefaultOptions; //=> {maxRecursionDepth: 10; leavesOnly: true} ``` @example ``` // Complains if default values are not provided for optional options type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; type DefaultPathsOptions = {maxRecursionDepth: 10}; type SpecifiedOptions = {}; type Result = ApplyDefaultOptions; // ~~~~~~~~~~~~~~~~~~~ // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'. ``` @example ``` // Complains if an option's default type does not conform to the expected type type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'}; type SpecifiedOptions = {}; type Result = ApplyDefaultOptions; // ~~~~~~~~~~~~~~~~~~~ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'. ``` @example ``` // Complains if an option's specified type does not conform to the expected type type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false}; type SpecifiedOptions = {leavesOnly: 'yes'}; type Result = ApplyDefaultOptions; // ~~~~~~~~~~~~~~~~ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'. ``` */ type ApplyDefaultOptions, RequiredKeysOf> & Partial, never>>>, SpecifiedOptions extends Options> = If, Defaults, If, Defaults, Simplify ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required>>>; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/partial-deep.d.ts /** @see {@link PartialDeep} */ type PartialDeepOptions = { /** Whether to affect the individual elements of arrays and tuples. @default false */ readonly recurseIntoArrays?: boolean; /** Allows `undefined` values in non-tuple arrays. - When set to `true`, elements of non-tuple arrays can be `undefined`. - When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking. @default false @example You can allow `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}` as the second type argument: ``` import type {PartialDeep} from 'type-fest'; type Settings = { languages: string[]; }; declare const partialSettings: PartialDeep; partialSettings.languages = [undefined]; // OK ``` */ readonly allowUndefinedInNonTupleArrays?: boolean; }; type DefaultPartialDeepOptions = { recurseIntoArrays: false; allowUndefinedInNonTupleArrays: false; }; /** Create a type from another type with all keys and nested keys set to optional. Use-cases: - Merging a default settings/config object with another object, the second object would be a deep partial of the default object. - Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test. @example ``` import type {PartialDeep} from 'type-fest'; let settings = { textEditor: { fontSize: 14, fontColor: '#000000', fontWeight: 400, }, autocomplete: false, autosave: true, }; const applySavedSettings = (savedSettings: PartialDeep) => ( {...settings, ...savedSettings, textEditor: {...settings.textEditor, ...savedSettings.textEditor}} ); settings = applySavedSettings({textEditor: {fontWeight: 500}}); ``` By default, this does not affect elements in array and tuple types. You can change this by passing `{recurseIntoArrays: true}` as the second type argument: ``` import type {PartialDeep} from 'type-fest'; type Shape = { dimensions: [number, number]; }; const partialShape: PartialDeep = { dimensions: [], // OK }; partialShape.dimensions = [15]; // OK ``` @see {@link PartialDeepOptions} @category Object @category Array @category Set @category Map */ type PartialDeep = _PartialDeep>; type _PartialDeep> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown)) ? T : T extends Map ? PartialMapDeep : T extends Set ? PartialSetDeep : T extends ReadonlyMap ? PartialReadonlyMapDeep : T extends ReadonlySet ? PartialReadonlySetDeep : T extends ((...arguments_: any[]) => unknown) ? IsNever extends true ? T // For functions with no properties : HasMultipleCallSignatures extends true ? T : ((...arguments_: Parameters) => ReturnType) & PartialObjectDeep : T extends object ? T extends ReadonlyArray // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156 ? Options['recurseIntoArrays'] extends true ? ItemType[] extends T // Test for arrays (non-tuples) specifically ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays ? ReadonlyArray<_PartialDeep> : Array<_PartialDeep> : PartialObjectDeep // Tuples behave properly : T // If they don't opt into array testing, just use the original type : PartialObjectDeep : unknown; /** Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`. */ type PartialMapDeep> = {} & Map<_PartialDeep, _PartialDeep>; /** Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`. */ type PartialSetDeep> = {} & Set<_PartialDeep>; /** Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`. */ type PartialReadonlyMapDeep> = {} & ReadonlyMap<_PartialDeep, _PartialDeep>; /** Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`. */ type PartialReadonlySetDeep> = {} & ReadonlySet<_PartialDeep>; /** Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`. */ type PartialObjectDeep> = { [KeyType in keyof ObjectType]?: _PartialDeep }; //#endregion //#region ../../node_modules/.pnpm/type-fest@5.4.2/node_modules/type-fest/source/literal-union.d.ts /** Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals. This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore. @example ``` import type {LiteralUnion} from 'type-fest'; // Before type Pet = 'dog' | 'cat' | string; const petWithoutAutocomplete: Pet = ''; // Start typing in your TypeScript-enabled IDE. // You **will not** get auto-completion for `dog` and `cat` literals. // After type Pet2 = LiteralUnion<'dog' | 'cat', string>; const petWithAutoComplete: Pet2 = ''; // You **will** get auto-completion for `dog` and `cat` literals. ``` @category Type */ type LiteralUnion = LiteralType | (BaseType & Record); //#endregion //#region ../packages/common/extensions.d.ts declare const KNOWN_EXTENSIONS_LIST: readonly ["dynamic-focus", "blue-dot", "events"]; type MapViewExtensionName = LiteralUnion<(typeof KNOWN_EXTENSIONS_LIST)[number], string>; interface MapViewExtension { enable(options?: PartialDeep): void; disable(): void; get isEnabled(): boolean; destroy(): void; } //#endregion //#region src/MapView.d.ts /** * TypeScript can't seem to handle these parameters when wrapped in forwardRef, but it's unlikely * that we'll ever add more parameters to show3dMap. */ /** * @interface */ type MapViewProps = { mapData: MapData; options?: TShow3DMapOptions; /** * The fallback content to render while the map is loading. */ fallback?: ReactNode; }; /** * MapView component. * * The root component which renders the map and provides context to the hooks and child components. * * @category Components * * @example * ```tsx * const { mapData } = useMapData({ key: '...', secret: '...', mapId: '...' }); * return ( * * * * ) * ``` */ declare const MapView: React.ForwardRefExoticComponent, HTMLDivElement>, "ref">, keyof MapViewProps> & React.RefAttributes>; //#endregion //#region src/hooks/useMapViewEvent.d.ts /** * Hook to subscribe to an event on the {@link MapView}. * * Must be used within a {@link MapView} component. * @throws If used outside of a {@link MapView} component. * * @param event - The event to listen for. * @param callback - The callback to call when the event is triggered. * * @category Hooks * * @example * ```tsx * useMapViewEvent('click', event => { * const { coordinate } = event; * const { latitude, longitude } = coordinate; * console.log(`Map was clicked at ${latitude}, ${longitude}`); * }); * ``` */ declare function useMapViewEvent(event: T, callback: (payload: TEvents[T] extends { data: null; } ? TEvents[T]['data'] : TEvents[T]) => void): void; //#endregion //#region src/hooks/useMapViewExtension.d.ts type MapViewExtensionOptions> = { /** * Callback to be fired when the extension is registered. * This will not be called on subsequent calls to register until the extension is deregistered again. **/ onRegister: () => T; /** * Callback to be fired when the extension is deregistered. * This will not be called if the extension is not registered. **/ onDeregister: (extension: T) => void; }; type MapViewExtensionResult> = { /** * Register the extension or return the existing instance if it is already registered. */ register: () => T; /** * Deregister the extension. */ deregister: () => void; }; /** * @internal * Register an extension to the mapView context. * @param name - The name of the extension. * @returns An object with a register and deregister function. */ declare function useMapViewExtension = MapViewExtension>(name: MapViewExtensionName, options: MapViewExtensionOptions): MapViewExtensionResult; //#endregion //#region src/type-utils.d.ts type TupleToObject = { [K in keyof T as Exclude]: T[K] }; type TupleToObjectWithPropNames, PropertyKey>> = { [K in keyof TupleToObject as N[K]]: T[K] }; //#endregion //#region src/Path.d.ts type ParamsArray$5 = Parameters; type StreamAgentParameterNames$5 = ['coordinate', 'options']; /** * @interface */ type PathProps = TupleToObjectWithPropNames & { onDrawComplete?: () => void; }; /** * Path component. * * A Path indicates a route on the map. * * @category Components * * @example * ```tsx * const space1 = mapData.getByType('space')[0]; * const space2 = mapData.getByType('space')[1]; * const directions = mapView.getDirections(space1, space2); * * return directions ? : null; * ``` */ declare const Path: react1.ForwardRefExoticComponent & { onDrawComplete?: () => void; } & react1.RefAttributes>; //#endregion //#region src/Navigation.d.ts type ParamsArray$4 = Parameters; type StreamAgentParameterNames$4 = ['directions', 'options']; /** * @interface */ type NavigationProps = TupleToObjectWithPropNames & { onDrawComplete?: () => void; }; /** * Navigation component. * * Navigation draws a route on the map with pre-defined Markers for connections and the start and end points. * * @category Components * * @example * ```tsx * const space1 = mapData.getByType('space')[0]; * const space2 = mapData.getByType('space')[1]; * const directions = mapView.getDirections(space1, space2); * * return directions ? : null; * ``` */ declare function Navigation(props: NavigationProps): null; //#endregion //#region src/Shape.d.ts type ParamsArray$3 = Parameters; type StreamAgentParameterNames$3 = ['geometry', 'style', 'floor']; /** * @interface */ type ShapeProps = TupleToObjectWithPropNames; /** * Shape component. * * A Shape is a custom geometry on the map created from a GeoJSON feature collection. * * @category Components * * @example * ```tsx * * ``` */ declare const Shape: react1.ForwardRefExoticComponent>; //#endregion //#region src/Model.d.ts type ParamsArray$2 = Parameters; type StreamAgentParameterNames$2 = ['coordinate', 'url', 'options']; /** * @interface */ type ModelProps = TupleToObjectWithPropNames; /** * Model component. * * A Model is a 3D model in GLTF or GLB format anchored to a Coordinate on the map. * * @category Components * * @example * ```tsx * * ``` */ declare const Model: react1.ForwardRefExoticComponent>; //#endregion //#region src/hooks/useMap.d.ts /** * Hook to get the MapData and MapView from the current MapView context. * * Must be used within a {@link MapView} component. * @throws If used outside of a {@link MapView} component. * * @category Hooks * * @example * ```tsx * const { mapData, mapView } = useMap(); * ``` */ declare function useMap(): { mapData: MapData; mapView: MapView$1; }; //#endregion //#region src/Marker.d.ts type ParamsArray$1 = Parameters; type StreamAgentParameterNames$1 = ['target', 'contentHtml', 'options']; /** * @interface */ type MarkerProps = Omit, 'contentHtml'>; /** * Marker component. * * A Marker is a 2D component anchored to a position on the map. * To animate the Marker when its target changes, see {@link AnimatedMarker}. * * @example * ```tsx * *
Hello, world!
*
* ``` * * @category Components */ declare const Marker: React.ForwardRefExoticComponent>; /** * AnimatedMarker component. * @experimental * * A {@link Marker} component that animates between positions when its target changes. * * @example * ```tsx * *
Hello, world!
*
* ``` * * @category Components */ declare const AnimatedMarker: React.ForwardRefExoticComponent>; //#endregion //#region src/Label.d.ts type ParamsArray = Parameters; type StreamAgentParameterNames = ['target', 'text', 'options']; /** * @interface */ type LabelProps = TupleToObjectWithPropNames; /** * Label component. * * A Label is a 2D text label anchored to a position on the map. * * @category Components * * @example * ```tsx *