mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Use RouteOptions type, test other properties
This commit is contained in:
Vendored
+1
-1
@@ -96,7 +96,7 @@ declare namespace Mithril {
|
||||
prefix(urlFragment: string): void;
|
||||
/** This method is meant to be used in conjunction with an <a> Vnode's oncreate/onupdate hooks. */
|
||||
link(vnode: Vnode<any, any>): (e?: Event) => any;
|
||||
link(options: {replace: boolean}): (vnode: Vnode<any, any>) => (e?: Event) => any;
|
||||
link(options: RouteOptions): (vnode: Vnode<any, any>) => (e?: Event) => any;
|
||||
/** Returns the named parameter value from the current route. */
|
||||
param(name: string): string;
|
||||
/** Gets all route parameters. */
|
||||
|
||||
@@ -127,8 +127,16 @@ const path: string = route.get();
|
||||
|
||||
const fn1: (e?: Event) => any = route.link(h('div', 'test'));
|
||||
|
||||
const fn2: (v: Vnode<any, any>) => any = route.link({replace: true});
|
||||
const fn2: (v: Vnode<any, any>) => any = route.link({
|
||||
replace: true,
|
||||
state: {abc: 123},
|
||||
title: "Title"
|
||||
});
|
||||
|
||||
const ex1 = h('a', {href: '/url', oncreate: route.link});
|
||||
|
||||
const ex2 = h('a', {href: '/url', oncreate: route.link({replace: true})});
|
||||
const ex2 = h('a', {href: '/url', oncreate: route.link({
|
||||
replace: true,
|
||||
state: {abc: 123},
|
||||
title: "Title"
|
||||
})});
|
||||
|
||||
Reference in New Issue
Block a user