Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
export interface AuthConfiguration extends BaseAuthConfiguration {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit here, the indentation seems to be off

scopes: string[];
redirectUrl: string;
aditionalParameters?: {[name: string]: any};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do

aditionalParameters?: {[name: string]: string};

as the values can technically only be strings?

}

export interface BaseAuthConfiguration{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this to the top as AuthConfiguration extends it before it's being defined. Just for readability 👍

issuer: string;
clientId: string;
}

export interface RevokeConfiguration{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make sure that there's a space before {?

@kadikraman: Can you point prettier—I think it's set up with lint-staged, right?—at all TS files as well?

clientId: string;
issuer: string;
}

export interface AuthorizeResult {
accessToken: string;
accessTokenExpirationDate: string;
aditionalParameters?: {[name: string]: any};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

idToken: string;
refreshToken: string;
tokenType: string;
}

export interface RevokeConfiguration {
tokenToRevoke: string;
sendClientId?: boolean;
}

export interface RefreshConfiguration {
refreshToken: string;
}

export function authorize(config: AuthConfiguration): Promise<AuthorizeResult>;

export function refresh(config: AuthConfiguration, refreshConfig: RefreshConfiguration): Promise<AuthorizeResult>;

export function revoke(config: BaseAuthConfiguration, refreshConfig: RevokeConfiguration): Promise<void>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely

revokeConfig: RevokeConfiguration

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.0",
"description": "React Native bridge for AppAuth for supporting any OAuth 2 provider",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "jest",
"lint": "eslint .",
Expand Down