import { YMapGroupEntity } from '../YMapEnities'; import type { Context } from '../Entities'; /** * YMapContextProvider props */ export type YMapContextProviderProps = { /** Context that will receive the provided value */ context: Context; /** Value to be provided in the context. */ value: T; }; /** * Context provider for YMap, allowing to inject a context and its value. * * ```javascript * const mapContextProvider = new YMapContextProvider({context: SomeMapContext, value: {your: 'value'}}); * map.addChild(mapContextProvider); * ``` * And define context consumer: * ```ts * class SomeContextConsumer extends ymaps3.YMapEntity<{}> { * constructor() { * super({}); * } * * _onAttach() { * const value = this._consumeContext(SomeMapContext); * console.log(value); // {your: 'value'} * } * } * ``` * When adding nested containers, the context will be available in them: * ```ts * mapContextProvider.addChild(new SomeContextConsumer()); * ``` * But the most important thing is that the context can be passed at any nesting level: * ```tsx * * * * * * * * ``` */ export declare class YMapContextProvider extends YMapGroupEntity> { protected _onAttach(): void; protected _onUpdate({ value }: Partial>): void; }