1 | import { Application as FeathersApplication, Params as FeathersParams, HookContext, SetupMethod, ServiceMethods } from '@feathersjs/feathers';
|
2 | import express from 'express';
|
3 |
|
4 | declare const feathersExpress: FeathersExpress;
|
5 | export = feathersExpress;
|
6 |
|
7 | type Express = typeof express;
|
8 |
|
9 | interface FeathersExpress extends Express {
|
10 | <T>(app: FeathersApplication<T>): feathersExpress.Application<T>;
|
11 |
|
12 | (app?: any): express.Express;
|
13 |
|
14 | default: FeathersExpress;
|
15 |
|
16 | rest: {
|
17 | (handler?: express.RequestHandler): () => void;
|
18 | formatter: express.RequestHandler;
|
19 | httpMethod: (verb: string, uris?: string | string[]) => <T>(method: T) => T;
|
20 | };
|
21 |
|
22 | original: Express;
|
23 |
|
24 | errorHandler (options?: {
|
25 | public?: string,
|
26 | logger?: { error: (msg: any) => void, info: (msg: any) => void },
|
27 | html?: any,
|
28 | json?: any
|
29 | }): express.ErrorRequestHandler;
|
30 |
|
31 | notFound (): express.RequestHandler;
|
32 |
|
33 | parseAuthentication (...strategies: string[]): express.RequestHandler;
|
34 | authenticate (...strategies: string[]): express.RequestHandler;
|
35 | }
|
36 |
|
37 | declare namespace feathersExpress {
|
38 | type Application<T = any> = express.Express & FeathersApplication<T>;
|
39 | }
|
40 |
|
41 | declare module 'express-serve-static-core' {
|
42 | interface Request {
|
43 | feathers?: Partial<FeathersParams>;
|
44 | }
|
45 |
|
46 | interface Response {
|
47 | data?: any;
|
48 | hook?: HookContext;
|
49 | }
|
50 |
|
51 | type FeathersService = Partial<ServiceMethods<any> & SetupMethod>;
|
52 |
|
53 | interface IRouterMatcher<T> {
|
54 |
|
55 | <P extends Params = ParamsDictionary, ResBody = any, ReqBody = any>(
|
56 | path: PathParams,
|
57 | ...handlers: (RequestHandler<P, ResBody, ReqBody> | FeathersService | Application)[]
|
58 | ): T;
|
59 | }
|
60 | }
|