From 598f523b9a007d434ff7dd63ba686ba6c38d511c Mon Sep 17 00:00:00 2001 From: Imanuel Ulbricht Date: Tue, 20 Jun 2017 18:36:03 +0200 Subject: [PATCH] Update index.d.ts Added definition for RegExp --- types/page/index.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/types/page/index.d.ts b/types/page/index.d.ts index 229cfd273c..0f9317c6a4 100644 --- a/types/page/index.d.ts +++ b/types/page/index.d.ts @@ -26,6 +26,17 @@ declare namespace PageJS { * Links that are not of the same origin are disregarded and will not be dispatched. */ (path: string, ...callbacks: Callback[]): void; + /** + * Defines a route mapping path to the given callback(s). + * + * page('/', user.list) + * page('/user/:id', user.load, user.show) + * page('/user/:id/edit', user.load, user.edit) + * page('*', notfound) + * + * Links that are not of the same origin are disregarded and will not be dispatched. + */ + (path: RegExp, ...callbacks: Callback[]): void; /** * This is equivalent to page('*', callback) for generic "middleware". */