import { type JSONSchema, JsonSchemaViolationError } from '@conduit-client/jsonschema-validate'; import { type WireAdapter, type WireConfigValue, type WireContextValue, type WireDataCallback } from '@conduit-client/lwc-types'; import { type SyncOrAsync, type Unsubscribe, type SubscribableResult, type CommandError, type Result } from '@conduit-client/utils'; import { type GraphQLResponse } from '@conduit-client/graphql-normalization/v1'; import type { SubscribableResultCommand, ResultCommand, MaybeSubscribableResultCommand } from '@conduit-client/bindings-utils/v1'; export type WireAdapterCompatibleCommand = SubscribableResultCommand | ResultCommand | MaybeSubscribableResultCommand; export declare function isIncompleteConfigError(err: unknown): boolean; export type GetCommand = WireAdapterCompatibleCommand> = (condig: Config) => CommandType; /** * Binds a Command to a LWC wire adapter. * @see https://lwc.dev/guide/wire_adapter */ export declare abstract class CommandWireAdapterConstructor = WireAdapterCompatibleCommand> implements WireAdapter { protected callback: WireDataCallback; connected: boolean; config?: Config; unsubscriber?: Unsubscribe; exposeRefresh: boolean; abstract configSchema?: JSONSchema; abstract getCommand(): CommandType; protected refresh?: () => SyncOrAsync>; constructor(callback: WireDataCallback, sourceContext?: { tagName?: string; }, options?: { skipEmptyEmit?: true; }); connect(): void; disconnect(): void; update(config: Config, _context?: WireContextValue): void; protected emit(result?: Result | SubscribableResult): void; protected invokeAdapter(): void; protected handleExecutionThrow(error: unknown): void; /** * Hook for subclasses to handle a JsonSchemaViolationError from the config * schema assertion. The default re-throws so legacy non-GraphQL wire * adapters keep their existing throw behavior. Overrides are expected to * either emit an error result or re-throw — silently returning will * swallow the error. */ protected handleConfigSchemaViolation(error: JsonSchemaViolationError): void; protected unsubscribe(): void; } /** * Maps a command failure (unknown or user-visible) into a GraphQLResponse suitable for consumers. */ export declare function toGraphQLResponseFromFailure(failure: unknown): { data: GraphQLResponse['data']; errors: GraphQLResponse['errors']; };