[@types/mapbox-gl] Add FullscreenControl optional constructor parameter (#36757)

This commit is contained in:
Dmytro Gokun 2019-07-10 02:47:21 +03:00 committed by Armando Aguirre
parent 1403877e74
commit e0b59d09e5
2 changed files with 19 additions and 3 deletions

View File

@ -605,10 +605,18 @@ declare namespace mapboxgl {
}
/**
* Fullscreen
* FullscreenControl
*/
export class FullscreenControl extends Control {
constructor();
constructor(options?: FullscreenControlOptions | null);
}
export interface FullscreenControlOptions {
/**
* A compatible DOM element which should be made full screen.
* By default, the map container element will be made full screen.
*/
container?: HTMLElement | null;
}
/**

View File

@ -421,6 +421,14 @@ bool = bounds.isEmpty()
let attributionControl = new mapboxgl.AttributionControl({ compact: false, customAttribution: '© YourCo' });
attributionControl.on('click', () => {});
/*
* FullscreenControl
*/
new mapboxgl.FullscreenControl();
new mapboxgl.FullscreenControl(null);
new mapboxgl.FullscreenControl({});
new mapboxgl.FullscreenControl({container: document.querySelector('body')});
declare var lnglat: mapboxgl.LngLat;
declare var lnglatlike: mapboxgl.LngLatLike;
declare var lnglatboundslike: mapboxgl.LngLatBoundsLike;
@ -829,4 +837,4 @@ expectType<mapboxgl.Expression>([
['concat', ['get', 'name'], '\n'], {},
['concat', ['get', 'area'], 'foobar', { 'font-scale': 0.8 }]
]);
expectType<mapboxgl.Expression>(['coalesce', ['get', 'property'], ['get', 'property']]);
expectType<mapboxgl.Expression>(['coalesce', ['get', 'property'], ['get', 'property']]);