UNPKG

1.51 kBTypeScriptView Raw
1import { Id, NullableId, Paginated, PaginationOptions, Params } from "@feathersjs/feathers";
2import { NeDBAdapterParams, NeDbAdapter } from "./adapter";
3export declare class NeDBService<Result extends Record<string, any> = any, Data extends Record<string, any> = Partial<Result>, ServiceParams extends Params<any> = NeDBAdapterParams, PatchData = Partial<Data>> extends NeDbAdapter<Result, Data, ServiceParams, PatchData> {
4 find(params?: ServiceParams & {
5 paginate?: PaginationOptions;
6 }): Promise<Paginated<Result>>;
7 find(params?: ServiceParams & {
8 paginate: false;
9 }): Promise<Result[]>;
10 find(params?: ServiceParams): Promise<Paginated<Result> | Result[]>;
11 get(id: Id, params?: ServiceParams): Promise<Result>;
12 create(data: Data, params?: ServiceParams): Promise<Result>;
13 create(data: Data[], params?: ServiceParams): Promise<Result[]>;
14 create(data: Data | Data[], params?: ServiceParams): Promise<Result | Result[]>;
15 update(id: Id, data: Data, params?: ServiceParams): Promise<Result>;
16 patch(id: null, data: PatchData, params?: ServiceParams): Promise<Result[]>;
17 patch(id: Id, data: PatchData, params?: ServiceParams): Promise<Result>;
18 patch(id: NullableId, data: PatchData, params?: ServiceParams): Promise<Result | Result[]>;
19 remove(id: Id, params?: ServiceParams): Promise<Result>;
20 remove(id: null, params?: ServiceParams): Promise<Result[]>;
21 remove(id: NullableId, params?: ServiceParams): Promise<Result | Result[]>;
22}