From ed81eab2015492a415411a3910db9375b5fcbaaf Mon Sep 17 00:00:00 2001 From: William Comartin Date: Tue, 5 Jan 2016 16:55:22 -0500 Subject: [PATCH 1/4] add leaflet-fullscreen definitions --- .../leaflet-fullscreen-tests.ts | 12 +++++++ leaflet-fullscreen/leaflet-fullscreen.d.ts | 31 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 leaflet-fullscreen/leaflet-fullscreen-tests.ts create mode 100644 leaflet-fullscreen/leaflet-fullscreen.d.ts diff --git a/leaflet-fullscreen/leaflet-fullscreen-tests.ts b/leaflet-fullscreen/leaflet-fullscreen-tests.ts new file mode 100644 index 000000000..a631986a5 --- /dev/null +++ b/leaflet-fullscreen/leaflet-fullscreen-tests.ts @@ -0,0 +1,12 @@ +/// + +var map: L.Map; +var icon: L.Control.Fullcircle = new L.control.fullcircle({ + position: 'topleft', + title: 'Full Screen', + titleCancel: 'Exit Full Screen', + forceSeparateButton: false, + forcePseudoFullscreen: false +}); + +icon.addTo(map); diff --git a/leaflet-fullscreen/leaflet-fullscreen.d.ts b/leaflet-fullscreen/leaflet-fullscreen.d.ts new file mode 100644 index 000000000..8941a76e5 --- /dev/null +++ b/leaflet-fullscreen/leaflet-fullscreen.d.ts @@ -0,0 +1,31 @@ +// Type definitions for Leaflet.fullscreen v1.3.0 +// Project: https://github.com/brunob/leaflet.fullscreen +// Definitions by: William Comartin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module L { + + namespace Control { + + export interface Fullscreen extends L.Control {} + + export interface FullscreenOptions { + position: string, + title: string, + titleCancel: string, + forceSeparateButton: boolean, + forcePseudoFullscreen: boolean + } + } + + namespace control { + + /** + * Creates a fullscreen control. + */ + export function fullscreen(options?: Control.FullscreenOptions): L.Control.Fullscreen; + + } +} From a1feab7b714460e3681dc57d12063ef5fb3feb92 Mon Sep 17 00:00:00 2001 From: William Comartin Date: Tue, 5 Jan 2016 16:59:37 -0500 Subject: [PATCH 2/4] fix test --- leaflet-fullscreen/leaflet-fullscreen-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaflet-fullscreen/leaflet-fullscreen-tests.ts b/leaflet-fullscreen/leaflet-fullscreen-tests.ts index a631986a5..50a427a79 100644 --- a/leaflet-fullscreen/leaflet-fullscreen-tests.ts +++ b/leaflet-fullscreen/leaflet-fullscreen-tests.ts @@ -1,7 +1,7 @@ /// var map: L.Map; -var icon: L.Control.Fullcircle = new L.control.fullcircle({ +var icon: L.Control.Fullscreen = L.control.fullscreen({ position: 'topleft', title: 'Full Screen', titleCancel: 'Exit Full Screen', From 68186adc6dd28d6eec93bfb10cb693c69d33948c Mon Sep 17 00:00:00 2001 From: William Comartin Date: Wed, 6 Jan 2016 09:54:28 -0500 Subject: [PATCH 3/4] Leaflet-Fullscreen make Options optional --- leaflet-fullscreen/leaflet-fullscreen.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/leaflet-fullscreen/leaflet-fullscreen.d.ts b/leaflet-fullscreen/leaflet-fullscreen.d.ts index 8941a76e5..ea955bf41 100644 --- a/leaflet-fullscreen/leaflet-fullscreen.d.ts +++ b/leaflet-fullscreen/leaflet-fullscreen.d.ts @@ -12,11 +12,11 @@ declare module L { export interface Fullscreen extends L.Control {} export interface FullscreenOptions { - position: string, - title: string, - titleCancel: string, - forceSeparateButton: boolean, - forcePseudoFullscreen: boolean + position?: string, + title?: string, + titleCancel?: string, + forceSeparateButton?: boolean, + forcePseudoFullscreen?: boolean } } From c4df2bf9f07a04b4ae46a919fae7d2d694442df4 Mon Sep 17 00:00:00 2001 From: William Comartin Date: Thu, 7 Jan 2016 08:59:33 -0500 Subject: [PATCH 4/4] change file names to match that of npm and bower --- .../leaflet.fullscreen-tests.ts | 13 ++++++++++++- .../leaflet.fullscreen.d.ts | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) rename leaflet-fullscreen/leaflet-fullscreen-tests.ts => leaflet.fullscreen/leaflet.fullscreen-tests.ts (52%) rename leaflet-fullscreen/leaflet-fullscreen.d.ts => leaflet.fullscreen/leaflet.fullscreen.d.ts (96%) diff --git a/leaflet-fullscreen/leaflet-fullscreen-tests.ts b/leaflet.fullscreen/leaflet.fullscreen-tests.ts similarity index 52% rename from leaflet-fullscreen/leaflet-fullscreen-tests.ts rename to leaflet.fullscreen/leaflet.fullscreen-tests.ts index 50a427a79..d74a19dcb 100644 --- a/leaflet-fullscreen/leaflet-fullscreen-tests.ts +++ b/leaflet.fullscreen/leaflet.fullscreen-tests.ts @@ -1,6 +1,8 @@ -/// +/// var map: L.Map; + +// Defaults var icon: L.Control.Fullscreen = L.control.fullscreen({ position: 'topleft', title: 'Full Screen', @@ -10,3 +12,12 @@ var icon: L.Control.Fullscreen = L.control.fullscreen({ }); icon.addTo(map); + + +// My Usage + +L.control.fullscreen({ + position: 'topleft', + content: '', + forceSeparateButton: true, +}).addTo(map); diff --git a/leaflet-fullscreen/leaflet-fullscreen.d.ts b/leaflet.fullscreen/leaflet.fullscreen.d.ts similarity index 96% rename from leaflet-fullscreen/leaflet-fullscreen.d.ts rename to leaflet.fullscreen/leaflet.fullscreen.d.ts index ea955bf41..864817f22 100644 --- a/leaflet-fullscreen/leaflet-fullscreen.d.ts +++ b/leaflet.fullscreen/leaflet.fullscreen.d.ts @@ -12,6 +12,7 @@ declare module L { export interface Fullscreen extends L.Control {} export interface FullscreenOptions { + content?: string, position?: string, title?: string, titleCancel?: string,