import { FlexportApiV2ClientInstance } from './generated/apiClient'; import * as TE from 'fp-ts/lib/TaskEither'; import { ErrorInfo } from './types/ErrorInfo'; import { ResolvablePage, ApiObject, ResolvableCollection, ResolvableObject, Page } from './types'; import { TypedApiObject } from './types/TypedApiObject'; /** * Instance of the Flexport API v2 client * * This wraps the generated Generated API client for the Flexport v2 API, and provides additional methods for resolving links. * * @see https://github.com/distributeaid/flexport-sdk-js */ export declare type V2Client = FlexportApiV2ClientInstance & { /** * Resolve a link to a page */ resolvePage: (transform: (apiResponseObject: A) => O) => (page: ResolvablePage) => TE.TaskEither>; /** * Resolves a link to a collection (which returns a paginated response) */ resolveCollection: (transform: (apiResponseObject: A) => O) => (collection: ResolvableCollection) => TE.TaskEither>; /** * Resolves a link to a single object (e.g. the booking of a shipment) */ resolveObject: (transform: (apiResponseObject: A) => O) => (object: ResolvableObject) => TE.TaskEither; }; export declare const v2Client: ({ apiKey, endpoint, fetchImplementation, }: { apiKey: string; endpoint?: string | undefined; fetchImplementation?: typeof globalThis.fetch | undefined; }) => V2Client;