-
-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use
export =
in TypeScript definitions (#1285)
- Loading branch information
1 parent
9abf314
commit 12d0f4b
Showing
11 changed files
with
340 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import feathers from '@feathersjs/feathers'; | ||
import authentication from '@feathersjs/authentication-client'; | ||
import errors from '@feathersjs/errors'; | ||
import primus from '@feathersjs/primus-client'; | ||
import rest from '@feathersjs/rest-client'; | ||
import socketio from '@feathersjs/socketio-client'; | ||
|
||
export as namespace feathers; | ||
|
||
declare const feathersClient: FeathersClient; | ||
export = feathersClient; | ||
|
||
type Feathers = typeof feathers; | ||
type FeathersAuthenticationClient = typeof authentication; | ||
type FeathersErrors = typeof errors; | ||
type FeathersPrimusClient = typeof primus; | ||
type FeathersRestClient = typeof rest; | ||
type FeathersSocketIOClient = typeof socketio; | ||
|
||
interface FeathersClient extends Feathers { | ||
authentication: FeathersAuthenticationClient; | ||
errors: FeathersErrors; | ||
primus: FeathersPrimusClient; | ||
rest: FeathersRestClient; | ||
socketio: FeathersSocketIOClient; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,38 @@ | ||
// Type definitions for @feathersjs/express 1.1 | ||
// Project: https://feathersjs.com | ||
// Definitions by: Jan Lohage <https://github.com/j2L4e> | ||
// Aleksey Klimenko <https://github.com/DadUndead> | ||
// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript | ||
// TypeScript Version: 2.3 | ||
|
||
import { Application as FeathersApplication } from '@feathersjs/feathers'; | ||
import * as express from 'express'; | ||
|
||
declare const feathersExpress: (<T>(app: FeathersApplication<T>) => Application<T>); | ||
export default feathersExpress; | ||
export type Application<T = any> = express.Application & FeathersApplication<T>; | ||
|
||
export function errorHandler (options?: { | ||
public?: string, | ||
logger?: { error?: (msg: string) => void }|null, | ||
html?: any, | ||
json?: any | ||
}): express.ErrorRequestHandler; | ||
export function notFound (): express.RequestHandler; | ||
|
||
export const rest: { | ||
(handler?: express.RequestHandler): () => void; | ||
formatter: express.RequestHandler; | ||
}; | ||
|
||
/* | ||
* Re-export of the express package. | ||
**/ | ||
|
||
export { | ||
CookieOptions, | ||
Errback, | ||
ErrorRequestHandler, | ||
Express, | ||
Handler, | ||
IRoute, | ||
IRouter, | ||
IRouterHandler, | ||
IRouterMatcher, | ||
json, | ||
MediaType, | ||
NextFunction, | ||
Request, | ||
RequestHandler, | ||
RequestParamHandler, | ||
Response, | ||
Router, | ||
RouterOptions, | ||
Send, | ||
static, | ||
urlencoded | ||
} from 'express'; | ||
|
||
export function parseAuthentication (...strategies: string[]): express.RequestHandler; | ||
export function authenticate (...strategies: string[]): express.RequestHandler; | ||
export const original: () => express.Application; | ||
import express from 'express'; | ||
|
||
declare const feathersExpress: FeathersExpress; | ||
export = feathersExpress; | ||
|
||
type Express = typeof express; | ||
|
||
interface FeathersExpress extends Express { | ||
<T>(app: FeathersApplication<T>): feathersExpress.Application<T>; | ||
|
||
(app?: any): express.Express; | ||
|
||
default: FeathersExpress; | ||
|
||
rest: { | ||
(handler?: express.RequestHandler): () => void; | ||
formatter: express.RequestHandler; | ||
}; | ||
|
||
original: Express; | ||
|
||
errorHandler (options?: { | ||
public?: string, | ||
logger?: { error?: (msg: string) => void | null }, | ||
html?: any, | ||
json?: any | ||
}): express.ErrorRequestHandler; | ||
|
||
notFound (): express.RequestHandler; | ||
|
||
parseAuthentication (...strategies: string[]): express.RequestHandler; | ||
authenticate (...strategies: string[]): express.RequestHandler; | ||
} | ||
|
||
declare namespace feathersExpress { | ||
type Application<T = any> = express.Express & FeathersApplication<T>; | ||
} |
Oops, something went wrong.