import { Principal } from '@dfinity/principal'; import { IDL } from '@dfinity/candid'; import { Identity, RequestId } from '@dfinity/agent'; import { CallInterceptor, QueryRetryInterceptorErrorCallback } from './call-interceptors'; import { Certificate } from '@dfinity/agent/lib/cjs/certificate'; import { HttpDetailsResponse } from '@dfinity/agent/lib/cjs/agent'; import { ActorMethodExtended, ActorMethodMappedExtended, ActorSubclass, HttpAgent } from '../agent-js'; import { NodeSignature } from '@dfinity/agent/lib/cjs/agent/api'; import { CallExtraData } from '../utils/call-extra-data'; export type DelegateCallOptions = { retryErrorCallback?: QueryRetryInterceptorErrorCallback; }; export interface LazyRequest { requestId: RequestId; commit: () => Promise; } export type ActorMethodExtendedReturnType = { certificate?: Certificate; httpDetails?: HttpDetailsResponse; signatures?: NodeSignature[]; result: R; }; export declare const mapResponse: (response: ActorMethodExtendedReturnType) => [T, CallExtraData]; export declare const defaultIcAgent: HttpAgent; export declare abstract class Delegate { protected readonly idl: IDL.InterfaceFactory; protected readonly _canisterPrincipal: Principal | string; readonly network: 'ic' | 'local'; protected constructor(idl: IDL.InterfaceFactory, _canisterPrincipal: Principal | string, network: 'ic' | 'local'); get canisterPrincipal(): Principal; private _service; private _canisterPromise; get service(): Promise>>; get agent(): Promise; replaceIdentity(identity: Identity): Promise; protected wrapCall>(call: (...args: Args) => Promise, interceptors: CallInterceptor[], ...args: Args): Promise; protected query, R>(call: ActorMethodExtended, options?: DelegateCallOptions, ...args: Args): Promise; protected queryWithExtras, R>(call: ActorMethodExtended, options?: DelegateCallOptions, ...args: Args): Promise<[R, CallExtraData]>; protected resQuery, Ok, Err>(call: ActorMethodExtended, options?: DelegateCallOptions, ...args: Args): Promise; protected optQuery, R>(call: ActorMethodExtended, options?: DelegateCallOptions, ...args: Args): Promise; protected update, R>(call: ActorMethodExtended, ...args: Args): Promise; protected updateWithExtras, R>(call: ActorMethodExtended, ...args: Args): Promise<[R, CallExtraData]>; protected resUpdate, Ok, Err>(call: ActorMethodExtended, ...args: Args): Promise; prepareUpdateRequest, Res>(call: ActorMethodExtended, ...args: Args): Promise>; prepareUpdateRequestWithExtras, Res>(call: ActorMethodExtended, ...args: Args): Promise>; fetchUpdateRequestResponse, Res>(call: ActorMethodExtended, requestId: RequestId): Promise; fetchUpdateRequestResponseWithExtras, Res>(call: ActorMethodExtended, requestId: RequestId): Promise<[Res, CallExtraData]>; }