|
1 | | -// Type definitions for @feathersjs/express 1.1 |
2 | | -// Project: https://feathersjs.com |
3 | | -// Definitions by: Jan Lohage <https://github.com/j2L4e> |
4 | | -// Aleksey Klimenko <https://github.com/DadUndead> |
5 | | -// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript |
6 | | -// TypeScript Version: 2.3 |
7 | | - |
8 | 1 | import { Application as FeathersApplication } from '@feathersjs/feathers'; |
9 | | -import * as express from 'express'; |
10 | | - |
11 | | -declare const feathersExpress: (<T>(app: FeathersApplication<T>) => Application<T>); |
12 | | -export default feathersExpress; |
13 | | -export type Application<T = any> = express.Application & FeathersApplication<T>; |
14 | | - |
15 | | -export function errorHandler (options?: { |
16 | | - public?: string, |
17 | | - logger?: { error?: (msg: string) => void }|null, |
18 | | - html?: any, |
19 | | - json?: any |
20 | | -}): express.ErrorRequestHandler; |
21 | | -export function notFound (): express.RequestHandler; |
22 | | - |
23 | | -export const rest: { |
24 | | - (handler?: express.RequestHandler): () => void; |
25 | | - formatter: express.RequestHandler; |
26 | | -}; |
27 | | - |
28 | | -/* |
29 | | - * Re-export of the express package. |
30 | | - **/ |
31 | | - |
32 | | -export { |
33 | | - CookieOptions, |
34 | | - Errback, |
35 | | - ErrorRequestHandler, |
36 | | - Express, |
37 | | - Handler, |
38 | | - IRoute, |
39 | | - IRouter, |
40 | | - IRouterHandler, |
41 | | - IRouterMatcher, |
42 | | - json, |
43 | | - MediaType, |
44 | | - NextFunction, |
45 | | - Request, |
46 | | - RequestHandler, |
47 | | - RequestParamHandler, |
48 | | - Response, |
49 | | - Router, |
50 | | - RouterOptions, |
51 | | - Send, |
52 | | - static, |
53 | | - urlencoded |
54 | | -} from 'express'; |
55 | | - |
56 | | -export function parseAuthentication (...strategies: string[]): express.RequestHandler; |
57 | | -export function authenticate (...strategies: string[]): express.RequestHandler; |
58 | | -export const original: () => express.Application; |
| 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 | + }; |
| 20 | + |
| 21 | + original: Express; |
| 22 | + |
| 23 | + errorHandler (options?: { |
| 24 | + public?: string, |
| 25 | + logger?: { error?: (msg: string) => void | null }, |
| 26 | + html?: any, |
| 27 | + json?: any |
| 28 | + }): express.ErrorRequestHandler; |
| 29 | + |
| 30 | + notFound (): express.RequestHandler; |
| 31 | + |
| 32 | + parseAuthentication (...strategies: string[]): express.RequestHandler; |
| 33 | + authenticate (...strategies: string[]): express.RequestHandler; |
| 34 | +} |
| 35 | + |
| 36 | +declare namespace feathersExpress { |
| 37 | + type Application<T = any> = express.Express & FeathersApplication<T>; |
| 38 | +} |
0 commit comments