TypeScript combining *.js + *.d.ts again?
Clash Royale CLAN TAG #URR8PPP TypeScript combining *.js + *.d.ts again? TypeScript tsc -d "declaration" of "compilerOptions" generates corresponding '.d.ts' file. tsc -d For instance, from: const log = (m: unknown) => { console.log((m)); return m; }; it generates: const log = (m) => { console.log((m)); return m; }; and: declare const log: (m: unknown) => unknown; I think this is quite interesting because it "devides" the TypeScript source code to a native JavaScript code and the extra type definition. Then, here is my thought. After deviding the native code and type definition, is it easily possilbe to generate a valid TypeScript code by re-binding both codes. For instance: declare const log1: (m: unknown) => unknown; const log1 = m => { console.log((m)); return m; }; This code generates an errors: [ts] Cannot redeclare block-scoped variable 'log1'. for each statements. Why am I tring this? I'm m...