diff --git a/leaflet/index.d.ts b/leaflet/index.d.ts index 717e589877..de463ae997 100644 --- a/leaflet/index.d.ts +++ b/leaflet/index.d.ts @@ -1524,6 +1524,27 @@ declare namespace L { export const svg: boolean; } + export namespace Util { + export function extend(dest: any, src?: any): any; + export function create(proto: any, properties?: any): any; + export function bind(fn: () => void, ...obj: any[]): () => void; + export function stamp(obj: any): number; + export function throttle(fn: () => void, time: number, context: any): () => void; + export function wrapNum(num: number, range: number[], includeMax?: boolean): number; + export function falseFn(): () => false; + export function formatNum(num: number, digits?: number): number; + export function trim(str: string): string; + export function splitWords(str: string): string[]; + export function setOptions(obj: any, options: any): any; + export function getParamString(obj: any, existingUrl?: string, uppercase?: boolean): string; + export function template(str: string, data: any): string; + export function isArray(obj: any): boolean; + export function indexOf(array: any[], el: any): number; + export function requestAnimFrame(fn: () => void, context?: any, immediate?: boolean): number; + export function cancelAnimFrame(id: number): void; + export let lastId: string; + export let emptyImageUrl: string; + } } declare module 'leaflet' { diff --git a/leaflet/leaflet-tests.ts b/leaflet/leaflet-tests.ts index bce7afdab6..06c35cb0e9 100644 --- a/leaflet/leaflet-tests.ts +++ b/leaflet/leaflet-tests.ts @@ -447,3 +447,22 @@ L.marker([1, 2], { iconUrl: 'my-icon.png' }) }).bindPopup('

Hi

'); + +L.Util.extend({}); +L.Util.create({}); +L.Util.bind(() => {}, {}); +L.Util.stamp({}); +L.Util.throttle(() => {}, 123, {}); +L.Util.wrapNum(123, []); +L.Util.falseFn(); +L.Util.formatNum(123); +L.Util.trim('word '); +L.Util.splitWords('word word'); +L.Util.setOptions({}, {}); +L.Util.getParamString({}); +L.Util.template('template', {}); +L.Util.isArray({}); +L.Util.indexOf([], {}); +L.Util.requestAnimFrame(() => {}); +L.Util.cancelAnimFrame(1); +L.Util.emptyImageUrl;