Skip to content

Commit

Permalink
Fix typescript defnition of Service. All the service methods should be (
Browse files Browse the repository at this point in the history
#573)

optional
  • Loading branch information
harish2704 authored and daffl committed May 9, 2017
1 parent 559345b commit 3dcac6e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.d.ts
Expand Up @@ -26,41 +26,41 @@ declare namespace feathers {
* Retrieves a list of all resources from the service.
* Provider parameters will be passed as params.query
*/
find(params?: Params, callback?: any): Promise<T[] | Pagination<T>>;
find?(params?: Params, callback?: any): Promise<T[] | Pagination<T>>;

/**
* Retrieves a single resource with the given id from the service.
*/
get(id: number | string, params?: Params, callback?: any): Promise<T>;
get?(id: number | string, params?: Params, callback?: any): Promise<T>;

/**
* Creates a new resource with data.
*/
create(data: T | T[], params?: Params, callback?: any): Promise<T | T[]>;
create?(data: T | T[], params?: Params, callback?: any): Promise<T | T[]>;

/**
* Replaces the resource identified by id with data.
* Update multiples resources with id equal `null`
*/
update(id: NullableId, data: T, params?: Params, callback?: any): Promise<T>;
update?(id: NullableId, data: T, params?: Params, callback?: any): Promise<T>;

/**
* Merges the existing data of the resource identified by id with the new data.
* Implement patch additionally to update if you want to separate between partial and full updates and support the PATCH HTTP method.
* Patch multiples resources with id equal `null`
*/
patch(id: NullableId, data: any, params?: Params, callback?: any): Promise<T>;
patch?(id: NullableId, data: any, params?: Params, callback?: any): Promise<T>;

/**
* Removes the resource with id.
* Delete multiple resources with id equal `null`
*/
remove(id: NullableId, params?: Params, callback?: any): Promise<T>;
remove?(id: NullableId, params?: Params, callback?: any): Promise<T>;

/**
* Initialize your service with any special configuration or if connecting services that are very tightly coupled
*/
setup(app?: Application, path?: string): void;
setup?(app?: Application, path?: string): void;
}

interface FeathersUseHandler<T> extends expressCore.IRouterHandler<T>, express.IRouterMatcher<T> {
Expand Down

0 comments on commit 3dcac6e

Please sign in to comment.