/** * Where an attachment can come from. * * `+` used to open the OS picker directly, which is one source pretending to be * all of them: on a phone it lands in Files, so photographing a diseased leaf — * the single most likely thing a farmer wants to show the assistant — took a * detour through the camera app and back. * * ★ Every source's `accept` is DERIVED, never typed out. `ATTACHMENT_ACCEPT` is * itself built from the classifier and extractor tables precisely so the picker * cannot offer a file the model then admits it cannot read — a hand-written list * once advertised .pdf a year before anything could open one. Narrowing a source * therefore filters that derived list rather than restating it, so a new * document format is offered here the moment the extractor learns it. * * ★ There is deliberately NO generic "all files" source, though the spec asks * for one. It would restore exactly the failure the derived list was written to * prevent. Every format the assistant can actually read is already reachable * through Documents or Files here; anything else is a file it would have to * refuse after the user had already chosen it. */ export type AttachmentSourceId = "camera" | "gallery" | "documents" | "files"; export interface AttachmentSource { id: AttachmentSourceId; /** i18n key and the English fallback, resolved by the caller. */ labelKey: string; labelFallback: string; /** `accept` for this source's hidden input. */ accept: string; /** * Ask for the camera rather than the gallery. Honoured on mobile browsers, * where the OS camera provides capture → preview → retake → use for free; * ignored on desktop, which falls back to the file picker rather than * breaking. */ capture?: "environment" | "user"; /** Multi-select. A camera capture is one shot at a time. */ multiple: boolean; /** * Only offer where it can work. Camera and gallery are pointless on a desktop * without one, and a control that does nothing is worse than an absent one. */ mobileOnly?: boolean; } export declare const ATTACHMENT_SOURCES: readonly AttachmentSource[]; /** * Can this device plausibly take a photo? * * Coarse on purpose. `mediaDevices` is the honest capability check but it needs * a permission prompt to be sure, and asking for the camera to decide whether to * DRAW a camera button is backwards. A pointer query separates phones and * tablets from desktops well enough for a menu entry, and the worst case is a * touchscreen laptop seeing one extra option that still opens a working picker. */ export declare function deviceHasCamera(): boolean; /** The sources worth showing on this device, in menu order. */ export declare function availableAttachmentSources(hasCamera: boolean): AttachmentSource[]; //# sourceMappingURL=attachmentSources.d.ts.map