Skip to content

zkoss-demo/zk-types-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Declarations for the ZK Framework

Using this repo

  1. Clone this repo
  2. Modify demo.ts
  3. Compile with npx tsc
  4. See the output demo.js and copy it to your zk project.

Manually install zk-types in your custom repo

  1. Install typescript and zk-types with NPM
npm i -D typescript zk-types
npx tsc --init // This will create a template tsconfig.json
  1. Modify tsconfig.json to have:
{
    "compilerOptions": {
        "types": ["zk-types"]
    }
}
  1. 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();
    }
})
  1. Read the first section.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published