aboutsummaryrefslogtreecommitdiff
path: root/static/lib.ts
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-10-31 21:18:37 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-10-31 21:18:37 +0100
commit0712c416259e4860ff1910c4a5bcd7b37da6b237 (patch)
tree605a1117b33c377ccb08d21b56778fc16a1e30ab /static/lib.ts
parentEverything but lib. (diff)
downloadcalp-0712c416259e4860ff1910c4a5bcd7b37da6b237.tar.gz
calp-0712c416259e4860ff1910c4a5bcd7b37da6b237.tar.xz
lib.
Diffstat (limited to 'static/lib.ts')
-rw-r--r--static/lib.ts48
1 files changed, 28 insertions, 20 deletions
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<string, ((e: Event) => void)[]>
-}
+ interface HTMLElement {
+ _addEventListener: (name: string, proc: (e: Event) => void) => void
+ listeners: Record<string, ((e: Event) => 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<T> {
- forEach: (proc: ((el: T) => void)) => void
+ interface HTMLCollectionOf<T> {
+ forEach: (proc: ((el: T) => void)) => void
+ }
}
type uid = string