Skip to content

Commit a283a69

Browse files
committed
Improve typescript definition
1 parent b7bc24c commit a283a69

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

index.d.ts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
export interface AppAuthInput {
1+
export interface AuthConfiguration extends BaseAuthConfiguration {
22
scopes: string[];
3-
issuer: string;
4-
clientId: string;
53
redirectUrl: string;
64
aditionalParameters?: object;
75
}
86

7+
export interface BaseAuthConfiguration{
8+
issuer: string;
9+
clientId: string;
10+
}
11+
12+
export interface RevokeConfiguration{
13+
clientId: string;
14+
issuer: string;
15+
}
16+
917
export interface AuthorizeResult {
1018
accessToken: string;
1119
accessTokenExpirationDate: string;
@@ -15,14 +23,19 @@ export interface AppAuthInput {
1523
tokenType: string;
1624
}
1725

18-
export function authorize(properties: AppAuthInput): Promise<AuthorizeResult>;
26+
export interface RevokeOptions {
27+
tokenToRevoke: string;
28+
sendClientId?: boolean;
29+
}
30+
31+
export function authorize(properties: AuthConfiguration): Promise<AuthorizeResult>;
1932

2033
export function refresh(
21-
properties: AppAuthInput,
34+
properties: AuthConfiguration,
2235
{ refreshToken: string }
2336
): Promise<AuthorizeResult>;
2437

2538
export function revoke(
26-
properties: AppAuthInput,
27-
{ tokenToRevoke: string, sendClientId: boolean }
39+
properties: BaseAuthConfiguration,
40+
options: RevokeOptions
2841
): Promise<void>;

0 commit comments

Comments
 (0)