Skip to content

Commit b7bc24c

Browse files
committed
Add typescript definition
1 parent 8457854 commit b7bc24c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

index.d.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export interface AppAuthInput {
2+
scopes: string[];
3+
issuer: string;
4+
clientId: string;
5+
redirectUrl: string;
6+
aditionalParameters?: object;
7+
}
8+
9+
export interface AuthorizeResult {
10+
accessToken: string;
11+
accessTokenExpirationDate: string;
12+
additionalParameters: object;
13+
idToken: string;
14+
refreshToken: string;
15+
tokenType: string;
16+
}
17+
18+
export function authorize(properties: AppAuthInput): Promise<AuthorizeResult>;
19+
20+
export function refresh(
21+
properties: AppAuthInput,
22+
{ refreshToken: string }
23+
): Promise<AuthorizeResult>;
24+
25+
export function revoke(
26+
properties: AppAuthInput,
27+
{ tokenToRevoke: string, sendClientId: boolean }
28+
): Promise<void>;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.0.0",
44
"description": "React Native bridge for AppAuth for supporting any OAuth 2 provider",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "jest",
89
"lint": "eslint .",

0 commit comments

Comments
 (0)