UNPKG

@agnostack/magento2-request

Version:

Please contact agnoStack via info@agnostack.com for any questions

55 lines (54 loc) 1.2 kB
interface AuthenticationOptions { access_token?: string; username?: string; password?: string; } export interface InitOptions { store_url: string; access_token?: string; username?: string; password?: string; store_code?: string; version?: string; fetch?: Fetch; storage?: StorageFactory; headers?: Headers; } export interface Options { authentication: AuthenticationOptions; baseURIs: BaseURIs; fetch?: Fetch; headers?: Headers; } export interface Headers { [key: string]: string; } export interface AuthBody { username: string; password: string; } export interface StorageFactory { setItem(key: string, value: string): void; getItem(key: string): string | null; removeItem(key: string): void; } export interface Fetch { (input?: Request | string, init?: RequestInit): Promise<Response>; } export interface Credentials { access_token: string; expires: number; isExpired: Function; } export interface RequestOptions { method: string; path?: string; data?: object; headers?: Headers; type?: string; } export interface BaseURIs { rest: string; query: string; } export {};