@yandex/ymaps3-types
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -26,3 +26,2 @@ import type { WorldCoordinates } from './coordinates'; | ||
}[]; | ||
declare type TileGenerator = (x: number, y: number, z: number) => Promise<GeneratedTileSource>; | ||
interface WorldHotspot { | ||
@@ -39,9 +38,12 @@ readonly type: 'world'; | ||
declare type Hotspot = WorldHotspot | RenderedHotspot; | ||
declare type GeneratedTileSource = HTMLImageElement | ImageBitmap; | ||
interface FetchedTile { | ||
image: HTMLImageElement | HTMLCanvasElement | ImageBitmap; | ||
} | ||
declare type FetchTileFunction = (x: number, y: number, z: number, scale: number, signal: AbortSignal) => Promise<FetchedTile>; | ||
declare type ComposeTileUrlFunction = (x: number, y: number, z: number, scale: number, signal: AbortSignal) => string; | ||
/** | ||
* Provides hotspots for given tile coordinates and zoom. | ||
* @param x | ||
* @param y | ||
* @param z | ||
* @param tileSize same as `size` in corresponding data source | ||
* @param x Tile X | ||
* @param y Tile Y | ||
* @param z Tile Z | ||
* @param signal is used to abort request in case if hotspots for given tile are no longer required | ||
@@ -52,6 +54,11 @@ */ | ||
/** | ||
* String: tile will be downloaded from given url and inserted into tile layer | ||
* TileGenerator function: tile data is acquired from generator function and inserted into tile layer | ||
* Either template tile url: | ||
* - {{x}} {{y}} {{z}} placeholders for tile coordinates | ||
* - {{scale}} placeholders for pixel scale (e.g. retina is 2) | ||
* Or function that returns final url. | ||
* Or function that fetches tile manually. | ||
*/ | ||
tileUrl: string | TileGenerator; | ||
fetchTile: string | ComposeTileUrlFunction | FetchTileFunction; | ||
/** Name of data provided by this data source. Should be referenced in layer. */ | ||
type: string; | ||
/** Tile size in pixels. Default is 256. */ | ||
@@ -113,2 +120,2 @@ size?: number; | ||
} | ||
export { VectorCustomization, RasterTileDataSourceDescription, FetchHotspotsFunction, VectorTileDataSourceDescription, VectorTileSize, VectorObjectsCollisionPriority, VectorDataSourcePriority, HotspotsOptions, TileGenerator, Hotspot, WorldHotspot, RenderedHotspot, GeneratedTileSource, MapTheme }; | ||
export { VectorCustomization, RasterTileDataSourceDescription, FetchHotspotsFunction, VectorTileDataSourceDescription, VectorTileSize, VectorObjectsCollisionPriority, VectorDataSourcePriority, HotspotsOptions, FetchTileFunction, ComposeTileUrlFunction, Hotspot, WorldHotspot, RenderedHotspot, FetchedTile, MapTheme }; |
@@ -1,1 +0,1 @@ | ||
export declare type MapMode = 'raster' | 'vector'; | ||
export declare type MapMode = 'raster' | 'vector' | 'auto'; |
interface WorldOptions { | ||
readonly cycledX: boolean; | ||
readonly cycledY: boolean; | ||
} | ||
export { WorldOptions }; |
@@ -1,2 +0,2 @@ | ||
import type { LngLat } from '@yandex/ymaps3-types/common/types'; | ||
import type { LngLat } from "../common/types"; | ||
declare const geolocation: { | ||
@@ -3,0 +3,0 @@ getPosition: typeof getPosition; |
@@ -1,23 +0,20 @@ | ||
export { YMap, YMapProps, YMapCenterLocation, YMapZoomLocation, YMapBoundsLocation, YMapCenterZoomLocation, YMapLocationRequest, YMapCopyrightsPosition } from './YMap'; | ||
export { YMapEntity, YMapComplexEntity, YMapGroupEntity } from './YMapEnities'; | ||
export { YMapDefaultFeaturesLayer, YMapDefaultFeaturesLayerProps } from './YMapDefaultFeaturesLayer'; | ||
export { YMapDefaultSchemeLayer, YMapDefaultSchemeLayerProps } from './YMapDefaultSchemeLayer'; | ||
export * from './YMapFeature'; | ||
export { YMapFeatureDataSource, YMapFeatureDataSourceProps } from './YMapFeatureDataSource'; | ||
export { YMapLayer, YMapLayerProps } from './YMapLayer'; | ||
export * from './YMapListener'; | ||
export * from './YMapHotspot'; | ||
export { YMapMarker, YMapMarkerProps, YMapMarkerEventHandler } from './YMapMarker'; | ||
export { YMapTileDataSource, YMapTileDataSourceProps } from './YMapTileDataSource'; | ||
export { YMapControls, YMapControlsProps } from './YMapControls'; | ||
export { YMapControl, YMapControlProps, YMapControlButton, YMapControlButtonProps } from './YMapControl'; | ||
export { YMapCollection } from './YMapCollection'; | ||
export { yandexMaps } from './yandexMaps'; | ||
export { search, SearchOptions, SearchResponse } from './search'; | ||
export { suggest, SuggestOptions, SuggestResponse } from './suggest'; | ||
export { geolocation } from './geolocation'; | ||
export { YMapReactContainer } from './YMapReactContainer'; | ||
export { useDomContext } from './DomContext'; | ||
/** @deprecated Use YMapEntity etc. instead */ | ||
export * as __implEntities from './Entities'; | ||
export type { LngLat, ReadonlyLngLat, LngLatBounds, BehaviorType, MapMode, Margin, ZoomRange, ZoomStrategy, ZoomRounding, VectorCustomization, RasterTileDataSourceDescription, VectorTileDataSourceDescription, RasterLayerOptions, EasingFunctionDescription, EasingPresetName, EasingBezierPreset, EasingFunction, DrawingStyle, DrawingStyleIcon, VectorTileSize, VectorObjectsCollisionPriority, VectorDataSourcePriority } from '@yandex/ymaps3-types/common/types'; | ||
export { YMap, YMapProps, YMapCenterLocation, YMapZoomLocation, YMapBoundsLocation, YMapCenterZoomLocation, YMapLocationRequest, YMapCopyrightsPosition } from "./YMap"; | ||
export { YMapEntity, YMapComplexEntity, YMapGroupEntity, YMapContext } from "./YMapEnities"; | ||
export { YMapDefaultFeaturesLayer, YMapDefaultFeaturesLayerProps } from "./YMapDefaultFeaturesLayer"; | ||
export { YMapDefaultSchemeLayer, YMapDefaultSchemeLayerProps } from "./YMapDefaultSchemeLayer"; | ||
export * from "./YMapFeature"; | ||
export { YMapFeatureDataSource, YMapFeatureDataSourceProps } from "./YMapFeatureDataSource"; | ||
export { YMapLayer, YMapLayerProps } from "./YMapLayer"; | ||
export * from "./YMapListener"; | ||
export * from "./YMapHotspot"; | ||
export { YMapMarker, YMapMarkerProps, YMapMarkerEventHandler } from "./YMapMarker"; | ||
export { YMapTileDataSource, YMapTileDataSourceProps } from "./YMapTileDataSource"; | ||
export { YMapControls, YMapControlsProps } from "./YMapControls"; | ||
export { YMapControl, YMapControlProps, YMapControlButton, YMapControlButtonProps, YMapControlCommonButton } from "./YMapControl"; | ||
export { YMapCollection } from "./YMapCollection"; | ||
export { yandexMaps } from "./yandexMaps"; | ||
export { search, SearchOptions, SearchResponse } from "./search"; | ||
export { suggest, SuggestOptions, SuggestResponse } from "./suggest"; | ||
export { geolocation } from "./geolocation"; | ||
export { useDomContext } from "./DomContext"; | ||
export type { LngLat, ReadonlyLngLat, LngLatBounds, BehaviorType, MapMode, Margin, ZoomRange, ZoomStrategy, ZoomRounding, VectorCustomization, RasterTileDataSourceDescription, VectorTileDataSourceDescription, RasterLayerOptions, EasingFunctionDescription, EasingPresetName, EasingBezierPreset, EasingFunction, DrawingStyle, DrawingStyleIcon, VectorTileSize, VectorObjectsCollisionPriority, VectorDataSourcePriority } from "@yandex/ymaps3-types/common/types"; |
@@ -1,2 +0,2 @@ | ||
import type { LngLat, LngLatBounds } from '@yandex/ymaps3-types/common/types'; | ||
import type { LngLat, LngLatBounds } from "../common/types"; | ||
declare const geocoderSearchTypes: { | ||
@@ -74,3 +74,3 @@ businesses: string; | ||
geometry?: { | ||
type: 'Point'; | ||
type: "Point"; | ||
coordinates: LngLat; | ||
@@ -77,0 +77,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import type { LngLat, LngLatBounds } from '@yandex/ymaps3-types/common/types'; | ||
import type { LngLat, LngLatBounds } from "../common/types"; | ||
declare const geoSuggestTypes: { | ||
@@ -19,5 +19,8 @@ all: string; | ||
}; | ||
declare type ObjectType = 'unknown' | 'toponym' | 'business' | 'transit'; | ||
declare type ObjectType = "unknown" | "toponym" | "business" | "transit"; | ||
/** Positions of chars to highlight between */ | ||
declare type Highlight = [number, number]; | ||
declare type Highlight = [ | ||
number, | ||
number | ||
]; | ||
declare type TextWithHighlight = { | ||
@@ -24,0 +27,0 @@ text: string; |
@@ -1,2 +0,2 @@ | ||
import type { ReadonlyLngLat, ZoomRange } from '@yandex/ymaps3-types/common/types'; | ||
import type { ReadonlyLngLat, ZoomRange } from "../../common/types"; | ||
export declare type LayerInfo = { | ||
@@ -3,0 +3,0 @@ id: string; |
@@ -1,2 +0,2 @@ | ||
import type { ZoomRange } from '@yandex/ymaps3-types/common/types'; | ||
import type { ZoomRange } from "../../common/types"; | ||
export interface TilesVersion { | ||
@@ -16,3 +16,3 @@ version: string; | ||
*/ | ||
declare type Environment = 'production' | 'testing'; | ||
declare type Environment = "production" | "testing"; | ||
/** | ||
@@ -19,0 +19,0 @@ * Metadata configuration for map inner workings |
@@ -1,8 +0,6 @@ | ||
import type { BehaviorType, LngLat, MapMode, Margin, PixelCoordinates, Projection, ReadonlyLngLat, LngLatBounds, ZoomRange, ZoomRounding, WorldOptions, ZoomStrategy, Camera, EasingFunctionDescription } from '@yandex/ymaps3-types/common/types'; | ||
import { GenericRootEntity, GenericEntity } from '../Entities'; | ||
import { YMapCopyrightsPosition } from '../YMapCopyrights'; | ||
import { Config } from '../config'; | ||
import { reactify } from '../../react'; | ||
import type { BehaviorType, LngLat, MapMode, Margin, PixelCoordinates, Projection, ReadonlyLngLat, LngLatBounds, ZoomRange, ZoomRounding, WorldOptions, ZoomStrategy, EasingFunctionDescription } from "../../common/types"; | ||
import { GenericRootEntity, GenericEntity } from "../Entities"; | ||
import { YMapCopyrightsPosition } from "../YMapCopyrights"; | ||
import { Config } from "../config"; | ||
import { reactify } from "../../reactify"; | ||
/** | ||
@@ -37,4 +35,7 @@ * Sets map center. | ||
*/ | ||
export declare type YMapCamera = Omit<Camera, 'worldCenter'> & { | ||
center: LngLat; | ||
export declare type YMapCamera = { | ||
/** Map tilt in radians. Can take values from 0 to 45 degrees (degrees * (Math.PI / 180)) */ | ||
tilt?: number; | ||
/** Map rotation in degrees. Can take values from -180 to 180 degrees */ | ||
azimuth?: number; | ||
}; | ||
@@ -50,7 +51,3 @@ /** | ||
}; | ||
export interface YMapCameraRequest { | ||
/** Map tilt in radians. Can take values from 0 to 45 degrees (degrees * (Math.PI / 180)) */ | ||
tilt?: number; | ||
/** Map rotation in degrees. Can take values from 0 to 180 degrees */ | ||
azimuth?: number; | ||
export declare type YMapCameraRequest = YMapCamera & { | ||
/** Animation duration */ | ||
@@ -60,3 +57,3 @@ duration?: number; | ||
easing?: EasingFunctionDescription; | ||
} | ||
}; | ||
/** | ||
@@ -72,3 +69,3 @@ * YMap props | ||
camera?: YMapCameraRequest; | ||
/** Map mode, 'vector' (default) or 'raster'. */ | ||
/** Map mode, 'auto' (default. Show raster tiles while vector tiles are loading), 'raster' or 'vector' (without raster preloading). */ | ||
mode?: MapMode; | ||
@@ -89,6 +86,4 @@ /** Active behaviors */ | ||
config?: Config; | ||
/** Disable raster tiles loading while vector tiles are loading */ | ||
disableRasterPreload?: boolean; | ||
/** Strategy for fetching hotspots, for whole viewport or for tiles that pointer is hovering at */ | ||
hotspotsStrategy?: 'forViewport' | 'forPointerPosition'; | ||
hotspotsStrategy?: "forViewport" | "forPointerPosition"; | ||
/** | ||
@@ -120,6 +115,5 @@ * Whether to show map copyrights. | ||
}; | ||
mode: "vector"; | ||
mode: "auto"; | ||
zoomRounding: "auto"; | ||
hotspotsStrategy: "forViewport" | "forPointerPosition"; | ||
disableRasterPreload: false; | ||
zoomRange: ZoomRange; | ||
@@ -152,4 +146,4 @@ zoomStrategy: "zoomToPointer"; | ||
* map.setLocation({center: [48.707067, 44.516975], duration: 200}); | ||
* // change mode from default `raster` to `vector` | ||
* map.setMode('vector'); | ||
* // change mode from default `auto` to `raster` | ||
* map.setMode('raster'); | ||
* // get map zoom for some calculations | ||
@@ -167,6 +161,5 @@ * const zoom = map.zoom; | ||
}; | ||
mode: "vector"; | ||
mode: "auto"; | ||
zoomRounding: "auto"; | ||
hotspotsStrategy: "forViewport" | "forPointerPosition"; | ||
disableRasterPreload: false; | ||
zoomRange: ZoomRange; | ||
@@ -185,3 +178,3 @@ zoomStrategy: "zoomToPointer"; | ||
}>; | ||
static [reactify.overrideKey]: import("../../react/reactify").CustomReactify<YMap, import("react").ForwardRefExoticComponent<YMapProps & { | ||
static [reactify.overrideKey]: import("../../reactify/reactify").CustomReactify<YMap, import("react").ForwardRefExoticComponent<YMapProps & { | ||
children?: import("react").ReactNode; | ||
@@ -273,3 +266,3 @@ } & import("react").RefAttributes<GenericRootEntity<YMapProps & { | ||
private _createMap; | ||
private _getEffectiveMode; | ||
private _correctMode; | ||
protected _onUpdate(propsDiff: Partial<YMapProps>): void; | ||
@@ -276,0 +269,0 @@ private _loadVector; |
import { DomEntity } from '../DomContext'; | ||
import { reactify } from '../../react'; | ||
import { reactify } from '../../reactify'; | ||
/** | ||
@@ -35,3 +35,3 @@ * YMapControl props | ||
export declare class YMapControl<T extends YMapControlProps = YMapControlProps> extends DomEntity<T> { | ||
static [reactify.overrideKey]: import("../../react/reactify").CustomReactify<YMapControl<YMapControlProps>, import("react").ForwardRefExoticComponent<{ | ||
static [reactify.overrideKey]: import("../../reactify/reactify").CustomReactify<YMapControl<YMapControlProps>, import("react").ForwardRefExoticComponent<{ | ||
children?: import("react").ReactNode; | ||
@@ -38,0 +38,0 @@ } & import("react").RefAttributes<import("../Entities").GenericEntity<{ |
@@ -1,3 +0,3 @@ | ||
import type { VectorCustomization } from '@yandex/ymaps3-types/common/types'; | ||
import { YMapComplexEntity } from '../YMapEnities'; | ||
import type { VectorCustomization } from "../../common/types"; | ||
import { YMapComplexEntity } from "../YMapEnities"; | ||
/** | ||
@@ -17,3 +17,3 @@ * YMapDefaultSchemeLayer props | ||
/** Theme applied to the scheme */ | ||
theme?: 'dark' | 'light'; | ||
theme?: "dark" | "light"; | ||
}; | ||
@@ -23,2 +23,3 @@ declare const defaultProps: { | ||
source: string; | ||
/** @internal */ | ||
hotspotsEnabled: boolean; | ||
@@ -61,2 +62,3 @@ layersInfo: { | ||
source: string; | ||
/** @internal */ | ||
hotspotsEnabled: boolean; | ||
@@ -63,0 +65,0 @@ layersInfo: { |
import type { YMap } from './YMap'; | ||
import { GenericComplexEntity, GenericEntity, GenericGroupEntity } from './Entities'; | ||
import { GenericComplexEntity, GenericEntity, GenericGroupEntity, Context } from './Entities'; | ||
declare abstract class YMapEntity<Props, DefaultProps = {}> extends GenericEntity<Props, DefaultProps, YMap> { | ||
@@ -9,2 +9,2 @@ } | ||
} | ||
export { YMapEntity, YMapComplexEntity, YMapGroupEntity }; | ||
export { YMapEntity, YMapComplexEntity, YMapGroupEntity, Context as YMapContext }; |
@@ -1,5 +0,5 @@ | ||
import type { DrawingStyle } from '@yandex/ymaps3-types/common/types'; | ||
import type { DraggableProps, FeatureClickEvents } from './types'; | ||
import { YMapEntity } from '../YMapEnities'; | ||
import type { Geometry, YMapFeatureEventHandler } from './types'; | ||
import type { DrawingStyle } from "../../common/types"; | ||
import type { DraggableProps, FeatureClickEvents } from "./types"; | ||
import { YMapEntity } from "../YMapEnities"; | ||
import type { Geometry, YMapFeatureEventHandler } from "./types"; | ||
/** | ||
@@ -6,0 +6,0 @@ * YMapFeature props |
@@ -1,2 +0,2 @@ | ||
import type { LineStringGeometry, Margin, MultiLineStringGeometry, MultiPolygonGeometry, PointGeometry, PolygonGeometry } from '@yandex/ymaps3-types/common/types'; | ||
import type { LineStringGeometry, Margin, MultiLineStringGeometry, MultiPolygonGeometry, PointGeometry, PolygonGeometry } from "../../common/types"; | ||
export interface DraggableProps<Callback> { | ||
@@ -37,2 +37,2 @@ /** Feature can be draggable */ | ||
*/ | ||
export declare type YMapFeatureEventHandler = (coordinates: Geometry['coordinates']) => void | false; | ||
export declare type YMapFeatureEventHandler = (coordinates: Geometry["coordinates"]) => void | false; |
@@ -1,7 +0,11 @@ | ||
import { YMapEntity } from '../YMapEnities'; | ||
import type { HotspotObject } from '@yandex/ymaps3-types/common/types'; | ||
interface YMapHotspot extends HotspotObject { | ||
import type { GenericGeometry, LngLat } from "../../common/types"; | ||
/** | ||
* This is not a real YMapEntity, it cannot be added to the map. | ||
* But you can check it by `instance of` in YMapListener handlers | ||
*/ | ||
declare class YMapHotspot { | ||
readonly geometry?: GenericGeometry<LngLat>; | ||
readonly properties: Record<string, unknown>; | ||
constructor(geometry: GenericGeometry<LngLat> | undefined, properties: Record<string, unknown>); | ||
} | ||
declare class YMapHotspot extends YMapEntity<{}> { | ||
} | ||
export { YMapHotspot }; |
@@ -1,3 +0,3 @@ | ||
import type { RasterLayerOptions } from '@yandex/ymaps3-types/common/types'; | ||
import { YMapEntity } from '../YMapEnities'; | ||
import type { RasterLayerOptions } from "../../common/types"; | ||
import { YMapEntity } from "../YMapEnities"; | ||
/** | ||
@@ -4,0 +4,0 @@ * YMapLayer props |
@@ -1,18 +0,45 @@ | ||
import type { Camera, IndoorPlan, PixelCoordinates, Projection } from '@yandex/ymaps3-types/common/types'; | ||
import type { BehaviorType, LngLat } from '@yandex/ymaps3-types/common/types'; | ||
import { YMapEntity } from '../YMapEnities'; | ||
import { YMapHotspot } from '../YMapHotspot'; | ||
import type { IndoorPlan, PixelCoordinates } from "../../common/types"; | ||
import { YMapFeature } from "../YMapFeature"; | ||
import { YMapMarker } from "../YMapMarker"; | ||
import type { BehaviorType, LngLat } from "../../common/types"; | ||
import { YMapEntity } from "../YMapEnities"; | ||
import { YMapHotspot } from "../YMapHotspot"; | ||
import type { YMapCamera, YMapLocation } from "../YMap"; | ||
export interface DomEvent { | ||
coordinates: LngLat; | ||
screenCoordinates: [number, number]; | ||
screenCoordinates: [ | ||
number, | ||
number | ||
]; | ||
} | ||
export declare type DomEventHandler = (object: YMapEntity<unknown> | YMapHotspot | undefined, event: DomEvent) => void; | ||
export declare type YMapCamera = Camera & { | ||
center: LngLat; | ||
fov: number; | ||
declare type HandlerEntity<TType extends string, TEntity> = { | ||
type: TType; | ||
entity: TEntity; | ||
}; | ||
export declare type MapEventHandler = (camera: YMapCamera, size: Readonly<PixelCoordinates>, projection: Projection, mapInAction: boolean) => void; | ||
export declare type BehaviorEventHandler = (behavior: BehaviorType) => void; | ||
export declare type IndoorPlansHandler = (plans: readonly IndoorPlan[] | null) => void; | ||
export declare type BehaviorMapEventHandler = (behavior: BehaviorType, camera: YMapCamera, size: Readonly<PixelCoordinates>, projection: Projection) => void; | ||
export declare type DomEventHandlerObject = HandlerEntity<"feature", YMapFeature> | HandlerEntity<"marker", YMapMarker> | HandlerEntity<"hotspot", YMapHotspot> | undefined; | ||
export declare type DomEventHandler = (object: DomEventHandlerObject, event: DomEvent) => void; | ||
declare type Location = Required<YMapLocation>; | ||
interface UpdateObject { | ||
type: "update"; | ||
location: Location; | ||
camera: YMapCamera; | ||
mapInAction: boolean; | ||
} | ||
interface ResizeObject { | ||
type: "resize"; | ||
size: Readonly<PixelCoordinates>; | ||
mapInAction: boolean; | ||
} | ||
declare type MapEventHandler<TObject> = (object: TObject) => void; | ||
export declare type MapEventUpdateHandler = MapEventHandler<UpdateObject>; | ||
export declare type MapEventResizeHandler = MapEventHandler<ResizeObject>; | ||
export declare type IndoorPlansHandler = (object: { | ||
type: IndoorPlanType; | ||
indoorPlans: readonly IndoorPlan[] | null; | ||
}) => void; | ||
export declare type BehaviorMapEventHandler = (object: { | ||
type: BehaviorType; | ||
location: Location; | ||
camera: YMapCamera; | ||
}) => void; | ||
export declare type DomEvents = { | ||
@@ -39,4 +66,4 @@ onTouchStart: DomEventHandler; | ||
export declare type MapEvents = { | ||
onUpdate: MapEventHandler; | ||
onResize: MapEventHandler; | ||
onUpdate: MapEventUpdateHandler; | ||
onResize: MapEventResizeHandler; | ||
/** @internal */ | ||
@@ -46,5 +73,6 @@ onIndoorPlansChanged: IndoorPlansHandler; | ||
export declare type BehaviorEvents = { | ||
onActionStart: BehaviorEventHandler; | ||
onActionStart: BehaviorMapEventHandler; | ||
onActionEnd: BehaviorMapEventHandler; | ||
}; | ||
declare type IndoorPlanType = "indoorPlansChanged"; | ||
export declare type NullablePartial<T> = { | ||
@@ -79,4 +107,3 @@ [P in keyof T]?: T[P] | null; | ||
private _subscribeMapIndoorPlansEvent; | ||
private _subscribeActionStartEvent; | ||
private _subscribeActionEndEvent; | ||
private _subscribeActionEvent; | ||
private _subscribe; | ||
@@ -83,0 +110,0 @@ private _unsubscribe; |
@@ -1,5 +0,5 @@ | ||
import type { LngLat } from '@yandex/ymaps3-types/common/types'; | ||
import type { DraggableProps, FeatureClickEvents } from '../YMapFeature/types'; | ||
import { reactify } from '../../react'; | ||
import { YMapGroupEntity } from '../YMapEnities'; | ||
import type { LngLat } from "../../common/types"; | ||
import type { DraggableProps, FeatureClickEvents } from "../YMapFeature/types"; | ||
import { reactify } from "../../reactify"; | ||
import { YMapGroupEntity } from "../YMapEnities"; | ||
/** | ||
@@ -56,3 +56,3 @@ * YMapMarker events handler | ||
}>; | ||
static [reactify.overrideKey]: import("../../react/reactify").CustomReactify<YMapMarker, import("react").ForwardRefExoticComponent<{ | ||
static [reactify.overrideKey]: import("../../reactify/reactify").CustomReactify<YMapMarker, import("react").ForwardRefExoticComponent<{ | ||
/** Coordinates of the marker */ | ||
@@ -92,2 +92,3 @@ coordinates: LngLat; | ||
private __feature; | ||
get properties(): Record<string, unknown> | undefined; | ||
_onAttach(): void; | ||
@@ -94,0 +95,0 @@ _onDetach(): void; |
import type TReact from 'react'; | ||
import type { Context } from '../Entities'; | ||
import { reactify } from '../../react'; | ||
import { reactify } from '../../reactify'; | ||
import { YMapGroupEntity } from '../YMapEnities'; | ||
@@ -24,3 +24,3 @@ interface YMapReactContainerPropsImpl<TContext> { | ||
}; | ||
static [reactify.overrideKey]: import("../../react/reactify").CustomReactify<YMapReactContainer, TReact.FC<YMapReactContainerProps<unknown> & { | ||
static [reactify.overrideKey]: import("../../reactify/reactify").CustomReactify<YMapReactContainer, TReact.FC<YMapReactContainerProps<unknown> & { | ||
children?: TReact.ReactNode; | ||
@@ -27,0 +27,0 @@ }>>; |
@@ -1,3 +0,3 @@ | ||
import type { RasterTileDataSourceDescription, ZoomRange } from '@yandex/ymaps3-types/common/types'; | ||
import { YMapEntity } from '../YMapEnities'; | ||
import type { RasterTileDataSourceDescription, ZoomRange } from "../../common/types"; | ||
import { YMapEntity } from "../YMapEnities"; | ||
/** | ||
@@ -28,4 +28,4 @@ * YMapTileDataSource props | ||
* const layer = new YMapLayer({ | ||
* id: 'myLayer', | ||
* source: 'mySource', | ||
* id: 'layer-source-ground', | ||
* source: 'source', | ||
* type: 'ground', | ||
@@ -41,5 +41,6 @@ * raster: { | ||
* map.addChild(new YMapTileDataSource({ | ||
* id: 'mySource', | ||
* id: 'source', | ||
* raster: { | ||
* tileUrl: '<your_host>/tiles?x={{x}}&y={{y}}&z={{z}}&scale={{scale}}&lang=ru_RU' | ||
* type: 'ground', | ||
* fetchTile: 'https://my.host.example/tiles?x={{x}}&y={{y}}&z={{z}}&scale={{scale}}' | ||
* }, | ||
@@ -46,0 +47,0 @@ * zoomRange: {min: 0, max: 19}, |
@@ -1,48 +0,12 @@ | ||
import type { Import } from './utils/import-types'; | ||
import * as react from './react'; | ||
import * as imperative from './imperative'; | ||
import './modules/types'; | ||
import './packages/types'; | ||
declare const __implImport: Import; | ||
declare const ready: Promise<void>; | ||
declare const _default: { | ||
ready: Promise<void>; | ||
import: Import; | ||
reactify: Readonly<react.Reactify>; | ||
YMap: typeof imperative.YMap; | ||
YMapEntity: typeof imperative.YMapEntity; | ||
YMapComplexEntity: typeof imperative.YMapComplexEntity; | ||
YMapGroupEntity: typeof imperative.YMapGroupEntity; | ||
YMapDefaultFeaturesLayer: typeof imperative.YMapDefaultFeaturesLayer; | ||
YMapDefaultSchemeLayer: typeof imperative.YMapDefaultSchemeLayer; | ||
YMapFeatureDataSource: typeof imperative.YMapFeatureDataSource; | ||
YMapLayer: typeof imperative.YMapLayer; | ||
YMapMarker: typeof imperative.YMapMarker; | ||
YMapTileDataSource: typeof imperative.YMapTileDataSource; | ||
YMapControls: typeof imperative.YMapControls; | ||
YMapControl: typeof imperative.YMapControl; | ||
YMapControlButton: typeof imperative.YMapControlButton; | ||
YMapCollection: typeof imperative.YMapCollection; | ||
yandexMaps: { | ||
getLink: (map: imperative.YMap) => string; | ||
open: (map: imperative.YMap) => void; | ||
}; | ||
search: typeof imperative.search; | ||
suggest: typeof imperative.suggest; | ||
geolocation: { | ||
getPosition: typeof import("./imperative/geolocation").getPosition; | ||
}; | ||
YMapReactContainer: typeof imperative.YMapReactContainer; | ||
useDomContext: typeof imperative.useDomContext; | ||
__implEntities: typeof imperative.__implEntities; | ||
YMapFeature: typeof imperative.YMapFeature; | ||
YMapListener: typeof imperative.YMapListener; | ||
YMapHotspot: typeof imperative.YMapHotspot; | ||
}; | ||
export default _default; | ||
export * from './imperative'; | ||
export * from './react'; | ||
export { ready, __implImport as import }; | ||
export const ready: Promise<void>; | ||
declare const import_: import('./import').Import; | ||
export {import_ as import}; | ||
declare global { | ||
const ymaps3: typeof import('./index'); | ||
} |
@@ -1,3 +0,3 @@ | ||
import type { LngLat, DrawingStyle, GenericLineStringGeometry, GenericPolygonGeometry } from '@yandex/ymaps3-types/common/types'; | ||
import type { DomEntity } from '../../../imperative/DomContext'; | ||
import type { LngLat, DrawingStyle, GenericLineStringGeometry, GenericPolygonGeometry } from "../../../common/types"; | ||
import type { DomEntity } from "../../../imperative/DomContext"; | ||
export declare type Geometry = GenericPolygonGeometry<LngLat> | GenericLineStringGeometry<LngLat>; | ||
@@ -4,0 +4,0 @@ export interface DraggingPoint { |
@@ -1,3 +0,3 @@ | ||
import type { LngLat, Projection } from '@yandex/ymaps3-types/common/types'; | ||
import type { PreviewPoint } from './interface'; | ||
import type { LngLat, Projection } from "../../../common/types"; | ||
import type { PreviewPoint } from "./interface"; | ||
declare function getPointWorld(point: LngLat): number; | ||
@@ -4,0 +4,0 @@ declare function findPointProjectionOnLine(projection: Projection, lineCoordinates: LngLat[], point: LngLat, lineWidth: number, zoom: number): PreviewPoint | undefined; |
@@ -1,3 +0,3 @@ | ||
import '../utils/import-types'; | ||
declare module '../utils/import-types' { | ||
import '../import'; | ||
declare module '../import' { | ||
interface Import { | ||
@@ -7,3 +7,4 @@ (pkg: '@yandex/ymaps3-utils'): Promise<typeof import('./utils')>; | ||
(pkg: '@yandex/ymaps3-controls-extra'): Promise<typeof import('./controls-extra')>; | ||
(pkg: '@yandex/ymaps3-reactify'): Promise<typeof import('../reactify')>; | ||
} | ||
} |
import { YMapComplexEntity, YMapEntity } from '../../../imperative/YMapEnities'; | ||
import type { YMapHotspot } from '../../../imperative/YMapHotspot'; | ||
declare type YMapCursorProps = { | ||
@@ -8,3 +9,3 @@ /** Layer to follow */ | ||
/** Function to control active cursor state */ | ||
isActive?: (object?: YMapEntity<unknown>) => boolean; | ||
isActive?: (object?: YMapEntity<unknown> | YMapHotspot) => boolean; | ||
}; | ||
@@ -14,3 +15,3 @@ declare const defaultProps: Readonly<{ | ||
cursor: "pointer"; | ||
isActive: (object: YMapEntity<unknown>) => boolean; | ||
isActive: (object: YMapEntity<unknown> | YMapHotspot) => boolean; | ||
}>; | ||
@@ -22,3 +23,3 @@ declare type DefaultProps = typeof defaultProps; | ||
cursor: "pointer"; | ||
isActive: (object: YMapEntity<unknown, {}>) => boolean; | ||
isActive: (object: YMapHotspot | YMapEntity<unknown, {}>) => boolean; | ||
}>; | ||
@@ -25,0 +26,0 @@ constructor(props: YMapCursorProps); |
{ | ||
"name": "@yandex/ymaps3-types", | ||
"version": "0.0.4", | ||
"description": "Types for YMaps3 maps library", | ||
"version": "0.0.5", | ||
"description": "Types for ymaps3 maps library", | ||
"main": "", | ||
@@ -6,0 +6,0 @@ "types": "index.d.ts", |
@@ -1,2 +0,2 @@ | ||
import type { Projection, LngLat, WorldCoordinates } from '@yandex/ymaps3-types/common/types'; | ||
import type { Projection, LngLat, WorldCoordinates } from "../../common/types"; | ||
/** | ||
@@ -40,5 +40,11 @@ * Создает проекцию прямоугольной координатной области в мировые координаты. | ||
private _yRange; | ||
constructor(bounds: [LngLat, LngLat], cycled?: [boolean, boolean]); | ||
constructor(bounds: [ | ||
LngLat, | ||
LngLat | ||
], cycled?: [ | ||
boolean, | ||
boolean | ||
]); | ||
toWorldCoordinates(point: LngLat): WorldCoordinates; | ||
fromWorldCoordinates(point: WorldCoordinates): LngLat; | ||
} |
@@ -1,4 +0,3 @@ | ||
import type { YMap } from '../../../imperative/YMap'; | ||
import type { YMapEntity } from '../../../imperative/YMapEnities'; | ||
import type { LngLat, WorldCoordinates, GenericPointFeature } from '@yandex/ymaps3-types/common/types'; | ||
import type { YMap, YMapEntity } from "../../.."; | ||
import type { LngLat, WorldCoordinates, GenericPointFeature } from "../../../common/types"; | ||
/** Represents object on a map (either cluster or feature) */ | ||
@@ -5,0 +4,0 @@ declare type ClustererObject = { |
@@ -1,7 +0,6 @@ | ||
import type TReact from 'react'; | ||
import type { LngLat } from '@yandex/ymaps3-types/common/types'; | ||
import type { YMapEntity } from '../../../../imperative/YMapEnities'; | ||
import type { Feature } from '../interface'; | ||
import type { YMapClusterer as YMapClustererI, YMapClustererProps } from '../YMapClusterer'; | ||
import type { CustomReactify } from '../../../../react/reactify'; | ||
import type TReact from "react"; | ||
import type { LngLat, YMapEntity } from "../../../.."; | ||
import type { CustomReactify } from "../../../../reactify/reactify"; | ||
import type { Feature } from "../interface"; | ||
import type { YMapClusterer as YMapClustererI, YMapClustererProps } from "../YMapClusterer"; | ||
/** | ||
@@ -8,0 +7,0 @@ * Create reactified version of YMapCluster module |
@@ -1,5 +0,5 @@ | ||
import type { LngLat } from '@yandex/ymaps3-types/common/types'; | ||
import { reactify } from '../../../react'; | ||
import { YMapEntity, YMapComplexEntity } from '../../../imperative/YMapEnities'; | ||
import type { ClustererObject, Feature, IClusterMethod } from './interface'; | ||
import type { YMapEntity } from "../../.."; | ||
import type { LngLat } from "../../../common/types"; | ||
import { reactify } from "../../../reactify"; | ||
import type { ClustererObject, Feature, IClusterMethod } from "./interface"; | ||
/** | ||
@@ -50,7 +50,7 @@ * YMapClusterer props | ||
*/ | ||
declare class YMapClusterer extends YMapComplexEntity<YMapClustererProps, DefaultProps> { | ||
declare class YMapClusterer extends ymaps3.YMapComplexEntity<YMapClustererProps, DefaultProps> { | ||
static defaultProps: Readonly<{ | ||
tickTimeout: 100; | ||
}>; | ||
static [reactify.overrideKey]: import("../../../react/reactify").CustomReactify<YMapClusterer, import("react").ForwardRefExoticComponent<YMapClustererProps & { | ||
static [reactify.overrideKey]: import("../../../reactify/reactify").CustomReactify<YMapClusterer, import("react").ForwardRefExoticComponent<YMapClustererProps & { | ||
marker: (feature: Feature) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; | ||
@@ -57,0 +57,0 @@ cluster: (coordinates: LngLat, features: Feature[]) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; |
@@ -1,4 +0,2 @@ | ||
import type { EasingFunctionDescription, LngLat } from '@yandex/ymaps3-types/common/types'; | ||
import { YMapGroupEntity } from '../../../imperative/YMapEnities'; | ||
import type { EasingFunctionDescription, LngLat } from "../../../common/types"; | ||
/** | ||
@@ -32,3 +30,3 @@ * YMapGeolocationControl props | ||
*/ | ||
declare class YMapGeolocationControl extends YMapGroupEntity<YMapGeolocationControlProps, DefaultProps> { | ||
declare class YMapGeolocationControl extends ymaps3.YMapGroupEntity<YMapGeolocationControlProps, DefaultProps> { | ||
static defaultProps: Readonly<{ | ||
@@ -35,0 +33,0 @@ duration: 500; |
import { DomEntity } from '../../../../imperative/DomContext'; | ||
declare class YMapControlSpinner extends DomEntity<{}> { | ||
protected _createDom(): HTMLElement; | ||
protected _updateDom(): void; | ||
declare class YMapControlSpinner extends ymaps3.YMapComplexEntity<{}> { | ||
private _detachDom?; | ||
protected _onAttach(): void; | ||
protected _onDetach(): void; | ||
} | ||
export { YMapControlSpinner }; |
@@ -1,5 +0,4 @@ | ||
import type { EasingFunctionDescription } from '@yandex/ymaps3-types/common/types'; | ||
import { YMapControl, YMapControlCommonButton } from '../../../imperative/YMapControl'; | ||
import { YMapListener } from '../../../imperative/YMapListener'; | ||
import type { EasingFunctionDescription } from "../../../common/types"; | ||
import type { YMapControlCommonButton } from "../../../imperative/YMapControl"; | ||
import type { YMapListener } from "../../../imperative/YMapListener"; | ||
/** | ||
@@ -29,3 +28,3 @@ * YMapZoomControl props | ||
*/ | ||
declare class YMapZoomControl extends YMapControl<YMapZoomControlProps> { | ||
declare class YMapZoomControl extends ymaps3.YMapControl<YMapZoomControlProps> { | ||
static defaultProps: Readonly<{ | ||
@@ -32,0 +31,0 @@ duration: 200; |
@@ -1,29 +0,10 @@ | ||
import type TReact from 'react'; | ||
import type { YMapFeature } from '../../../imperative/YMapFeature'; | ||
import type { CustomReactify } from '../../../react/reactify'; | ||
import { Context } from '../../../imperative/Entities'; | ||
import { reactify } from '../../../react'; | ||
import { YMapGroupEntity } from '../../../imperative/YMapEnities'; | ||
import type TReact from "react"; | ||
import type { YMapFeature, YMapMarker, YMapHotspot } from "../../../imperative"; | ||
import type { CustomReactify } from "../../../reactify/reactify"; | ||
import { reactify } from "../../../reactify"; | ||
declare type YMapHintProps = { | ||
hint: (object: YMapFeature | undefined) => unknown; | ||
hint: (object: YMapFeature | YMapMarker | YMapHotspot | undefined) => unknown; | ||
}; | ||
declare const YMapHintContext: Context<unknown>; | ||
/** | ||
* Display hint on map elements. | ||
* | ||
* @example | ||
* ```javascript | ||
* const {YMapHint, YMapHintContext} = await ymaps3.import('@yandex/ymaps3-hint@0.0.1'); | ||
* map.addChild(defaultFeatures = new YMapDefaultFeaturesLayer()); | ||
* map.addChild(YMapHint({ | ||
* layers: [defaultFeatures.layer], | ||
* hint: object => object?.properties?.hint | ||
* })); | ||
* | ||
* const {YMapDefaultMarker} = await ymaps3.import('@yandex/ymaps3-markers@0.0.1'); | ||
* map.addChild(new YMapDefaultMarker([53, 34])); | ||
* ``` | ||
*/ | ||
declare class YMapHint extends YMapGroupEntity<YMapHintProps> { | ||
declare const YMapHintContext: import("../../../imperative/Entities").Context<unknown>; | ||
declare class YMapHint extends ymaps3.YMapGroupEntity<YMapHintProps> { | ||
static [reactify.overrideKey]: CustomReactify<YMapHint, TReact.FC<YMapHintProps>>; | ||
@@ -35,3 +16,6 @@ private _destroyDomContext; | ||
constructor(props: YMapHintProps); | ||
_positionHintElement([x, y]: [number, number]): void; | ||
_positionHintElement([x, y]: [ | ||
number, | ||
number | ||
]): void; | ||
_toggleHint(add: boolean): void; | ||
@@ -38,0 +22,0 @@ _onAttach(): void; |
@@ -1,5 +0,3 @@ | ||
import { YMapMarkerProps } from '../../../imperative/YMapMarker'; | ||
import { YMapComplexEntity } from '../../../imperative/YMapEnities'; | ||
import { reactify } from '../../../react'; | ||
import type { YMapMarkerProps } from "../../../imperative/YMapMarker"; | ||
import { reactify } from "../../../reactify"; | ||
declare type DefaultMarkerCustomProps = { | ||
@@ -17,3 +15,3 @@ /** Marker title */ | ||
/** Popup position */ | ||
position: 'left' | 'right' | 'top'; | ||
position: "left" | "right" | "top"; | ||
/** Should popup hide marker. Default is false */ | ||
@@ -44,5 +42,5 @@ hidesMarker?: boolean; | ||
*/ | ||
declare class YMapDefaultMarker extends YMapComplexEntity<YMapDefaultMarkerProps, DefaultProps> { | ||
static [reactify.overrideKey]: import("../../../react/reactify").CustomReactify<YMapDefaultMarker, import("react").ForwardRefExoticComponent<{ | ||
coordinates: import("../../../core/common/types/lng-lat").LngLat; | ||
declare class YMapDefaultMarker extends ymaps3.YMapComplexEntity<YMapDefaultMarkerProps, DefaultProps> { | ||
static [reactify.overrideKey]: import("../../../reactify/reactify").CustomReactify<YMapDefaultMarker, import("react").ForwardRefExoticComponent<{ | ||
coordinates: import("../../../common/types/lng-lat").LngLat; | ||
source?: string | undefined; | ||
@@ -52,3 +50,3 @@ zIndex?: number | undefined; | ||
id?: string | undefined; | ||
} & import("../../../imperative/YMapFeature/types").DraggableProps<import("../../../imperative/YMapMarker").YMapMarkerEventHandler> & import("../../../imperative/YMapFeature/types").FeatureClickEvents & DefaultMarkerCustomProps & { | ||
} & import("../../../imperative/YMapFeature/types").DraggableProps<import("@yandex/ymaps3-types/imperative/YMapMarker").YMapMarkerEventHandler> & import("../../../imperative/YMapFeature/types").FeatureClickEvents & DefaultMarkerCustomProps & { | ||
children?: import("react").ReactNode; | ||
@@ -55,0 +53,0 @@ } & import("react").RefAttributes<import("../../../imperative/YMapEnities").YMapEntity<YMapDefaultMarkerProps, {}>>>>; |
@@ -1,5 +0,5 @@ | ||
import type TReactNamespace from 'react'; | ||
import type { CustomReactify } from '../../../../react/reactify'; | ||
import type { YMapEntity } from '../../../../imperative/YMapEnities'; | ||
import { YMapDefaultMarker, YMapDefaultMarkerProps } from '../index'; | ||
import type TReactNamespace from "react"; | ||
import type { CustomReactify } from "../../../../reactify/reactify"; | ||
import type { YMapEntity } from "../../../.."; | ||
import { YMapDefaultMarker, YMapDefaultMarkerProps } from "../index"; | ||
declare type YMapDefaultMarkerContainerProps = TReactNamespace.PropsWithChildren<YMapDefaultMarkerProps>; | ||
@@ -6,0 +6,0 @@ declare type YMapDefaultMarkerR = TReactNamespace.ForwardRefExoticComponent<YMapDefaultMarkerContainerProps & React.RefAttributes<YMapEntity<YMapDefaultMarkerProps>>>; |
@@ -1,2 +0,2 @@ | ||
import type { Projection, LngLat, WorldCoordinates } from '@yandex/ymaps3-types/common/types'; | ||
import type { Projection, LngLat, WorldCoordinates } from "../../common/types"; | ||
export declare class SphericalMercator implements Projection { | ||
@@ -3,0 +3,0 @@ private _subequator; |
@@ -1,3 +0,3 @@ | ||
import '../utils/import-types'; | ||
declare module '../utils/import-types' { | ||
import '../import'; | ||
declare module '../import' { | ||
interface Import { | ||
@@ -4,0 +4,0 @@ (pkg: '@yandex/ymaps3-cartesian-projection@0.0.1'): Promise<typeof import('./cartesian-projection')>; |
@@ -1,13 +0,9 @@ | ||
import type { GenericEntity, EntityConstructor } from '../imperative/Entities'; | ||
import { BaseModule, overrideKey, ReactifyEntity, ReactModule } from './reactify'; | ||
declare type TReact = typeof import('react'); | ||
declare type TReactDOM = typeof import('react-dom'); | ||
export declare type Reactify = { | ||
readonly overrideKey: typeof overrideKey; | ||
bindTo(React: TReact, ReactDOM: TReactDOM): { | ||
module: <TModule extends BaseModule>(module: TModule) => ReactModule<TModule>; | ||
entity<T extends EntityConstructor<GenericEntity<unknown>>>(...args: Parameters<ReactifyEntity<T>>): ReturnType<ReactifyEntity<T>>; | ||
}; | ||
import {Reactify, ReactifiedEntity, ReactifiedModule} from '../reactify'; | ||
type Module = ReactifiedModule<typeof import('../main')>; | ||
declare const module: Module & { | ||
reactify: Reactify; | ||
YMapReactContainer: ReactifiedEntity<typeof import('../imperative/YMapReactContainer').YMapReactContainer>; | ||
}; | ||
export declare const reactify: Readonly<Reactify>; | ||
export {}; | ||
export = module; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117
2909
110053
2