@jjjzen/plugin-schema-to-typescript-dts
v0.0.3
Published
build typescript definition (`*.d.ts`) from `*.schema.json`.
Downloads
4
Readme
README
Build typescript definition (*.d.ts
) from *.schema.json
.
install
cd /path/your/project
npm install --save-dev @jjjzen/jjjzen @jjjzen/plugin-schema-to-typescript-dts
config
cd /path/your/project
vi .jjjzenrc.json
{
"search": { "schemas": { "pattern": [ "**/*.schema.json" ] } },
"plugins": [
{
"name": "@jjjzen/plugin-schema-to-typescript-dts",
"options": {}
}
]
}
build
cd /path/your/project
./node_modules/.bin/jjjzen
ls -al **/_build/*.d.ts
Tip jsdoc usage
/**
* @typedef { import("./schemas/_build/xyz.in.schema").XyzInSchema } XyzInSchema
* @typedef { import("./schemas/_build/xyz.err.schema").XyzErrSchema } XyzErrSchema
* @typedef { import("./schemas/_build/xyz.out.schema").XyzOutSchema } XyzOutSchema
*/
/**
* @param { XyzInSchema } ajsonin
* @returns {Promise<(XyzOutSchema|XyzErrSchema)>}
*/
async function xyz(ajsonin) {
}