UNPKG

1.05 kBTypeScriptView Raw
1import { Id, NullableId, Params, ServiceInterface } from '@feathersjs/feathers';
2interface ServiceOptions {
3 name: string;
4 connection: any;
5 method: string;
6 events?: string[];
7}
8export declare type SocketService<T = any, D = Partial<any>, P extends Params = Params> = Service<T, D, P>;
9export declare class Service<T = any, D = Partial<T>, P extends Params = Params> implements ServiceInterface<T, D, P> {
10 events: string[];
11 path: string;
12 connection: any;
13 method: string;
14 constructor(options: ServiceOptions);
15 send<X = any>(method: string, ...args: any[]): Promise<X>;
16 methods(this: any, ...names: string[]): any;
17 find(params?: Params): Promise<T | T[]>;
18 get(id: Id, params?: Params): Promise<T>;
19 create(data: any, params?: Params): Promise<T>;
20 update(id: Id, data: any, params?: Params): Promise<T>;
21 patch(id: NullableId, data: any, params?: Params): Promise<T | T[]>;
22 remove(id: NullableId, params?: Params): Promise<T | T[]>;
23 off(name: string, ...args: any[]): any;
24}
25export {};