Adjust Typings for Node Platform (#871)

Co-authored-by: Ovidiu Voda <ovi.voda@gmail.com>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
etnav
2023-03-10 13:35:32 +01:00
committed by GitHub
parent 9766f6fcc2
commit ad1722f57e
2 changed files with 103 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
- *...Add new stuff here...*
# 5.2.0
* Adjust Typings for Node Platform by @etnav in https://github.com/maplibre/maplibre-gl-native/pull/871
* Node platform improvements (added setSize and a new render call without render options object) by @tdcosta100 in https://github.com/maplibre/maplibre-gl-native/pull/891
* Move node ci+release to self hosted Ubuntu arm64 by @acalcutt in https://github.com/maplibre/maplibre-gl-native/pull/873
* Add windows support by @tdcosta100 in https://github.com/maplibre/maplibre-gl-native/pull/707

View File

@@ -60,6 +60,8 @@ declare module '@maplibre/maplibre-gl-native' {
*/
type RenderOptions = {
/**
* Zoom level
*
* @default 0
*/
zoom?: number;
@@ -111,19 +113,114 @@ declare module '@maplibre/maplibre-gl-native' {
class Map {
constructor(mapOptions: MapOptions);
/**
* Load a style into a map
*/
load: (style: any) => void;
/**
* Render a specific map view to an image with previously loaded map styles
* Render a specific map view to an image with previously loaded map styles with render options.
*/
render: (
renderOptions: RenderOptions,
callback: (...args: [error: Error, buffer: undefined] | [error: undefined, buffer: Uint8Array]) => void,
) => void;
render(renderOptions: RenderOptions, callback: (...args: [error: Error, buffer: undefined] | [error: undefined, buffer: Uint8Array]) => void): void;
/**
* Render a specific map view to an image with previously loaded map styles without render options.
*/
render(callback: (...args: [error: Error, buffer: undefined] | [error: undefined, buffer: Uint8Array]) => void): void;
/**
* Call to permanently dispose the internal map resources, instance can't be used for further render calls
*/
release: () => void;
/**
* Add source to map's style
*/
addSource: (sourceId: string, source: object) => void;
/**
* Remove source from map's style
*/
removeSource: (sourceId: string) => void;
/**
* Add layer to map's style
*/
addLayer: (layer: object, beforeId?: string) => void;
/**
* Remove layer from map's style
*/
removeLayer: (layerId: string) => void;
/**
* Add image to map's style
*/
addImage: (imageId: string, image: any) => void;
/**
* Remove image from map's style
*/
removeImage: (imageId: string) => void;
/**
* Set the extent of the zoom for a specified layer
*/
setLayerZoomRange: (layerId: string, minZoom: number, maxZoom: number) => void;
/**
* Set the value for a layer's property
*/
setLayoutProperty: (layerId: string, name: string, value: string) => void;
/**
* Set filter for specified style layer
*/
setFilter: (layerId: string, filter: [] | null | undefined) => void;
/**
* Set size of the tile
*/
setSize: (size: [number, number]) => void;
/**
* Set the center of the map
*/
setCenter: (center: [number, number]) => void;
/**
* Set zoom of the map
*/
setZoom: (zoom: number) => void;
/**
* Set bearing (rotation) of map
*/
setBearing: (bearing: number) => void;
/**
* Set pitch (tilt angle) of map
*/
setPitch: (pitch: number) => void;
/**
* Set light value of map
*/
setLight: (light: any) => void;
/**
* Set axonometric view of map
*/
setAxonometric: (state: boolean) => void;
/**
* Set X skew of map
*/
setXSkew: (x: number) => void;
/**
* Set Y skew of map
*/
setYSkew: (y: number) => void;
}
}