@design-sdk/figma-oauth
Version:
OAuth management for figma
28 lines (27 loc) • 806 B
TypeScript
import { OAuthStage } from "./types";
export declare class OAuth {
static readonly _authprocs: Map<string, OAuthState>;
static new({ state, redirect_uri, }: {
state?: string;
redirect_uri?: string;
}): OAuthState;
static get(state: string): OAuthState;
static resolve(state: string): void;
}
export declare class OAuthState {
private _stage;
readonly _app_id: string;
readonly _app_secret: string;
readonly redirect_uri: string;
get stage(): OAuthStage;
readonly state: string;
constructor({ state, redirect_uri, }: {
state?: string;
redirect_uri?: string;
});
get authUrl(): string;
authenticate({ code }: {
code: string;
}): Promise<import("./types").FigmaOAuthTokenResponse>;
resolve(): void;
}