|
| 1 | +// Type definitions for @node-oauth/express-oauth-server 3.0.0 |
| 2 | +// Project: https://github.com/node-oauth/express-oauth-server |
| 3 | +// Definitions by: Arne Schubert <https://github.com/atd-schubert> |
| 4 | +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped |
| 5 | +// TypeScript Version: 2.3 |
| 6 | + |
| 7 | +import * as express from "express"; |
| 8 | +import * as OAuth2Server from "@node-oauth/oauth2-server"; |
| 9 | + |
| 10 | +declare namespace ExpressOAuthServer { |
| 11 | + interface Options extends OAuth2Server.ServerOptions { |
| 12 | + useErrorHandler?: boolean | undefined; |
| 13 | + continueMiddleware?: boolean | undefined; |
| 14 | + } |
| 15 | +} |
| 16 | + |
| 17 | +declare class ExpressOAuthServer { |
| 18 | + server: OAuth2Server; |
| 19 | + |
| 20 | + constructor(options: ExpressOAuthServer.Options); |
| 21 | + |
| 22 | + authenticate( |
| 23 | + options?: OAuth2Server.AuthenticateOptions |
| 24 | + ): ( |
| 25 | + request: express.Request, |
| 26 | + response: express.Response, |
| 27 | + next: express.NextFunction |
| 28 | + ) => Promise<OAuth2Server.Token>; |
| 29 | + |
| 30 | + authorize( |
| 31 | + options?: OAuth2Server.AuthorizeOptions |
| 32 | + ): ( |
| 33 | + request: express.Request, |
| 34 | + response: express.Response, |
| 35 | + next: express.NextFunction |
| 36 | + ) => Promise<OAuth2Server.AuthorizationCode>; |
| 37 | + |
| 38 | + token( |
| 39 | + options?: OAuth2Server.TokenOptions |
| 40 | + ): ( |
| 41 | + request: express.Request, |
| 42 | + response: express.Response, |
| 43 | + next: express.NextFunction |
| 44 | + ) => Promise<OAuth2Server.Token>; |
| 45 | +} |
| 46 | + |
| 47 | +export = ExpressOAuthServer; |
0 commit comments