/** * Friendly, action-guiding copy for the *recoverable* stitch-failure * `CameraErrorCode`s — the ones a user can fix by simply re-capturing. * Hosts map these onto an Alert/toast instead of surfacing the raw * cv::Stitcher diagnostic (e.g. "warpRoi too large (8171x12336) — * estimator produced degenerate camera params"). * * Returns `null` for every non-recoverable / non-stitch code (permission * denied, device unavailable, generic finalize failure, unknown, ...): * those have no single corrective action to suggest, so the host should * fall back to its generic error display. * * Lives in the SDK (not per-host) so every consumer shows the same * vetted guidance for the same failure — and so the mapping is * unit-testable in isolation. */ import type { CameraErrorCode } from './Camera'; export interface UserFacingStitchError { /** Short, friendly alert title. */ title: string; /** One-paragraph, plain-language corrective guidance. */ message: string; } /** * The four recoverable stitch outcomes, each with copy tuned to its * actual root cause. `Partial>` keeps the keys * compile-checked against the `CameraErrorCode` union — a renamed or * dropped code breaks the build here rather than silently going * unhandled. */ /** * A partial map of recoverable-error code → copy, for the `overrides` * argument of {@link userFacingStitchError}. Hosts localising the SDK pass * their translated strings here (typically built from their i18n catalogue, * keyed by the same `CameraErrorCode`s exposed by {@link RECOVERABLE_STITCH_CODES}). */ export type UserFacingStitchErrorOverrides = Partial>; export declare const RECOVERABLE_STITCH_GUIDANCE: Partial>; /** * The recoverable stitch-error codes this module has built-in copy for. * A host wiring i18n iterates these to know exactly which codes need a * translation (every other `CameraErrorCode` maps to `null` and uses the * host's generic error UI). */ export declare const RECOVERABLE_STITCH_CODES: CameraErrorCode[]; /** * Maps a `CameraErrorCode` to friendly, action-guiding alert copy. * * Localisation: pass `overrides` (a partial code→copy map, typically from * your i18n catalogue) and any code present there wins over the built-in * English; codes you omit fall back to the bundled copy. This is the * host-side mirror of the `guidanceCopy` prop — the recoverable-error alert * is rendered by the HOST (in its `onError` handler), so it is localised * here rather than through ``. * * @returns the title+message for a recoverable stitch failure, or `null` * if `code` has no single user-recoverable action (the host should * then show its generic error UI). */ export declare function userFacingStitchError(code: CameraErrorCode, overrides?: UserFacingStitchErrorOverrides): UserFacingStitchError | null; //# sourceMappingURL=cameraErrorMessages.d.ts.map