UNPKG

vtex

Version:

The platform for e-commerce apps

33 lines (32 loc) 1.29 kB
import { InstanceOptions, IOClient, IOContext } from '@vtex/api'; interface IOContextOptions { account?: string; authToken?: string; region?: string; workspace?: string; } export interface InstantiationOpts { /** * If the user is not logged in (there's no AuthToken stored) * and this option is set to true the client's functions * will be wrapped with a function that throws the error: * 'Error trying to call client before login.' * @default true */ requireAuth?: boolean; } export declare class IOClientFactory { static DEFAULT_TIMEOUT: number; private static createDummyLogger; /** * Toolbelt does not participate in distributed tracing, so we provide a * no-op tracer whose `isTraceSampled` is false. The HttpClient tracing * middleware short-circuits in that case and never invokes the other * tracer methods, keeping this safe at runtime. */ private static createDummyTracer; static createIOContext(opts?: IOContextOptions): IOContext; static createClient<T extends IOClient>(ClientClass: typeof IOClient, customContext?: Partial<IOContext>, customOptions?: Partial<InstanceOptions>, instantiationOpts?: InstantiationOpts): T; private static createInstanceOptions; } export {};