--- title: "Result types" description: "The TypeScript types Slate's Camera methods resolve to, field by field: Photo, Clip, MediaItem, LiveViewFrame, CameraInfo, Battery and CardStatus." url: https://darkgrade.com/docs/slate/reference/types-results last_updated: 2026-12-04 docs_index: https://darkgrade.com/docs/llms.txt --- # Result types > The TypeScript types Slate's Camera methods resolve to, field by field: Photo, Clip, MediaItem, LiveViewFrame, CameraInfo, Battery and CardStatus. > ## Documentation Index > Fetch the complete documentation index at: https://darkgrade.com/docs/llms.txt > Use this file to discover all available pages before exploring further. The types `Camera` hands back: what each method resolves to, what an event carries, and what `recover()` reports. This is one of the 5 pages of the [types reference](https://darkgrade.com/docs/slate/reference/types.md), which names every type. A field ending in `?` may be absent: Slate leaves out what a camera does not report, and never guesses it. ```typescript import type { Photo, RecoveryReport } from '@darkgrade/slate' ``` | Group | Types | | - | - | | [Results](#results) | [`FocusNudge`](#focusnudge) [`FocusResult`](#focusresult) [`CardPhoto`](#cardphoto) [`ComputerPhoto`](#computerphoto) [`Photo`](#photo) [`Clip`](#clip) [`FocusFrame`](#focusframe) [`LiveViewFrame`](#liveviewframe) [`LiveViewOverlay`](#liveviewoverlay) [`CardStatus`](#cardstatus) [`MediaItem`](#mediaitem) [`Battery`](#battery) [`CameraInfo`](#camerainfo) [`DiscoveredCamera`](#discoveredcamera) [`RecoveryReport`](#recoveryreport) | | [Recovery](#recovery) | [`CameraRecoveryOptions`](#camerarecoveryoptions) [`CameraRecoveryReport`](#camerarecoveryreport) [`CameraRecoveryStep`](#camerarecoverystep) | ## Results What the methods of [`Camera`](https://darkgrade.com/docs/slate/getting_started/camera.md) resolve to, and what its events carry. ### FocusNudge What a focus nudge did. ```typescript interface FocusNudge { atLimit: boolean } ``` #### FocusNudge fields **`atLimit`** · `boolean` The lens stopped at the end of its focus travel that way: it moved less than the step, or not at all when it was already there. Another nudge the same way will not move it. ### FocusResult Whether [`autofocus`](https://darkgrade.com/docs/slate/getting_started/camera.md#autofocus) confirmed focus. - `acquired`: the camera reported focus. - `not-acquired`: the camera reported it could not focus (low contrast, too dark, too close). - `unknown`: the camera focused for a while but reports nothing either way (Canon's timed hold, Sony in movie mode). ```typescript type FocusResult = 'acquired' | 'not-acquired' | 'unknown' ``` ### CardPhoto A photo confirmed on the card. ```typescript interface CardPhoto { destination: 'card' mediaId?: string name: string sizeBytes: number info?: ObjectInfo } ``` #### CardPhoto fields **`destination`** · `'card'` Where the photo went. **`mediaId?`** · `string` The card file's media id, the same id [`listMedia()`](https://darkgrade.com/docs/slate/getting_started/camera.md#listmedia) gives it, for [`getMediaPreview()`](https://darkgrade.com/docs/slate/getting_started/camera.md#getmediapreview) and [`downloadMedia()`](https://darkgrade.com/docs/slate/getting_started/camera.md#downloadmedia). Absent only when the camera offers no card listing over this connection (`listMedia` is unsupported), so no id can name the file. **`name`** · `string` The file name the camera gave the photo, such as `DSC01234.JPG`. **`sizeBytes`** · `number` The size of the card file, as [`listMedia()`](https://darkgrade.com/docs/slate/getting_started/camera.md#listmedia) reports it. **`info?`** · `ObjectInfo` With `includeInfo`: the [ObjectInfo](https://darkgrade.com/docs/slate/reference/types-workflow.md#objectinfo) the camera sent for the photo. On Sony it describes the copy the camera sends the computer, whose size can be smaller than the card file's `sizeBytes`. See [`ObjectInfo`](https://darkgrade.com/docs/slate/reference/types-workflow.md#objectinfo). ### ComputerPhoto A photo whose bytes reached this computer. With destination 'computer' it is also on the card, and `data` is the card file. With 'computerOnly' it is not on the card: it has no `mediaId`. ```typescript interface ComputerPhoto extends Omit { destination: 'computer' | 'computerOnly' data: Uint8Array name: string mediaId?: string sizeBytes: number info?: ObjectInfo } ``` #### ComputerPhoto fields **`destination`** · `'computer' | 'computerOnly'` Where the photo went. **`data`** · `Uint8Array` The photo's bytes. **`name`** · `string` The file name the camera gave the photo, such as `DSC01234.JPG`. **`mediaId?`** · `string` The card file's media id, the same id [`listMedia()`](https://darkgrade.com/docs/slate/getting_started/camera.md#listmedia) gives it, for [`getMediaPreview()`](https://darkgrade.com/docs/slate/getting_started/camera.md#getmediapreview) and [`downloadMedia()`](https://darkgrade.com/docs/slate/getting_started/camera.md#downloadmedia). Absent only when the camera offers no card listing over this connection (`listMedia` is unsupported), so no id can name the file. **`sizeBytes`** · `number` The size of the card file, as [`listMedia()`](https://darkgrade.com/docs/slate/getting_started/camera.md#listmedia) reports it. **`info?`** · `ObjectInfo` With `includeInfo`: the [ObjectInfo](https://darkgrade.com/docs/slate/reference/types-workflow.md#objectinfo) the camera sent for the photo. On Sony it describes the copy the camera sends the computer, whose size can be smaller than the card file's `sizeBytes`. See [`ObjectInfo`](https://darkgrade.com/docs/slate/reference/types-workflow.md#objectinfo). Extends [`CardPhoto`](https://darkgrade.com/docs/slate/reference/types-results.md#cardphoto). ### Photo What [`takePhoto`](https://darkgrade.com/docs/slate/getting_started/camera.md#takephoto) resolves to: a [`CardPhoto`](https://darkgrade.com/docs/slate/reference/types-results.md#cardphoto) for the destination `card`, a [`ComputerPhoto`](https://darkgrade.com/docs/slate/reference/types-results.md#computerphoto) for `computer` and `computerOnly`. ```typescript type Photo = CardPhoto | ComputerPhoto ``` ### Clip A finished movie file the camera wrote to its card during one recording. ```typescript interface Clip { mediaId: string name: string sizeBytes?: number } ``` #### Clip fields **`mediaId`** · `string` The clip's media id: the one [`listMedia()`](https://darkgrade.com/docs/slate/getting_started/camera.md#listmedia) gives it, or its PTP object handle in decimal on a camera that names card files only by handle. **`name`** · `string` The file name on the card, such as `C0001.MP4`. **`sizeBytes?`** · `number` Bytes on the card; absent when the camera reports a size it cannot state (over 4 GiB). ### FocusFrame A frame the camera draws over its picture: its focus area, a detected face or a tracked subject. ```typescript interface FocusFrame { kind: 'focus' | 'face' | 'tracking' focused: boolean centerX: number centerY: number width: number height: number } ``` #### FocusFrame fields **`kind`** · `'focus' | 'face' | 'tracking'` Whether it marks the focus area, a detected face or a tracked subject. **`focused`** · `boolean` True once the camera reports this frame in focus. **`centerX`** · `number` The centre's horizontal position, 0 (left) to 1 (right). **`centerY`** · `number` The centre's vertical position, 0 (top) to 1 (bottom). **`width`** · `number` The width, as a fraction of the picture. **`height`** · `number` The height, as a fraction of the picture. ### LiveViewFrame What [`getLiveViewFrame`](https://darkgrade.com/docs/slate/getting_started/camera.md#getliveviewframe) resolves to: one picture and the frames the camera draws over it. ```typescript interface LiveViewFrame { jpeg: Uint8Array focusFrames: FocusFrame[] overlay?: LiveViewOverlay } ``` #### LiveViewFrame fields **`jpeg`** · `Uint8Array` The current picture as a JPEG. **`focusFrames`** · `FocusFrame[]` The camera's focus frames in this picture. See [`FocusFrame`](https://darkgrade.com/docs/slate/reference/types-results.md#focusframe). **`overlay?`** · `LiveViewOverlay` Present when the overlay was requested. See [`LiveViewOverlay`](https://darkgrade.com/docs/slate/reference/types-results.md#liveviewoverlay). ### LiveViewOverlay The camera's own on-screen info (menus, dialogs, shooting info), drawn to lay over the picture. ```typescript interface LiveViewOverlay { png: Uint8Array } ``` #### LiveViewOverlay fields **`png`** · `Uint8Array` A PNG with transparency, the size of the camera's display. ### CardStatus One card slot as the camera reports it now. A field the camera does not report is absent. ```typescript interface CardStatus { slot: number state: 'ready' | 'absent' | 'error' | 'unknown' writable?: boolean capacityBytes?: number freeBytes?: number photosRemaining?: number recordingSecondsRemaining?: number } ``` #### CardStatus fields **`slot`** · `number` 1 for the first slot. **`state`** · `'ready' | 'absent' | 'error' | 'unknown'` `ready`: a card is in and readable. `unknown`: the camera did not say. **`writable?`** · `boolean` Whether the camera says it can record to this card; absent when it does not say. **`capacityBytes?`** · `number` The card's size. **`freeBytes?`** · `number` The space left on it. **`photosRemaining?`** · `number` The photos that still fit, as the camera counts them at its current settings. **`recordingSecondsRemaining?`** · `number` The recording time left, as the camera counts it at its current settings. ### MediaItem One file on the card, as [`listMedia`](https://darkgrade.com/docs/slate/getting_started/camera.md#listmedia) lists it. ```typescript interface MediaItem { id: string name: string kind: 'photo' | 'clip' | 'other' slot: number sizeBytes?: number capturedAt?: string widthPixels?: number heightPixels?: number previews: readonly MediaPreviewSize[] } ``` #### MediaItem fields **`id`** · `string` Opaque; survives a reconnect while the file stays on the card. **`name`** · `string` The file name on the card, such as `DSC01234.ARW`. **`kind`** · `'photo' | 'clip' | 'other'` Whether the file is a photo, a clip or something else. **`slot`** · `number` The card slot it is on; 1 for the first. **`sizeBytes?`** · `number` Bytes on the card, when the camera reports the size. **`capturedAt?`** · `string` The camera's local wall time, ISO 8601 without an offset (`2026-11-24T14:05:09`). **`widthPixels?`** · `number` The width of the picture, when the camera reports it. **`heightPixels?`** · `number` The height of the picture, when the camera reports it. **`previews`** · `readonly MediaPreviewSize[]` The preview sizes [`getMediaPreview`](https://darkgrade.com/docs/slate/getting_started/camera.md#getmediapreview) can return for this file. See [`MediaPreviewSize`](https://darkgrade.com/docs/slate/reference/types-options.md#mediapreviewsize). ### Battery What the camera reports about its power now. A field the camera does not report is absent. ```typescript interface Battery { percent?: number level?: 'empty' | 'low' | 'medium' | 'high' | 'full' minutesRemaining?: number powerSource: 'battery' | 'usb' | 'dc' | 'poe' | 'unknown' batteryPresent?: boolean } ``` #### Battery fields **`percent?`** · `number` 0–100, when the camera reports a percentage. **`level?`** · `'empty' | 'low' | 'medium' | 'high' | 'full'` The camera's coarse level, when it reports one (Canon reports only this). **`minutesRemaining?`** · `number` The camera's own estimate for current conditions; never derived from the percentage. **`powerSource`** · `'battery' | 'usb' | 'dc' | 'poe' | 'unknown'` `unknown` unless the camera says; a USB cable or an outlet is not evidence. **`batteryPresent?`** · `boolean` Present only when the camera reports it. ### CameraInfo What the body reports about itself. Fields the body does not report are absent, never guessed. ```typescript interface CameraInfo { manufacturer: string model: string firmware: string serialNumber?: string lensMount?: string connection: 'usb' | 'wifi' | 'ip' } ``` #### CameraInfo fields **`manufacturer`** · `string` The make, such as `Sony`. **`model`** · `string` As the camera names itself, such as `ILCE-7M5`. **`firmware`** · `string` The firmware version, as the camera reports it. **`serialNumber?`** · `string` The body's serial number, when it reports one. **`lensMount?`** · `string` Present only for model families whose mount follows from the name (E, A, Z, F, RF). **`connection`** · `'usb' | 'wifi' | 'ip'` `ip` is PTP/IP, over Wi-Fi or Ethernet; `wifi` is a vendor's own Wi-Fi session. ### DiscoveredCamera One attached camera found by [`Camera.discover()`](https://darkgrade.com/docs/slate/getting_started/camera.md#cameradiscover), without opening a session. ```typescript interface DiscoveredCamera { vendorId: number productId: number serialNumber?: string manufacturer?: string model?: string } ``` #### DiscoveredCamera fields **`vendorId`** · `number` The USB vendor ID, such as `0x054c` for Sony. **`productId`** · `number` The USB product ID of the model. **`serialNumber?`** · `string` The USB serial number, when the device reports one. **`manufacturer?`** · `string` The USB manufacturer string, as the device reports it. **`model?`** · `string` The USB product string, as the device reports it. ### RecoveryReport What [`Camera.recover()`](https://darkgrade.com/docs/slate/getting_started/camera.md#recover) did: each software step, whether the camera answered GetDeviceInfo afterwards, and whether only power or hub cycling is left. [`CameraRecoveryReport`](https://darkgrade.com/docs/slate/reference/types-results.md#camerarecoveryreport) is the same type. ```typescript type RecoveryReport = CameraRecoveryReport ``` ## Recovery What [`recover()`](https://darkgrade.com/docs/slate/getting_started/camera.md#recover) takes and reports. [Errors and recovery](https://darkgrade.com/docs/slate/guides/errors.md) shows when to call it. ### CameraRecoveryOptions Limits for [`recover`](https://darkgrade.com/docs/slate/getting_started/camera.md#recover). ```typescript interface CameraRecoveryOptions { stepTimeoutMilliseconds?: number waitForDeviceMilliseconds?: number allowPortReset?: boolean } ``` #### CameraRecoveryOptions fields **`stepTimeoutMilliseconds?`** · `number` · default `8 s` Upper bound for each transaction and reset during recovery. **`waitForDeviceMilliseconds?`** · `number` · default `20 s` How long to wait for the camera to (re)appear on USB. **`allowPortReset?`** · `boolean` · default `true` Disable when recovery must preserve USB enumeration and other consumers. ### CameraRecoveryReport What [`recover`](https://darkgrade.com/docs/slate/getting_started/camera.md#recover) did: each software step, whether the camera answered afterwards, and whether only power or hub cycling is left. ```typescript interface CameraRecoveryReport { recovered: boolean needsPhysicalAction: boolean steps: CameraRecoveryStep[] durationMilliseconds: number identity?: { manufacturer: string model: string firmware: string } } ``` #### CameraRecoveryReport fields **`recovered`** · `boolean` The camera answered GetDeviceInfo after one of the steps. **`needsPhysicalAction`** · `boolean` Software recovery could not bring the camera back: only now are power or hub cycling warranted. **`steps`** · `CameraRecoveryStep[]` Each step tried, in order. See [`CameraRecoveryStep`](https://darkgrade.com/docs/slate/reference/types-results.md#camerarecoverystep). **`durationMilliseconds`** · `number` How long the whole recovery took. **`identity?`** · `{ manufacturer: string; model: string; firmware: string }` What the camera answered to GetDeviceInfo, when it recovered. ### CameraRecoveryStep One step of a recovery and how it went. ```typescript interface CameraRecoveryStep { step: 'enumerate' | 'session' | 'device-reset' | 'port-reset' ok: boolean durationMilliseconds: number detail?: string } ``` #### CameraRecoveryStep fields **`step`** · `'enumerate' | 'session' | 'device-reset' | 'port-reset'` Which step: finding the device, a fresh session, a PTP Device Reset or a USB port reset. **`ok`** · `boolean` Whether the step succeeded. **`durationMilliseconds`** · `number` How long the step took. **`detail?`** · `string` What went wrong, when it did. ## Other types > [card] [Option types](https://darkgrade.com/docs/slate/reference/types-options.md) > > The types you pass to `Camera`: its constructor options, and the options and choices of its methods. > [card] [Capability types](https://darkgrade.com/docs/slate/reference/types-capabilities.md) > > The types that say what the connected camera is and can do now: what `getCapabilities()` returns, what `setControl` takes, and which model was identified. > [card] [Setting value types](https://darkgrade.com/docs/slate/reference/types-setting-values.md) > > One type per setting: the values its getter returns and its setter takes, with the types the typed getters and setters are declared with. > [card] [Workflow, protocol and runtime types](https://darkgrade.com/docs/slate/reference/types-workflow.md) > > The types around `Camera`: the workflows built on it, the connection under it, and the host that shares cameras between callers. ## Related > [card] [Camera](https://darkgrade.com/docs/slate/getting_started/camera.md) > > The class: constructor, every method, what each returns and throws. > [card] [Settings](https://darkgrade.com/docs/slate/reference/settings.md) > > Every setting id with its values, getter, setter and vendor properties. > [card] [Types](https://darkgrade.com/docs/slate/reference/types.md) > > Every exported type, field by field. > [card] [Errors](https://darkgrade.com/docs/slate/reference/errors.md) > > Every error class: when it is thrown and what to do. > [card] [Entry points](https://darkgrade.com/docs/slate/reference/entry-points.md) > > Every import path of the package and what it exports.