forked from node-oauth/express-oauth-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
50 lines (42 loc) · 1.39 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Type definitions for @node-oauth/express-oauth-server 3.0.0
// Project: https://github.com/node-oauth/express-oauth-server
// Definitions by: Arne Schubert <https://github.com/atd-schubert>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import core from "express-serve-static-core";
import * as OAuth2Server from "@node-oauth/oauth2-server";
declare namespace ExpressOAuthServer {
interface Options extends OAuth2Server.ServerOptions {
useErrorHandler?: boolean | undefined;
continueMiddleware?: boolean | undefined;
}
}
declare class ExpressOAuthServer {
server: OAuth2Server;
constructor(options: ExpressOAuthServer.Options);
// Should be return void to avoid type errors on express 5
authenticate(
options?: OAuth2Server.AuthenticateOptions
): (
request: core.Request,
response: core.Response,
next: core.NextFunction
) => Promise<void>;
// Should be return void to avoid type errors on express 5
authorize(
options?: OAuth2Server.AuthorizeOptions
): (
request: core.Request,
response: core.Response,
next: core.NextFunction
) => Promise<void>;
// Should be return void to avoid type errors on express 5
token(
options?: OAuth2Server.TokenOptions
): (
request: core.Request,
response: core.Response,
next: core.NextFunction
) => Promise<void>;
}
export = ExpressOAuthServer;