UNPKG

1.4 kBTypeScriptView Raw
1import { HookContext, NullableId, Params } from '@feathersjs/feathers';
2export declare const METHOD_HEADER = "x-service-method";
3export interface ServiceParams {
4 id: NullableId;
5 data: any;
6 params: Params;
7}
8export declare const statusCodes: {
9 created: number;
10 noContent: number;
11 methodNotAllowed: number;
12 success: number;
13 seeOther: number;
14};
15export declare const knownMethods: {
16 [key: string]: string;
17};
18export declare function getServiceMethod(_httpMethod: string, id: unknown, headerOverride?: string): string;
19export declare const argumentsFor: {
20 get: ({ id, params }: ServiceParams) => (Params<import("@feathersjs/feathers").Query> | NullableId)[];
21 find: ({ params }: ServiceParams) => Params<import("@feathersjs/feathers").Query>[];
22 create: ({ data, params }: ServiceParams) => any[];
23 update: ({ id, data, params }: ServiceParams) => any[];
24 patch: ({ id, data, params }: ServiceParams) => any[];
25 remove: ({ id, params }: ServiceParams) => (Params<import("@feathersjs/feathers").Query> | NullableId)[];
26 default: ({ data, params }: ServiceParams) => any[];
27};
28export declare function getStatusCode(context: HookContext, body: any, location: string | string[]): number;
29export declare function getResponse(context: HookContext): {
30 status: number;
31 headers: {
32 [key: string]: string | string[];
33 };
34 body: any;
35};