--- title: "Option types" description: "The TypeScript types Slate's Camera methods take, field by field: CameraOptions, ConnectOptions, TakePhotoOptions, LiveViewFrameOptions and the rest." url: https://darkgrade.com/docs/slate/reference/types-options last_updated: 2026-12-04 docs_index: https://darkgrade.com/docs/llms.txt --- # Option types > The TypeScript types Slate's Camera methods take, field by field: CameraOptions, ConnectOptions, TakePhotoOptions, LiveViewFrameOptions and the rest. > ## 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 you pass to `Camera`: its constructor options, and the options and choices of its methods. 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 { CameraOptions, TakePhotoOptions } from '@darkgrade/slate' ``` | Group | Types | | - | - | | [Options](#options) | [`FocusDirection`](#focusdirection) [`FocusStepSize`](#focusstepsize) [`PhotoDestination`](#photodestination) [`TakePhotoOptions`](#takephotooptions) [`LiveViewFrameOptions`](#liveviewframeoptions) [`ZoomDirection`](#zoomdirection) [`ZoomOptions`](#zoomoptions) [`ZoomSpeed`](#zoomspeed) [`MediaDownloadOptions`](#mediadownloadoptions) [`MediaPreviewSize`](#mediapreviewsize) [`CameraEventHandler`](#cameraeventhandler) [`CameraEventName`](#cameraeventname) [`CameraOptions`](#cameraoptions) [`ConnectOptions`](#connectoptions) | ## Options What the methods of [`Camera`](https://darkgrade.com/docs/slate/getting_started/camera.md) take. ### FocusDirection Which way [`nudgeFocus`](https://darkgrade.com/docs/slate/getting_started/camera.md#nudgefocus) moves focus: `near` towards the camera, `far` away from it. ```typescript type FocusDirection = 'near' | 'far' ``` ### FocusStepSize A small, medium or large manual-focus step, like the < << <<< buttons in vendor remote apps. ```typescript type FocusStepSize = 'small' | 'medium' | 'large' ``` ### PhotoDestination Where a photo goes: the camera's card; the card and this computer (its bytes come back); or this computer only, never saved to the card (`computerOnly`). ```typescript type PhotoDestination = 'card' | 'computer' | 'computerOnly' ``` ### TakePhotoOptions What [`takePhoto`](https://darkgrade.com/docs/slate/getting_started/camera.md#takephoto) takes. Every field is optional. ```typescript interface TakePhotoOptions { autofocus?: boolean destination?: PhotoDestination download?: boolean rawCompression?: RawCompression includeInfo?: boolean } ``` #### TakePhotoOptions fields **`autofocus?`** · `boolean` · default `true` Focus before the shutter. False releases without waiting for focus. **`destination?`** · `PhotoDestination` · default `'card'` With 'computer' the photo is still saved to the card, and its bytes are returned. With 'computerOnly' the camera sends it to the computer and does not save it to the card, so it has no media id. See [`PhotoDestination`](https://darkgrade.com/docs/slate/reference/types-options.md#photodestination). **`download?`** · `boolean` · default `true` False keeps every byte of the photo on the camera, even the copy some cameras send the computer to name a new file (Sony); the card's own listing confirms it. Only with destination 'card'. **`rawCompression?`** · `RawCompression` RAW compression for this photo only, put back afterwards, such as 'Lossless'. See [`RawCompression`](https://darkgrade.com/docs/slate/reference/types-setting-values.md#rawcompression). **`includeInfo?`** · `boolean` · default `false` Also return the camera's own description of the photo (its PTP [ObjectInfo](https://darkgrade.com/docs/slate/reference/types-workflow.md#objectinfo)) as `info`. ### LiveViewFrameOptions What [`getLiveViewFrame`](https://darkgrade.com/docs/slate/getting_started/camera.md#getliveviewframe) takes. ```typescript interface LiveViewFrameOptions { overlay?: boolean } ``` #### LiveViewFrameOptions fields **`overlay?`** · `boolean` · default `false` Also read the camera's on-screen info. ### ZoomDirection Which way [`startZoom`](https://darkgrade.com/docs/slate/getting_started/camera.md#startzoom) zooms: `in` towards the long end of the lens, `out` towards the wide end. ```typescript type ZoomDirection = 'in' | 'out' ``` ### ZoomOptions What [`startZoom`](https://darkgrade.com/docs/slate/getting_started/camera.md#startzoom) takes. ```typescript interface ZoomOptions { speed: ZoomSpeed } ``` #### ZoomOptions fields **`speed`** · `ZoomSpeed` How fast the lens zooms. See [`ZoomSpeed`](https://darkgrade.com/docs/slate/reference/types-options.md#zoomspeed). ### ZoomSpeed How fast [`startZoom`](https://darkgrade.com/docs/slate/getting_started/camera.md#startzoom) moves the lens. ```typescript type ZoomSpeed = 'slow' | 'medium' | 'fast' ``` ### MediaDownloadOptions Progress and cancel for [`downloadMedia`](https://darkgrade.com/docs/slate/getting_started/camera.md#downloadmedia). ```typescript interface MediaDownloadOptions { onProgress?: ( receivedBytes: number, totalBytes: number, ) => void signal?: AbortSignal } ``` #### MediaDownloadOptions fields **`onProgress?`** · `(receivedBytes: number, totalBytes: number) => void` Called after each chunk with the bytes received so far. **`signal?`** · `AbortSignal` Cancels between chunks; the download rejects with the signal's reason. ### MediaPreviewSize The sizes [`getMediaPreview`](https://darkgrade.com/docs/slate/getting_started/camera.md#getmediapreview) returns: `thumbnail` is the small one, `preview` a larger one. A file's `previews` lists which it offers. ```typescript type MediaPreviewSize = 'thumbnail' | 'preview' ``` ### CameraEventHandler A handler for [`on`](https://darkgrade.com/docs/slate/getting_started/camera.md#on): called with no arguments each time the event fires. ```typescript type CameraEventHandler = () => void ``` ### CameraEventName `settingsChanged`: a setting changed on the camera. `mediaAdded`: a new photo or clip is on the card. ```typescript type CameraEventName = 'settingsChanged' | 'mediaAdded' ``` ### CameraOptions What `new Camera()` takes. Every field is optional. ```typescript interface CameraOptions { logger?: Partial device?: DeviceDescriptor transport?: TransportInterface usb?: USB transactionPolicy?: Partial keepAlive?: boolean vendorId?: number firstContact?: boolean } ``` #### CameraOptions fields **`logger?`** · `Partial` · default `off` Logging. Off unless you turn it on: nothing is drawn in the terminal and the console is left alone. See [`LoggerConfig`](https://darkgrade.com/docs/slate/reference/types-workflow.md#loggerconfig). **`device?`** · `DeviceDescriptor` · default `the one attached camera` Which camera to open, such as a USB filter when several are attached. Without it, Slate opens the one attached camera. See [`DeviceDescriptor`](https://darkgrade.com/docs/slate/reference/types-workflow.md#devicedescriptor). **`transport?`** · `TransportInterface` · default `USB` A transport other than the built-in USB one, such as `IPTransport` from `@darkgrade/slate/protocol` for [PTP/IP](https://darkgrade.com/docs/slate/getting_started/ptp-ip.md). See [`TransportInterface`](https://darkgrade.com/docs/slate/reference/types-workflow.md#transportinterface). **`usb?`** · `USB` A WebUSB implementation for the built-in USB transport to use under Node. **`transactionPolicy?`** · `Partial` · default `DEFAULT_TRANSACTION_POLICY` Timeouts and DeviceBusy retries for every transaction. A field you leave out keeps its default. See [`TransactionPolicy`](https://darkgrade.com/docs/slate/reference/types-workflow.md#transactionpolicy). **`keepAlive?`** · `boolean` · default `true` Send the advertised Canon session heartbeat without changing saved body settings. **`vendorId?`** · `number` Which vendor's driver to use when the transport cannot tell, as over PTP/IP. On USB the attached camera's own vendor ID decides, and a different `vendorId` here makes [`connect()`](https://darkgrade.com/docs/slate/getting_started/camera.md#connect) fail with [CameraRefusedError](https://darkgrade.com/docs/slate/reference/errors.md#camerarefusederror). **`firstContact?`** · `boolean` · default `true` On Node, a body outside Slate's validated list gets one read-only inventory per model+firmware per installation, shared as a `first-contact` profile unless telemetry is off. ### ConnectOptions How [`Camera.connect`](https://darkgrade.com/docs/slate/getting_started/camera.md#connect) opens the camera. ```typescript interface ConnectOptions { observeOnly?: boolean device?: DeviceDescriptor } ``` #### ConnectOptions fields **`observeOnly?`** · `boolean` · default `false` Read without changing any setting. Slate still opens the vendor's control session (Canon's remote and event modes, Sony's authenticated remote session) because nothing can be read without it, but it writes no host preference: Sony keeps its dial priority and saved image destination. **`device?`** · `DeviceDescriptor` The body to open, when it differs from the `device` given to the constructor. See [`DeviceDescriptor`](https://darkgrade.com/docs/slate/reference/types-workflow.md#devicedescriptor). ## Other types > [card] [Result types](https://darkgrade.com/docs/slate/reference/types-results.md) > > The types `Camera` hands back: what each method resolves to, what an event carries, and what `recover()` reports. > [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.