import http from 'http' import express, { Express } from 'express' import { Application as FeathersApplication, Params as FeathersParams, HookContext, ServiceMethods, ServiceInterface, RouteLookup } from '@feathersjs/feathers' interface ExpressUseHandler { ( path: L, ...middlewareOrService: ( | Express | express.RequestHandler | express.RequestHandler[] | (keyof any extends keyof Services ? ServiceInterface : Services[L]) )[] ): T (path: string | RegExp, ...expressHandlers: express.RequestHandler[]): T (...expressHandlers: express.RequestHandler[]): T (handler: Express | express.ErrorRequestHandler): T } export interface ExpressOverrides { listen(port: number, hostname: string, backlog: number, callback?: () => void): Promise listen(port: number, hostname: string, callback?: () => void): Promise listen(port: number | string | any, callback?: () => void): Promise listen(callback?: () => void): Promise use: ExpressUseHandler server?: http.Server } export type Application = Omit & FeathersApplication & ExpressOverrides declare module '@feathersjs/feathers/lib/declarations' { interface ServiceOptions { express?: { before?: express.RequestHandler[] after?: express.RequestHandler[] composed?: express.RequestHandler } } } declare module 'express-serve-static-core' { interface Request { feathers: Partial & { [key: string]: any } lookup?: RouteLookup } interface Response { data?: any hook?: HookContext } interface IRouterMatcher { // eslint-disable-next-line

( path: PathParams, ...handlers: (RequestHandler | Partial | Application)[] ): T } }