Added first TypeScript typing rules

This commit is contained in:
Pierre HUBERT 2019-02-23 19:08:25 +01:00
parent bbaaf3a5c2
commit d9fe86d160

35
assets/custom_ts/Utils.d.ts vendored Normal file
View File

@ -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;