@types/mapbox-gl
Advanced tools
Comparing version 0.51.3 to 0.51.4
// Type definitions for Mapbox GL JS v0.51.0 | ||
// Project: https://github.com/mapbox/mapbox-gl-js | ||
// Definitions by: Dominik Bruderer <https://github.com/dobrud>, Patrick Reames <https://github.com/patrickr> | ||
// Definitions by: Dominik Bruderer <https://github.com/dobrud> | ||
// Patrick Reames <https://github.com/patrickr> | ||
// Karl-Aksel Puulmann <https://github.com/macobo> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
// TypeScript Version: 3.0 | ||
@@ -23,3 +25,29 @@ /// <reference types="geojson" /> | ||
type PointLike = Point | [number, number]; | ||
type Expression = any[]; | ||
type ExpressionName = | ||
// Types | ||
| 'array' | 'boolean' | 'collator' | 'format' | 'literal' | 'number' | 'object' | 'string' | ||
| 'to-boolean' | 'to-color' | 'to-number' | 'to-string' | 'typeof' | ||
// Feature data | ||
| 'feature-state' | 'geometry-type' | 'id' | 'line-progress' | 'properties' | ||
// Lookup | ||
| 'at' | 'get' | 'has' | 'length' | ||
// Decision | ||
| '!=' | '<' | '<=' | '==' | '>' | '>=' | 'all' | 'any' | 'case' | 'match' | ||
// Ramps, scales, curves | ||
| 'interpolate' | 'interpolate-hcl' | 'interpolate-lab' | 'step' | ||
// Variable binding | ||
| 'let' | 'var' | ||
// String | ||
| 'concat' | 'downcase' | 'is-supported-script' | 'resolved-locale' | 'upcase' | ||
// Color | ||
| 'rgb' | 'rgba' | ||
// Math | ||
| '-' | '*' | '/' | '%' | '^' | '+' | 'abs' | 'acos' | 'asin' | 'atan' | 'ceil' | 'cos' | 'e' | ||
| 'floor' | 'ln' | 'ln2' | 'log10' | 'log2' | 'max' | 'min' | 'pi' | 'round' | 'sin' | 'sqrt' | 'tan' | ||
// Zoom, Heatmap | ||
| 'zoom' | 'heatmap-density'; | ||
type Expression = [ExpressionName, ...any[]] | ||
type Anchor = 'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; | ||
@@ -77,3 +105,3 @@ | ||
addSource(id: string, source: VectorSource | RasterSource | RasterDemSource | GeoJSONSource | ImageSource | VideoSource | GeoJSONSourceRaw): this; | ||
addSource(id: string, source: AnySourceData): this; | ||
@@ -86,3 +114,3 @@ isSourceLoaded(id: string): boolean; | ||
getSource(id: string): VectorSource | RasterSource | RasterDemSource | GeoJSONSource | ImageSource | VideoSource; | ||
getSource(id: string): AnySourceImpl; | ||
@@ -632,3 +660,3 @@ addImage(name: string, image: HTMLImageElement | ArrayBufferView | { width: number, height: number, data: Uint8Array | Uint8ClampedArray } | ImageData, options?: { pixelRatio?: number, sdf?: boolean }): this; | ||
light?: Light; | ||
sources?: any; | ||
sources?: Sources; | ||
sprite?: string; | ||
@@ -655,2 +683,10 @@ transition?: Transition; | ||
export interface Sources { | ||
[sourceName: string]: AnySourceData; | ||
} | ||
export type AnySourceData = GeoJSONSourceRaw | VideoSourceRaw | ImageSourceRaw | CanvasSourceRaw | VectorSource | RasterSource | RasterDemSource | ||
export type AnySourceImpl = GeoJSONSource | VideoSource | ImageSource | CanvasSource | VectorSource | RasterSource | RasterDemSource | ||
export interface Source { | ||
@@ -707,6 +743,7 @@ type: 'vector' | 'raster' | 'raster-dem' | 'geojson' | 'image' | 'video' | 'canvas'; | ||
*/ | ||
export interface VideoSource extends VideoSourceOptions { | ||
export interface VideoSourceRaw extends Source, VideoSourceOptions { | ||
type: 'video'; | ||
} | ||
export class VideoSource implements Source { | ||
export class VideoSource implements VideoSourceRaw { | ||
type: 'video'; | ||
@@ -730,6 +767,7 @@ | ||
*/ | ||
export interface ImageSource extends ImageSourceOptions { | ||
export interface ImageSourceRaw extends Source, ImageSourceOptions { | ||
type: 'image'; | ||
} | ||
export class ImageSource implements Source { | ||
export class ImageSource implements ImageSourceRaw { | ||
type: 'image'; | ||
@@ -751,5 +789,9 @@ | ||
*/ | ||
export class CanvasSource implements Source, CanvasSourceOptions { | ||
export interface CanvasSourceRaw extends Source, CanvasSourceOptions { | ||
type: 'canvas'; | ||
} | ||
export class CanvasSource implements CanvasSourceRaw { | ||
type: 'canvas'; | ||
coordinates: number[][]; | ||
@@ -1257,3 +1299,3 @@ | ||
source?: string | VectorSource | RasterSource | RasterDemSource | GeoJSONSource | ImageSource | VideoSource | GeoJSONSourceRaw; | ||
source?: string | AnySourceData; | ||
@@ -1373,3 +1415,3 @@ 'source-layer'?: string; | ||
'symbol-z-order'?: 'viewport-y' | 'source'; | ||
'icon-allow-overlap'?: boolean | StyleFunction; | ||
'icon-allow-overlap'?: boolean | StyleFunction | Expression; | ||
'icon-ignore-placement'?: boolean; | ||
@@ -1390,3 +1432,3 @@ 'icon-optional'?: boolean; | ||
'text-rotation-alignment'?: 'map' | 'viewport' | 'auto'; | ||
'text-field'?: string | StyleFunction; | ||
'text-field'?: string | StyleFunction | Expression; | ||
'text-font'?: string | string[]; | ||
@@ -1393,0 +1435,0 @@ 'text-size'?: number | StyleFunction | Expression; |
{ | ||
"name": "@types/mapbox-gl", | ||
"version": "0.51.3", | ||
"version": "0.51.4", | ||
"description": "TypeScript definitions for Mapbox GL JS", | ||
@@ -16,2 +16,7 @@ "license": "MIT", | ||
"githubUsername": "patrickr" | ||
}, | ||
{ | ||
"name": "Karl-Aksel Puulmann", | ||
"url": "https://github.com/macobo", | ||
"githubUsername": "macobo" | ||
} | ||
@@ -29,4 +34,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "d46a6c3e3b93ac3c49a53c411a0cbca750371983e01ad66c3e242627e44542e6", | ||
"typeScriptVersion": "2.3" | ||
"typesPublisherContentHash": "3a79c240a52dcc9d648960c8e13ff9e91b61f0e8eb1a7b26550ef7d93583f354", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for Mapbox GL JS (https://github.com/mapbox/mapbox-gl-js). | ||
This package contains type definitions for Mapbox GL JS ( https://github.com/mapbox/mapbox-gl-js ). | ||
@@ -12,3 +12,3 @@ # Details | ||
Additional Details | ||
* Last updated: Fri, 14 Dec 2018 23:39:20 GMT | ||
* Last updated: Fri, 01 Feb 2019 21:32:52 GMT | ||
* Dependencies: @types/geojson | ||
@@ -18,2 +18,2 @@ * Global values: mapboxgl | ||
# Credits | ||
These definitions were written by Dominik Bruderer <https://github.com/dobrud>, Patrick Reames <https://github.com/patrickr>. | ||
These definitions were written by Dominik Bruderer <https://github.com/dobrud>, Patrick Reames <https://github.com/patrickr>, Karl-Aksel Puulmann <https://github.com/macobo>. |
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
50236
1156