// https://www.tslang.cn/docs/handbook/declaration-files/templates/global-d-ts.html declare module '*.less'; declare module '*.png'; declare module '*.svg'; declare namespace my { let call; } declare namespace AlipayJSBridge { let call; } // declare namespace myLib { // //~ We can write 'myLib.timeout = 50;' // let timeout: number; // //~ We can access 'myLib.version', but not change it // const version: string; // //~ There's some class we can create via 'let c = new myLib.Cat(42)' // //~ Or reference e.g. 'function f(c: myLib.Cat) { ... } // class Cat { // constructor(n: number); // //~ We can read 'c.age' from a 'Cat' instance // readonly age: number; // //~ We can invoke 'c.purr()' from a 'Cat' instance // purr(): void; // } // //~ We can declare a variable as // //~ 'var s: myLib.CatSettings = { weight: 5, name: "Maru" };' // interface CatSettings { // weight: number; // name: string; // tailLength?: number; // } // //~ We can write 'const v: myLib.VetID = 42;' // //~ or 'const v: myLib.VetID = "bob";' // type VetID = string | number; // //~ We can invoke 'myLib.checkCat(c)' or 'myLib.checkCat(c, v);' // function checkCat(c: Cat, s?: VetID); // }