From 73fd71304b884388849974511b033bba72049ccf Mon Sep 17 00:00:00 2001 From: Patrick Cauley Date: Mon, 22 May 2017 15:13:35 -0400 Subject: [PATCH 1/2] Added before and after to feathers service --- index.d.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/index.d.ts b/index.d.ts index 0e0c149ea6..18925c9265 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,13 +6,13 @@ declare function feathers(): feathers.Application; declare namespace feathers { export var static: typeof express.static; - + type NullableId = number | string | null; interface Params { query?: any; } - + interface Pagination { total: Number, limit: Number, @@ -34,13 +34,13 @@ declare namespace feathers { get?(id: number | string, params?: Params, callback?: any): Promise; /** - * Creates a new resource with data. + * Creates a new resource with data. */ create?(data: T | T[], params?: Params, callback?: any): Promise; /** * Replaces the resource identified by id with data. - * Update multiples resources with id equal `null` + * Update multiples resources with id equal `null` */ update?(id: NullableId, data: T, params?: Params, callback?: any): Promise; @@ -58,9 +58,12 @@ declare namespace feathers { remove?(id: NullableId, params?: Params, callback?: any): Promise; /** - * Initialize your service with any special configuration or if connecting services that are very tightly coupled + * Initialize your service with any special configuration or if connecting services that are very tightly coupled */ setup?(app?: Application, path?: string): void; + + before(any?): this; + after(any?): this; } interface FeathersUseHandler extends expressCore.IRouterHandler, express.IRouterMatcher { @@ -74,7 +77,7 @@ declare namespace feathers { service(location: string): Service; /** - * Registers a new service for that path and returns the wrapped service object + * Registers a new service for that path and returns the wrapped service object */ service(location: string, service: Service, options?: any): Service; @@ -84,7 +87,7 @@ declare namespace feathers { setup(): this; /** - * Register a service object + * Register a service object */ use: FeathersUseHandler; } From b063d2612c6ba23cfd4e46a274755738fada0151 Mon Sep 17 00:00:00 2001 From: Patrick Cauley Date: Mon, 22 May 2017 15:18:18 -0400 Subject: [PATCH 2/2] Feathers typigns --- index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.d.ts b/index.d.ts index 18925c9265..ca30e0f12f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -64,6 +64,8 @@ declare namespace feathers { before(any?): this; after(any?): this; + filter(any?): this; + } interface FeathersUseHandler extends expressCore.IRouterHandler, express.IRouterMatcher {