From 0712c416259e4860ff1910c4a5bcd7b37da6b237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 31 Oct 2021 21:18:37 +0100 Subject: lib. --- static/lib.ts | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) (limited to 'static/lib.ts') diff --git a/static/lib.ts b/static/lib.ts index e3d99007..fe5ef1bd 100644 --- a/static/lib.ts +++ b/static/lib.ts @@ -1,34 +1,42 @@ +export { + makeElement, date_to_percent, uid, + parseDate, gensym, to_local, boolean, + xcal, asList, round_time +} 'use strict'; /* General procedures which in theory could be used anywhere. */ -interface Object { - format: (fmt: string) => string -} +declare global { + interface Object { + format: (fmt: string) => string + } -interface HTMLElement { - _addEventListener: (name: string, proc: (e: Event) => void) => void - listeners: Record void)[]> -} + interface HTMLElement { + _addEventListener: (name: string, proc: (e: Event) => void) => void + listeners: Record void)[]> + } -interface Date { - dateonly: boolean - utc: boolean - type: 'date' | 'date-time' -} + interface Date { + format: (fmt: string) => string + dateonly: boolean + utc: boolean + type: 'date' | 'date-time' + } -interface DOMTokenList { - find: (regex: string) => [number, string] | undefined -} + interface DOMTokenList { + find: (regex: string) => [number, string] | undefined + } -interface HTMLCollection { - forEach: (proc: ((el: Element) => void)) => void -} + interface HTMLCollection { + forEach: (proc: ((el: Element) => void)) => void + } -interface HTMLCollectionOf { - forEach: (proc: ((el: T) => void)) => void + interface HTMLCollectionOf { + forEach: (proc: ((el: T) => void)) => void + } } type uid = string -- cgit v1.2.3