Skip to content

Commit

Permalink
fix: Typings for express request and response properties
Browse files Browse the repository at this point in the history
  • Loading branch information
vonagam committed Oct 10, 2019
1 parent d7f5107 commit c005ba1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/express/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application as FeathersApplication } from '@feathersjs/feathers';
import { Application as FeathersApplication, Params as FeathersParams, HookContext } from '@feathersjs/feathers';
import express from 'express';

declare const feathersExpress: FeathersExpress;
Expand Down Expand Up @@ -36,3 +36,18 @@ interface FeathersExpress extends Express {
declare namespace feathersExpress {
type Application<T = any> = express.Express & FeathersApplication<T>;
}

declare module 'express-serve-static-core' {
// tslint:disable-next-line:no-empty-interface
interface Application extends FeathersApplication<any> {
}

interface Request {
feathers?: Partial<FeathersParams>;
}

interface Response {
data?: any;
hook?: HookContext;
}
}

0 comments on commit c005ba1

Please sign in to comment.