DefinitelyTyped/types/mithril-global/mithril-global-tests.ts
spacejack 7a123a7d47 Update types for Mithril 2.0 (#37118)
* 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
2019-07-29 18:05:30 -07:00

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');