UNPKG

@vansite/ts-sharetribe-flex-sdk

Version:

This is a TypeScript SDK for Sharetribe Flex API. It reduces the complexity of the API and provides a more user-friendly interface.

23 lines (22 loc) 747 B
import { AuthToken } from "./authentication"; /** * Interface for managing authentication tokens in a store. */ export interface TokenStore { token?: AuthToken | null; expiration?: number; /** * Retrieves the current authentication token. * @returns A promise resolving to the current token or null if no token exists. */ getToken: (() => AuthToken | null) | (() => Promise<AuthToken | null>); /** * Sets a new authentication token. * @param args - Object containing the token's details. */ setToken: ((args: AuthToken) => void) | ((args: AuthToken) => Promise<void>); /** * Removes the current authentication token. */ removeToken: (() => void) | (() => Promise<void>); }