8000 Added type definitions for hook-less service methods. by deskoh · Pull Request #1288 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content
Closed
Changes from all commits
Commits
8000 File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/feathers/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,27 @@ export interface ServiceMethods<T> {

find? (params?: Params): Promise<T | T[] | Paginated<T>>;

_find? (params?: Params): Promise<T | T[] | Paginated<T>>;

get? (id: Id, params?: Params): Promise<T>;

_get? (id: Id, params?: Params): Promise<T>;

create? (data: Partial<T> | Array<Partial<T>>, params?: Params): Promise<T | T[]>;

_create? (data: Partial<T> | Array<Partial<T>>, params?: Params): Promise<T | T[]>;

update? (id: NullableId, data: T, params?: Params): Promise<T>;

_update? (id: NullableId, data: T, params?: Params): Promise<T>;

patch? (id: NullableId, data: Partial<T>, params?: Params): Promise<T>;

_patch? (id: NullableId, data: Partial<T>, params?: Params): Promise<T>;

remove? (id: NullableId, params?: Params): Promise<T>;

_remove? (id: NullableId, params?: Params): Promise<T>;
}

export interface SetupMethod {
Expand Down Expand Up @@ -204,7 +216,7 @@ export interface Application<ServiceTypes = any> extends EventEmitter {

setup (server?: any): this;

service<L extends keyof ServiceTypes> (location: L): ServiceTypes[L];
service<L extends keyof ServiceTypes> (location: L): Service<ServiceTypes[L]>;

service (location: string): Service<any>;

Expand Down
0