From e0b59d09e511376ec2499608b7c885bb397666ed Mon Sep 17 00:00:00 2001 From: Dmytro Gokun Date: Wed, 10 Jul 2019 02:47:21 +0300 Subject: [PATCH] [@types/mapbox-gl] Add FullscreenControl optional constructor parameter (#36757) --- types/mapbox-gl/index.d.ts | 12 ++++++++++-- types/mapbox-gl/mapbox-gl-tests.ts | 10 +++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 1024c85b6a..67003f8dd4 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -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; } /** diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index 7726c044e4..fdd7a66868 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -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([ ['concat', ['get', 'name'], '\n'], {}, ['concat', ['get', 'area'], 'foobar', { 'font-scale': 0.8 }] ]); -expectType(['coalesce', ['get', 'property'], ['get', 'property']]); \ No newline at end of file +expectType(['coalesce', ['get', 'property'], ['get', 'property']]);