From d9fe86d160a57f886cb0e102ae0267d72667bd66 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 23 Feb 2019 19:08:25 +0100 Subject: [PATCH] Added first TypeScript typing rules --- assets/custom_ts/Utils.d.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 assets/custom_ts/Utils.d.ts diff --git a/assets/custom_ts/Utils.d.ts b/assets/custom_ts/Utils.d.ts new file mode 100644 index 00000000..3fd12b36 --- /dev/null +++ b/assets/custom_ts/Utils.d.ts @@ -0,0 +1,35 @@ +/** + * Typescript typing rules for Utils + * + * @author Pierre HUBERT + */ + +declare interface CreateElem2Args { + type : string, + appendTo ?: HTMLElement, + insertBefore ?: HTMLElement, + insertAsFirstChild ?: HTMLElement, + class ?: string, + id ?: string, + title ?: string, + src ?: string, + href ?: string, + name ?: string, + elemType ?: string, + value ?: string, + placeholder ?: string, + innerHTML ?: string, + innerLang ?: string, + innerHTMLprefix ?: string, + disabled ?: boolean, +} + +declare function createElem(nodeType : string, appendTo : string) : HTMLElement; + +declare function createElem2(infos : CreateElem2Args) : HTMLElement; + +declare function byId(id : string) : HTMLElement; + +declare function emptyElem(target : HTMLElement) : void; + +declare function checkMail(emailAddress : string) : boolean; \ No newline at end of file