1 | import { HookContextData, HookManager, Middleware } from '@feathersjs/hooks';
|
2 | import { Service, ServiceOptions, HookContext, FeathersService, HookMap, AroundHookFunction, HookFunction } from './declarations';
|
3 | type HookStore = {
|
4 | around: {
|
5 | [method: string]: AroundHookFunction[];
|
6 | };
|
7 | before: {
|
8 | [method: string]: HookFunction[];
|
9 | };
|
10 | after: {
|
11 | [method: string]: HookFunction[];
|
12 | };
|
13 | error: {
|
14 | [method: string]: HookFunction[];
|
15 | };
|
16 | collected: {
|
17 | [method: string]: AroundHookFunction[];
|
18 | };
|
19 | collectedAll: {
|
20 | before?: AroundHookFunction[];
|
21 | after?: AroundHookFunction[];
|
22 | };
|
23 | };
|
24 | type HookEnabled = {
|
25 | __hooks: HookStore;
|
26 | };
|
27 | export declare function convertHookData(input: any): {
|
28 | [method: string]: AroundHookFunction[] | HookFunction[];
|
29 | };
|
30 | export declare function collectHooks(target: HookEnabled, method: string): AroundHookFunction[];
|
31 | export declare function enableHooks(object: any): (this: HookEnabled, input: HookMap<any, any>) => HookEnabled;
|
32 | export declare function createContext(service: Service, method: string, data?: HookContextData): HookContext;
|
33 | export declare class FeathersHookManager<A> extends HookManager {
|
34 | app: A;
|
35 | method: string;
|
36 | constructor(app: A, method: string);
|
37 | collectMiddleware(self: any, args: any[]): Middleware[];
|
38 | initializeContext(self: any, args: any[], context: HookContext): import("@feathersjs/hooks").HookContext<any, any>;
|
39 | middleware(mw: Middleware[]): this;
|
40 | }
|
41 | export declare function hookMixin<A>(this: A, service: FeathersService<A>, path: string, options: ServiceOptions): FeathersService<A>;
|
42 | export {};
|