Command to add:
yarn tsc --declaration --emitDeclarationOnly --allowJs --lib es2015 lib/*.js
or via npx
npx -p typescript@next tsc --declaration --emitDeclarationOnly --allowJs --lib es2015 lib/*.js
Exports for
/**
* Query String
*
* @param {any} object An object
*/
var exportedStringify = function (object, opts) {}
module.exports = exportedStringify
Not as expected
Looks like overwriting the d.ts files is an issue when using emitDeclarationOnly
:
qs master ● ? npx -p typescript@next tsc --declaration --emitDeclarationOnly --allowJs --lib es2015 lib/*.js 1 ↵ 09:00:53
npx: installed 1 in 6.712s
error TS5055: Cannot write file 'lib/formats.d.ts' because it would overwrite input file.
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
error TS5055: Cannot write file 'lib/parse.d.ts' because it would overwrite input file.
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
error TS5055: Cannot write file 'lib/stringify.d.ts' because it would overwrite input file.
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
error TS5055: Cannot write file 'lib/utils.d.ts' because it would overwrite input file.
emitDeclarationOnly
is not in tsc --help
// @allowJs: true
// @checkJs: true
// @emitDeclarationOnly: true
// @declaration: true
// @
// @Filename: /a.js
/**
* Query String
*
* @param {any} object An object
*/
var exportedStringify = function (object, opts) {}
module.exports = exportedStringify
//// [a.d.ts]
export function exportedStringify(object: any, opts: any): void;