@yandex/ymaps3-types
Advanced tools
Comparing version 0.0.25 to 0.0.26
@@ -107,2 +107,3 @@ import type { WorldCoordinates } from "./coordinates"; | ||
type VectorObjectsCollisionPriority = 'low' | 'medium' | 'high' | 'ultra'; | ||
type VectorMapType = 'map' | 'driving' | 'transit' | 'admin'; | ||
interface VectorTileDataSourceDescription { | ||
@@ -147,5 +148,7 @@ /** Default is `'vmap2'` */ | ||
theme?: MapTheme; | ||
hdModeEnabled?: boolean; | ||
mapType?: VectorMapType; | ||
/** Defines how hotspots of type should be treated: enabled/disabled or use custom hotspots instead. */ | ||
hotspots?: Record<string, boolean | FetchHotspotsFunction | HotspotsOptions>; | ||
} | ||
export { VectorCustomizationTypes, VectorCustomizationElements, VectorCustomizationItem, VectorCustomization, RasterTileDataSourceDescription, FetchHotspotsFunction, VectorTileDataSourceDescription, VectorTileSize, VectorObjectsCollisionPriority, VectorDataSourcePriority, HotspotsOptions, FetchTileFunction, ComposeTileUrlFunction, Hotspot, WorldHotspot, RenderedHotspot, FetchedRasterTile, FetchedTile, FetchedCommonTile, MapTheme }; | ||
export { VectorCustomizationTypes, VectorCustomizationElements, VectorCustomizationItem, VectorCustomization, RasterTileDataSourceDescription, FetchHotspotsFunction, VectorTileDataSourceDescription, VectorTileSize, VectorObjectsCollisionPriority, VectorDataSourcePriority, VectorMapType, HotspotsOptions, FetchTileFunction, ComposeTileUrlFunction, Hotspot, WorldHotspot, RenderedHotspot, FetchedRasterTile, FetchedTile, FetchedCommonTile, MapTheme }; |
interface Apikeys { | ||
suggest?: string; | ||
router?: string; | ||
search?: string; | ||
} | ||
@@ -5,0 +6,0 @@ export declare class Config { |
@@ -1,2 +0,2 @@ | ||
import type { BaseRouteResponse, RouteFeature, RouteOptions, RawRoute } from "./interface"; | ||
import type { BaseRouteResponse, RawRoute, RouteFeature, RouteOptions } from "./interface"; | ||
export declare class DrivingRouteResponse implements BaseRouteResponse { | ||
@@ -7,2 +7,3 @@ #private; | ||
toRoute(): RouteFeature; | ||
toSteps(): RouteFeature[]; | ||
} |
import { Config } from "../config"; | ||
import type { BaseRouteResponse, RouteOptions, RouteFeature } from "./interface"; | ||
import type { BaseRouteResponse, RouteFeature, RouteOptions, TruckParameters } from "./interface"; | ||
export declare function route(options: RouteOptions, config?: Config | undefined): Promise<BaseRouteResponse[]>; | ||
export { RouteOptions, BaseRouteResponse, RouteFeature }; | ||
export { BaseRouteResponse, RouteFeature, RouteOptions, TruckParameters }; |
@@ -6,2 +6,3 @@ import type { GenericFeature, LineStringGeometry, LngLat, LngLatBounds } from "../../common/types"; | ||
mode: string; | ||
feature_class?: string; | ||
polyline: { | ||
@@ -28,3 +29,7 @@ points: LngLat[]; | ||
properties: { | ||
length?: number; | ||
duration?: number; | ||
mode?: string; | ||
bounds?: LngLatBounds; | ||
featureClass?: string; | ||
flags?: { | ||
@@ -39,8 +44,30 @@ hasTolls?: boolean; | ||
toRoute(): RouteFeature; | ||
/** Returns requested route, divided into steps, as {@link RouteFeature RouteFeature}[]. */ | ||
toSteps(): RouteFeature[]; | ||
} | ||
export interface TruckParameters { | ||
/** Vehicle weight in tons */ | ||
weight?: number; | ||
/** Actual vehicle axle load in tons */ | ||
axleWeight?: number; | ||
/** Maximum allowed vehicle weight in tons */ | ||
maxWeight?: number; | ||
/** Maximum vehicle load capacity in tons */ | ||
payload?: number; | ||
/** Vehicle height in meters */ | ||
height?: number; | ||
/** Vehicle width in meters */ | ||
width?: number; | ||
/** Vehicle length in meters */ | ||
length?: number; | ||
/** Vehicle emission standard (number from 1 to 6, for example, 1 corresponds to Euro-1 class) */ | ||
ecoClass?: number; | ||
/** Has a truck trailer */ | ||
hasTrailer?: boolean; | ||
} | ||
export interface RouteOptions { | ||
/** Route points represented by {@link LngLat LngLat} coordinates. */ | ||
points: LngLat[]; | ||
/** Route type. Only 'driving' type is available at this moment. */ | ||
type: 'driving'; | ||
/** Route type. */ | ||
type: 'driving' | 'truck' | 'walking' | 'transit'; | ||
/** If specified, bounding box of the route will be returned in properties. Default is `false`. */ | ||
@@ -50,2 +77,4 @@ bounds?: boolean; | ||
avoidTolls?: boolean; | ||
/** Parameters for a truck (only for `type=truck`). */ | ||
truck?: TruckParameters; | ||
} |
@@ -1,2 +0,3 @@ | ||
import type { LngLatBounds } from "../../../common/types"; | ||
import type { LngLat, LngLatBounds } from "../../../common/types"; | ||
export declare function isFiniteBounds(bounds: LngLatBounds): boolean; | ||
export declare function boundsFromCoordinates(coordinates: LngLat[]): LngLatBounds; |
export * from "./bounds"; | ||
export * from "./points"; | ||
export * from "./step-to-feature"; | ||
export * from "./to-route"; |
import type { DrawingStyle, GenericGeometry, LngLat, HideOutsideRule } from "../../common/types"; | ||
import type { DraggableProps, FeatureClickEvents } from "./types"; | ||
import type { BlockingProps, DraggableProps, FeatureClickEvents } from "./types"; | ||
import { YMapEntity } from "../YMapEnities"; | ||
@@ -18,3 +18,3 @@ import type { Geometry, YMapFeatureEventHandler } from "./types"; | ||
hideOutsideViewport?: HideOutsideRule; | ||
} & DraggableProps<YMapFeatureEventHandler> & FeatureClickEvents; | ||
} & DraggableProps<YMapFeatureEventHandler> & BlockingProps & FeatureClickEvents; | ||
declare const defaultProps: Readonly<{ | ||
@@ -21,0 +21,0 @@ source: "ymaps3x0-default-feature"; |
@@ -12,6 +12,6 @@ import type { LineStringGeometry, Margin, MultiLineStringGeometry, MultiPolygonGeometry, PointGeometry, PolygonGeometry } from "../../common/types"; | ||
/** | ||
* Maybe a function which will be called when the user drags and drops the element to a new position in the map. | ||
* The arguments to the function will be with new coordinates. | ||
* A component using with component should immediately store the new coordinates into its state and then pass | ||
* the new coordinates as the marker's props. | ||
* May be a function that will be called when the user drags and drops an element to a new location on the map. | ||
* The arguments to the function will include the new coordinates. | ||
* A component that uses this component should immediately save the new coordinates in its state and then use | ||
* the new coordinates as props for the marker. | ||
* */ | ||
@@ -21,5 +21,15 @@ onDragEnd?: Callback; | ||
onDragMove?: Callback; | ||
/** Will block maps events on marker */ | ||
} | ||
export interface BlockingProps { | ||
/** | ||
* This parameter block all map events for the element. | ||
* The map will no longer be able to respond to any {@link DomEvents} on this element, including clicks, double-clicks and others. | ||
*/ | ||
blockEvents?: boolean; | ||
/** Will block maps behaviors on marker */ | ||
/** | ||
* This parameter block all map behaviors for the element. | ||
* The element itself can be zoomed and scrolled by mouse and gestures. | ||
* The map will no longer be able to respond to any {@link BehaviorType} on this element (except `dblClick`). | ||
* Double clicks and other map events will be blocked by the {@link BlockingProps.blockEvents} parameter. | ||
*/ | ||
blockBehaviors?: boolean; | ||
@@ -26,0 +36,0 @@ } |
import type { HideOutsideRule, LngLat } from "../../common/types"; | ||
import type { DraggableProps, FeatureClickEvents } from "../YMapFeature/types"; | ||
import type { BlockingProps, DraggableProps, FeatureClickEvents } from "../YMapFeature/types"; | ||
import { YMapGroupEntity } from "../YMapEnities"; | ||
@@ -46,3 +46,3 @@ import { overrideKeyReactify } from "../wrappers"; | ||
hideOutsideViewport?: HideOutsideRule; | ||
} & DraggableProps<YMapMarkerEventHandler> & FeatureClickEvents; | ||
} & DraggableProps<YMapMarkerEventHandler> & BlockingProps & FeatureClickEvents; | ||
declare const defaultProps: Readonly<{ | ||
@@ -141,3 +141,3 @@ draggable: false; | ||
hideOutsideViewport?: HideOutsideRule | undefined; | ||
} & DraggableProps<YMapMarkerEventHandler> & FeatureClickEvents & { | ||
} & DraggableProps<YMapMarkerEventHandler> & BlockingProps & FeatureClickEvents & { | ||
markerElement?: HTMLElement | undefined; | ||
@@ -144,0 +144,0 @@ }, {}, import("../Entities").GenericRootEntity<unknown, {}>>> | undefined; |
{ | ||
"name": "@yandex/ymaps3-types", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "Types for ymaps3 maps library", | ||
@@ -5,0 +5,0 @@ "main": "", |
@@ -18,3 +18,2 @@ import type TReact from "react"; | ||
}; | ||
export declare const moduleOverrideExport: string; | ||
export type CustomReactify<TEntity extends GenericEntity<unknown>, TResult> = (ctor: EntityConstructor<TEntity>, params: { | ||
@@ -44,3 +43,5 @@ reactify: { | ||
}; | ||
export type BaseModule = Record<string | symbol, unknown>; | ||
export type BaseModule = Record<string | symbol, unknown> & { | ||
__implReactifyOverride?: (reactify: Reactify) => object; | ||
}; | ||
export type Prettify<T> = { | ||
@@ -47,0 +48,0 @@ [K in keyof T]: T[K]; |
157884
157
4021