3 Star 0 Fork 0

Gitee 极速下载 / oauth2-client-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/zalando-stups/oauth2-client-js
克隆/下载
index.d.ts 3.42 KB
一键复制 编辑 原始数据 按行查看 历史
declare class OAuthErrorResponse {
constructor(response: {
error: string;
state: string;
error_description: string;
});
error: string;
state: string;
error_description: string;
getMessage(): string;
}
declare class RefreshRequest {
constructor(config: {
refresh_token: string;
scope: string;
});
refresh_token: string;
scope: string;
}
declare interface IOAuthRequest {
response_type: string;
scope: string;
metadata: object;
}
declare class OAuthRequest implements IOAuthRequest {
response_type: string;
scope: string;
metadata: object;
constructor(config: IOAuthRequest);
}
declare interface IOAuthImplicitRequest extends IOAuthRequest {
client_id: string;
redirect_uri: string;
state: string;
}
declare class OAuthImplicitRequest extends OAuthRequest implements IOAuthImplicitRequest {
client_id: string;
redirect_uri: string;
state: string;
constructor(config: IOAuthImplicitRequest);
}
declare interface IOAuthResponse {
access_token: string;
token_type: string;
refresh_token: string;
expires_in: number;
scope: string;
}
declare class OAuthResponse implements IOAuthResponse {
access_token: string;
token_type: string;
refresh_token: string;
expires_in: number;
scope: string;
constructor(response: IOAuthResponse);
}
declare interface IOAuthImplicitResponse extends IOAuthResponse {
state: string;
}
declare class OAuthImplicitResponse extends OAuthResponse implements IOAuthImplicitResponse {
state: string;
constructor(response: IOAuthImplicitResponse);
}
declare class OAuthTokenStorage {
constructor();
get(key: string): string;
set(key: string, val: string): void;
remove(key: string): void;
_empty(): void;
_purge(): void;
}
declare class MemoryTokenStorage extends OAuthTokenStorage {
items: {
[key: string]: string;
}
}
declare class LocalTokenStorage extends OAuthTokenStorage {
constructor(prefix: string, localStorage: WindowLocalStorage);
localStorage: WindowLocalStorage;
prefix: string;
}
declare interface IProvider {
id: string;
authorization_url: string;
storage: WindowLocalStorage;
}
declare class Provider implements IProvider {
id: string;
authorization_url: string;
storage: WindowLocalStorage;
constructor(config: IProvider);
auth_url_has_query: boolean;
deleteTokens(): void;
remember(request: OAuthImplicitRequest): void | boolean;
forget(request: OAuthImplicitRequest): void;
isExpected(response: OAuthImplicitResponse): boolean;
hasAccessToken(): boolean;
getAccessToken(): string;
setAccessToken(token: string): void;
hasRefreshToken(): boolean;
getRefreshToken(): boolean;
setRefreshToken(token: string): void;
encodeInUri(request: OAuthRequest): string;
requestToken(request: OAuthRequest): string;
refreshToken(): string | boolean;
decodeFromUri(fragment: string): OAuthErrorResponse | OAuthImplicitResponse;
handleRefresh(response: OAuthResponse): void;
handleResponse(response: OAuthImplicitResponse): OAuthErrorResponse | OAuthImplicitResponse;
parse(fragment: string): Error | OAuthErrorResponse | OAuthImplicitResponse;
}
export {
Provider,
OAuthImplicitResponse as Response,
OAuthImplicitRequest as Request,
OAuthErrorResponse as Error,
MemoryTokenStorage as MemoryStorage,
}
JavaScript
1
https://gitee.com/mirrors/oauth2-client-js.git
git@gitee.com:mirrors/oauth2-client-js.git
mirrors
oauth2-client-js
oauth2-client-js
master

搜索帮助