import { SDError } from '@superdoc/document-api'; /** Error codes used by {@link DocumentApiAdapterError} to classify adapter failures. */ export type DocumentApiAdapterErrorCode = 'TARGET_NOT_FOUND' | 'INVALID_TARGET' | 'AMBIGUOUS_TARGET' | 'CAPABILITY_UNAVAILABLE' | 'INVALID_INPUT' | 'INVALID_NESTING' | 'INVALID_PLACEMENT' | 'INTERNAL_ERROR' | 'PRECONDITION_FAILED' | 'CAPABILITY_UNSUPPORTED' | 'STORY_NOT_FOUND' | 'MATERIALIZATION_FAILED' | 'ADDRESS_STALE' | 'DUPLICATE_ID' | 'INVALID_CONTEXT' | 'RAW_MODE_REQUIRED' | 'PRESERVE_ONLY_VIOLATION' | 'LOCK_VIOLATION' | 'TYPE_MISMATCH'; /** * Structured error thrown by document-api adapter functions. * * @param code - Machine-readable error classification. * @param message - Human-readable description. * @param details - Optional payload with additional context. */ export declare class DocumentApiAdapterError extends Error { readonly code: DocumentApiAdapterErrorCode; readonly details?: unknown; constructor(code: DocumentApiAdapterErrorCode, message: string, details?: unknown); } /** * Type guard that narrows an unknown value to {@link DocumentApiAdapterError}. * * @param error - The value to test. * @returns `true` if the value is a `DocumentApiAdapterError` instance. */ export declare function isDocumentApiAdapterError(error: unknown): error is DocumentApiAdapterError; /** * Converts a {@link DocumentApiAdapterError} to an {@link SDError}. * * Maps adapter error codes to the normative SDErrorCode vocabulary. * Unknown codes fall through as `INTERNAL_ERROR`. */ export declare function adapterErrorToSDError(error: DocumentApiAdapterError): SDError; //# sourceMappingURL=errors.d.ts.map