import type { AdapterRequestContext, CachePolicy, LuvioAdapterEventObserver } from '@luvio/engine';
import type { DataCallbackTuple } from '@salesforce/lds-bindings';
import type { DraftQueueItemMetadata } from '@salesforce/lds-drafts';
import type { NativeErrorResponse } from './responses';
import type { ObservabilityContext } from '@salesforce/lds-runtime-mobile';
export declare const ldsMobileInstrumentation: import("o11y/dist/modules/o11y/client/interfaces").Instrumentation;
export type NativeCallbackValue = NativeCallbackData | NativeCallbackError | NativeCallbackErrors;
export type NativeCallbackData = {
    data: any | undefined;
    error?: undefined;
    errors?: undefined;
};
export type NativeCallbackError = {
    data?: undefined;
    error: NativeErrorResponse;
    errors?: undefined;
};
export type NativeCallbackErrors = {
    data?: undefined;
    error?: undefined;
    errors: NativeErrorResponse[];
};
export type NativeOnSnapshot = (value: NativeCallbackValue) => void;
export type NativeOnResponse = (value: NativeCallbackValue) => void;
export type Unsubscribe = () => void;
type NativeCachePolicy = CachePolicy;
type NativeAdapterRequestPriority = 'high' | 'normal' | 'background';
type NativeObservabilityContext = ObservabilityContext;
type NativeLuvioEventObserver = LuvioAdapterEventObserver;
export interface NativeAdapterRequestContext {
    cachePolicy?: NativeCachePolicy;
    priority?: NativeAdapterRequestPriority;
    observabilityContext?: NativeObservabilityContext;
    luvioEventObserver?: NativeLuvioEventObserver;
}
/**
 * Coerces a request context passed in from native to a luvio request context
 * @param nativeRequestContext request context passed in from native
 * @returns Coerced luvio request context
 */
export declare function buildAdapterRequestContext(nativeRequestContext: NativeAdapterRequestContext | undefined): AdapterRequestContext | undefined;
export declare function buildInvalidConfigError(error: unknown): NativeCallbackError;
export declare function buildNativeCallbackValue(adapterCallbackValue: DataCallbackTuple<unknown>): NativeCallbackValue;
/**
 * Executes the adapter with the given adapterId and config.  Will call onSnapshot
 * callback with data or error.  Returns an unsubscribe function that should
 * be called to stop receiving updated snapshots.
 *
 * This function returns an error if the given adapterId cannot be found or is not
 * a GET wire adapter.  It will also return an error if it fails to parse the config string.
 */
export declare function subscribeToAdapter(adapterId: string, config: string, onSnapshot: NativeOnSnapshot, nativeAdapterRequestContext?: NativeAdapterRequestContext): Unsubscribe;
/**
 * @deprecated There is no situation in which any consumer actually wants to replace the draft.
 * call {@link invokeAdapterWithDraftToMerge} instead`.
 * Keep it for now for app back compatibility.
 * Will be removed in future, ideally 2 releases later.
 */
export declare function invokeAdapterWithDraftToReplace(adapterId: string, config: string, draftIdToReplace: string, onResponse: NativeOnResponse, nativeAdapterRequestContext?: NativeAdapterRequestContext): void;
/**
 * Executes the specified adapter with the given @param adapterId and @param config. Then
 * it merges the draft with the given id with the draft generated by
 * the mutating adapter. Will call onResult callback once with data or error.
 *
 * This function returns an error if the given adapterId cannot be found, or if the
 * adapterId is not a mutating adapter if a draft isn't created, or
 * if it fails to parse the given config string.
 *
 * If the @param adapterId is deleteRecod, the invocation of it will generate a delele draft.
 * The newly generated delete draft will replace the draft specified by @param targetDraftId
 */
export declare function invokeAdapterWithDraftToMerge(adapterId: string, config: string, targetDraftId: string, onResponse: NativeOnResponse, nativeAdapterRequestContext?: NativeAdapterRequestContext): void;
/**
 * Executes the specified adapter with the given adapterId and config. Then
 * it sets the given metadata on the draft created by the mutating adapter.  Will call
 * onResult callback once with data or error.
 *
 * This function returns an error if the given adapterId cannot be found, or if the
 * adapterId is not a mutating adapter, or if a draft isn't created, or if it
 * fails to parse the given config string.
 */
export declare function invokeAdapterWithMetadata(adapterId: string, config: string, metadata: DraftQueueItemMetadata, onResponse: NativeOnResponse, nativeAdapterRequestContext?: NativeAdapterRequestContext): void;
/**
 * Executes the specified adapter with the given adapterId and config.  Will call
 * onResponse callback once with data or error.
 *
 * This function returns an error if the given adapterId cannot be found or if it
 * fails to parse the given config string.
 */
export declare function invokeAdapter(adapterId: string, config: string, onResponse: NativeOnResponse, nativeAdapterRequestContext?: NativeAdapterRequestContext): void;
/**
 * @deprecated Use invokeAdapter or subscribeToAdapter instead
 *
 * W-9173084 Will remove this
 */
export declare function executeAdapter(adapterId: string, config: string, onSnapshot: NativeOnSnapshot, nativeAdapterRequestContext?: NativeAdapterRequestContext): Unsubscribe;
/**
 * @deprecated Use invokeAdapter instead
 *
 * W-9173084 Will remove this
 */
export declare function executeMutatingAdapter(adapterId: string, config: string, onResult: NativeOnResponse, nativeAdapterRequestContext?: NativeAdapterRequestContext): void;
export {};
