UNPKG

vue-yandex-maps

Version:
63 lines (62 loc) 2.58 kB
import { YMapEntity } from '@yandex/ymaps3-types'; import { Projection } from '@yandex/ymaps3-types/common/types'; import { ComputedRef, MaybeRefOrGetter, Ref } from 'vue'; export declare function provideMapRoot<T extends YMapEntity<any> = YMapEntity<any>>({ mapRootRef }?: { /** * @description Allows to use array instead of addChild mapRoot injection */ mapRootRef?: Ref<T[]>; }): { mapRootRef: Ref<T[], T[]> | import('vue').ShallowRef<any, any>; mapRootInitPromises: import('vue').ShallowRef<never[], never[]>; }; export declare function setupMapChildren<T extends YMapEntity<unknown> | Projection, R extends (() => Promise<unknown>)>({ returnOnly, willDeleteByHand, strictMapRoot, requiredImport, createFunction, settings, settingsUpdateIgnoreKeys, settingsUpdateFull, isLayer, isMercator, mapRoot: _mapRoot, index, }: { /** * @description Disables onBeforeUnmount hook */ willDeleteByHand?: boolean; /** * @description Disables children-to-root injection */ returnOnly?: boolean; /** * @description Requires map root to be present (map root can't be YMap in this case) */ strictMapRoot?: boolean; /** * @description result of provideMapRoot */ mapRoot?: ReturnType<typeof provideMapRoot>; /** * @description Promise to call before calling createFunction. Executes only after Yandex script has been injected */ requiredImport?: R; /** * @description Function that returns Yandex entity */ createFunction: (neededImport: Awaited<ReturnType<R>>) => T; /** * @description Entity reactive settings. If passed, will be auto-watched */ settings?: ComputedRef<Record<string, any>>; /** * @description Allows to not-update specific keys inside of settings watch */ settingsUpdateIgnoreKeys?: string[] | ComputedRef<string[]>; /** * @description skips diff check */ settingsUpdateFull?: boolean; /** * @description Specifies that entity is a layer children. Will be injected to layer ref instead of root and will skip YandexMap initialization */ isLayer?: boolean; /** * @description Specifies that entity is a layer children. Will be injected to layer ref instead of root and will skip YandexMap initialization, and will be added in special way to YandexMap */ isMercator?: boolean; /** * @description Index of the child for map collection. If not passed, will be added to the end */ index?: MaybeRefOrGetter<number | undefined>; }): Promise<T>;