-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
32 lines (28 loc) · 886 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { AxiosInstance, AxiosRequestConfig } from "axios";
declare module "nanuid-websdk" {
interface TokenResponse {
access_token: string;
refresh_token: string;
}
interface TokenValidationResult {
isValid: boolean;
expiresIn?: number;
error?: string;
}
interface RetryConfig extends AxiosRequestConfig {
_retry?: boolean;
}
export class OAuthSDK {
static validateToken(token?: string): TokenValidationResult;
static getToken(token?: string): string | undefined;
static getRefreshToken(): string | null;
static setTokens(
accessToken: string,
refreshToken: string,
days?: number
): void;
static reissueToken(refreshToken?: string): Promise<string | null>;
static logout(redirectUrl?: string): void;
static createAuthorizedClient(baseURL?: string, token?: string): Promise<AxiosInstance>;
}
}