@danicastar/spck-dts-gen
v1.2.1
Published
make a shared.d.ts file consisting of all typed-internal package
Readme
spck-dts-gen
Generate TypeScript declaration files for packages in your project.
Hint: This package requires a modded Spck Editor with both
ALLOWED_LANGUAGE_SERVICE_INITIAL_FILES_LIMITunlimited andnode_modulesnot ignored inspck.apk/assets/assets/bundle/app.bundle.js.
CLI
$ cd /path/to/project
$ npx @danicastar/spck-dts-gen gen-dts -o shared.d.ts
Usage: gen-dts [options] [workdir]
Generate TypeScript declaration files for packages in your project
Arguments:
workdir Working directory to scan for packages (default: ".")
Options:
-o, --output <file> Output file path (default: stdout)
-u, --unknown-suffix Allow unknown file suffixes (default: true)
-n, --no-unknown-suffix Disallow unknown file suffixes
-h, --help Show this help message
-v, --version Show version number
-i, --interactive Interactive input
Examples:
gen-dts # Generate for current directory
gen-dts ./my-project # Scan specific directory
gen-dts -o types.d.ts # Save to file
gen-dts --no-unknown-suffix # Strict mode
gen-dts --help # Show helpAPI
Example:
import genDTS from "@danicastar/spck-dts-gen"
const { modulesPath, result } = genDTS("/path/to/project", /* allowUnknownFileSuffix */ true)
fs.writeFileSync("shared.d.ts", result)Type (see index.d.ts for latest):
export default function(workdir: string, allowUnknownFileSuffix?: boolean): {
modulesPath: string[],
result: string
} TODOS
- [x] v1.2.0 supported
exportsin package.json - [ ] support more complex
exportssuch asimport&require->types
