mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Introduce new type definition package into repository which adds type definitions for a library called RE:DOM. These type definitions are made against RE:DOM version 3.6.2.
17 lines
552 B
TypeScript
17 lines
552 B
TypeScript
import * as redom from 'redom';
|
|
|
|
const el1: HTMLElement = redom.el('');
|
|
const el2: HTMLElement = redom.el('p', 'Hello, World!', (el: HTMLElement) => { el.setAttribute('ok', '!'); });
|
|
const el3: HTMLElement = redom.html('p', 2, { color: 'red' });
|
|
|
|
redom.mount(document.body, el1);
|
|
redom.mount(document.body, el2, el1);
|
|
redom.unmount(document.body, el1);
|
|
|
|
redom.setAttr(el3, 'ok', '!');
|
|
redom.setAttr(el3, { ok: '!' });
|
|
redom.setStyle(el3, { color: 'blue' });
|
|
redom.setChildren(el1, [el2, el3]);
|
|
|
|
redom.mount(document.body, redom.text('Hello, World!'));
|