mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Additional signature for m.route.link
This commit is contained in:
Vendored
+3
-2
@@ -94,8 +94,9 @@ declare namespace Mithril {
|
||||
set(route: string, data?: any, options?: RouteOptions): void;
|
||||
/** Defines a router prefix which is a fragment of the URL that dictates the underlying strategy used by the router. */
|
||||
prefix(urlFragment: string): void;
|
||||
/** This method is meant to be used in conjunction with an <a> Vnode's oncreate hook. */
|
||||
link(vnode: Vnode<any, any>): (e?: Event) => any;
|
||||
/** 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;
|
||||
/** Returns the named parameter value from the current route. */
|
||||
param(name: string): string;
|
||||
/** Gets all route parameters. */
|
||||
|
||||
@@ -125,4 +125,10 @@ route.set('/test2', undefined, {
|
||||
|
||||
const path: string = route.get();
|
||||
|
||||
const fn = route.link(h('div', 'test'));
|
||||
const fn1: (e?: Event) => any = route.link(h('div', 'test'));
|
||||
|
||||
const fn2: (v: Vnode<any, any>) => any = route.link({replace: true});
|
||||
|
||||
const ex1 = h('a', {href: '/url', oncreate: route.link});
|
||||
|
||||
const ex2 = h('a', {href: '/url', oncreate: route.link({replace: true})});
|
||||
|
||||
Reference in New Issue
Block a user