- Clone this repo
- Modify
demo.ts
- Compile with
npx tsc
- See the output
demo.js
and copy it to your zk project.
- Install
typescript
andzk-types
with NPM
npm i -D typescript zk-types
npx tsc --init // This will create a template tsconfig.json
- Modify
tsconfig.json
to have:
{
"compilerOptions": {
"types": ["zk-types"]
}
}
- Create a TS file with whatever name (e.g.,
demo.ts
) and start typing:
const oldPanel = zk.augment(zul.wnd.Panel.prototype, {
onClose(): void {
alert('Modified zul.wnd.Panel.prototype.onClose');
return oldPanel.onClose();
}
})
- Read the first section.