mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Update types for Mithril 2.0 * Update mithril-global types. Remove remaining references to withAttr * Formatting * Add body property to JsonpOptions * Formatting * Improve types, use newer typescript features * Improve Stream.SKIP type * Upgrade mithril-global typescript version * Improve Stream.merge signature. Add needed stream types to tests. * Remove unused generic param from merge
24 lines
524 B
TypeScript
24 lines
524 B
TypeScript
// Test global mithril types
|
|
|
|
const comp: m.Component = {
|
|
view() {
|
|
return m('span', 'Test');
|
|
},
|
|
};
|
|
|
|
m.mount(document.getElementById('comp')!, comp)
|
|
|
|
const vnode = m('div', 'Test')
|
|
|
|
const s: m.Stream<number> = m.stream(1)
|
|
|
|
const qstr = m.buildQueryString({ a: 1, b: 'abc' });
|
|
const params = m.parseQueryString(qstr);
|
|
const pstr = m.buildPathname('/api/user/:id', { id: 1 });
|
|
const parts = m.parsePathname(pstr);
|
|
|
|
m.redraw();
|
|
m.redraw.sync();
|
|
|
|
m(m.route.Link, { selector: 'a', href: '/page1' }, 'Click this');
|