creojs-dts generates TypeScript declaration files (.d.ts) for the Creo.JS Toolkit used by Creo Parametric.
Each run produces TypeScript declarations, an index.d.ts, and optional package metadata.
- Node.js 18+
npm install
npm run buildCopy from <CREO_PARAMETRIC>\Common Files\apps\creojs\otk_api_spec\OTK_model.json.zip\json\
- the
idl/folder intoinput/idl/aspfc/ - the
idl_wfc/folder intoinput/idl/aswfc/ - the
idl_uifc/folder intoinput/idl/asuifc/
Run:
npm run generateGenerated files are written to creojs/.
splitBySourceFile: true- One
.d.tsfile per JSON source, written undercreojs/<module>/<name>.d.ts creojs/index.d.tsreferences each per-file declaration
- One
splitBySourceFile: false- One bundled
.d.tsfile per module prefix (creojs/pfc.d.ts,creojs/wfc.d.ts,creojs/uifc.d.ts, ...) creojs/index.d.tsreferences each bundled module file
- One bundled
- Per-module extras:
input/pfc.d.ts,input/wfc.d.ts,input/uifc.d.ts(if present) are appended to the corresponding generated module output - Creo.JS global extras:
input/creojs.d.tsis copied tocreojs/creojs.d.tsand referenced fromcreojs/index.d.ts - Package metadata:
input/package.jsonis copied tocreojs/ - The CLI reports the output location and number of processed files
Only behavior settings are loaded from config.json. Input (input/) and output (creojs/) path are hardcoded
Example:
{
"splitBySourceFile": false,
"emitExports": false,
"typesAsInterfaces": true,
"docsDetail": "basic",
"enumsAs": "class",
"interfaceStaticsAs": "interface"
}splitBySourceFile– Generate one file per JSON source whentrue, or one bundled file per module prefix whenfalse(default:true)emitExports– Addexportkeywords to generated declarations (default:false)typesAsInterfaces– Generate interfaces instead of classes (default:true)docsDetail– Documentation details:none,basic, orfull(default:basic)enumsAs– Representation of IDL enums:enum(TypeScriptenum) orclass(class-based enum-like objects withstring()and static readonly members, default:class)interfaceStaticsAs– Static method representation whentypesAsInterfacesistrue:interface(separate*Staticinterface plusconstbinding) ornamespace(functions in a namespace with the same name as the interface, default:interface)
src/app.ts– CLI entry point and orchestrationsrc/generator.ts– Generates TypeScript declarationssrc/docs.ts– Documentation generation helpersinput/idl/– Source IDL JSON filesinput/pfc.d.ts,input/wfc.d.ts,input/uifc.d.ts– per-module custom declarationsinput/creojs.d.ts– Creo.JS declarationsinput/package.json– Package manifestcreojs/– Generated output