Skip to content

Commit 19221ac

Browse files
authored
Merge pull request #11 from shrihari-prakash/master
Added type declarations
2 parents c2a8b11 + 06b09bf commit 19221ac

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

index.d.ts

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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;

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "3.0.0",
44
"description": "OAuth provider for express",
55
"main": "index.js",
6+
"typings": "index.d.ts",
67
"scripts": {
78
"lint": "npx eslint .",
89
"lint:fix": "npx eslint . --fix",

0 commit comments

Comments
 (0)