mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-22 12:33:38 +08:00
fix(@feathersjs/various): proper module augmentation, add reexports (#23195)
* fix feathersjs__{authentication-client,express,socket-commons}
* fix feathersjs__authentication-client
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import feathers, { Application } from '@feathersjs/feathers';
|
||||
import feathersExpress from '@feathersjs/express';
|
||||
import { Application as ExpressApplication } from 'express';
|
||||
import feathersExpress, { original, rest, notFound, errorHandler } from '@feathersjs/express';
|
||||
|
||||
const app: ExpressApplication & Application<{}> = feathersExpress(feathers());
|
||||
const app = feathersExpress(feathers());
|
||||
|
||||
app.configure(rest());
|
||||
app.use(notFound());
|
||||
app.use(errorHandler());
|
||||
|
||||
16
types/feathersjs__express/index.d.ts
vendored
16
types/feathersjs__express/index.d.ts
vendored
@@ -5,6 +5,18 @@
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { Application as FeathersApplication } from '@feathersjs/feathers';
|
||||
import { Application as ExpressApplication } from 'express';
|
||||
import * as express from 'express';
|
||||
|
||||
export default function feathersExpress<T>(app: FeathersApplication<T>): ExpressApplication & FeathersApplication<T>;
|
||||
export default function feathersExpress<T>(app: FeathersApplication<T>): express.Application & FeathersApplication<T>;
|
||||
|
||||
export function errorHandler(options?: any): express.ErrorRequestHandler;
|
||||
export function notFound(): express.RequestHandler;
|
||||
export const rest: {
|
||||
(): () => void;
|
||||
formatter: express.RequestHandler;
|
||||
};
|
||||
|
||||
/*
|
||||
* Re-export of the express package. Can't be typed properly without just copying everything.
|
||||
**/
|
||||
export const original: any;
|
||||
|
||||
Reference in New Issue
Block a user