--- title: "Capability types" description: "The TypeScript types behind getCapabilities() and setControl in Slate: CameraCapabilities, CameraControlState, CameraControlId and camera identification." url: https://darkgrade.com/docs/slate/reference/types-capabilities last_updated: 2026-12-04 docs_index: https://darkgrade.com/docs/llms.txt --- # Capability types > The TypeScript types behind getCapabilities() and setControl in Slate: CameraCapabilities, CameraControlState, CameraControlId and camera identification. > ## 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 that say what the connected camera is and can do now: what `getCapabilities()` returns, what `setControl` takes, and which model was identified. 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 { CameraCapabilities, CameraControlState } from '@darkgrade/slate' ``` | Group | Types | | - | - | | [Capabilities and controls](#capabilities-and-controls) | [`CameraRecordingState`](#camerarecordingstate) [`OperationAvailability`](#operationavailability) [`CameraCapabilities`](#cameracapabilities) [`CameraControlId`](#cameracontrolid) [`CameraControlInputs`](#cameracontrolinputs) [`CameraControlState`](#cameracontrolstate) [`CameraControlSession`](#cameracontrolsession) [`UnrecognizedValues`](#unrecognizedvalues) [`CameraLens`](#cameralens) | | [Identification](#identification) | [`VerifiedFeature`](#verifiedfeature) [`CameraIdentification`](#cameraidentification) [`CameraIdentityCandidate`](#cameraidentitycandidate) | ## Capabilities and controls What [`getCapabilities()`](https://darkgrade.com/docs/slate/getting_started/camera.md#getcapabilities) returns and [`setControl`](https://darkgrade.com/docs/slate/getting_started/camera.md#setcontrol) takes. ### CameraRecordingState What [`getRecordingState`](https://darkgrade.com/docs/slate/getting_started/camera.md#getrecordingstate) resolves to. `unknown` never counts as idle. ```typescript type CameraRecordingState = | 'idle' | 'recording' | 'starting' | 'stopping' | 'unknown' ``` ### OperationAvailability One operation's availability now: an unsupported one says why, in words a user can act on. `options` covers optional parts of an operation, such as a live-view overlay. ```typescript interface OperationAvailability { supported: boolean reason?: string options?: Partial> } ``` #### OperationAvailability fields **`supported`** · `boolean` Whether the operation can run now. **`reason?`** · `string` Why not, when it cannot. **`options?`** · `Partial>` The same for the operation's optional parts, by name. ### CameraCapabilities What [`getCapabilities`](https://darkgrade.com/docs/slate/getting_started/camera.md#getcapabilities) resolves to: every setting, the lens, and which operations work now. ```typescript interface CameraCapabilities { observedAt: number controls: Partial> advertisedOperations: number[] | null lens?: CameraLens operations?: Partial< Record > } ``` #### CameraCapabilities fields **`observedAt`** · `number` When the camera was read, in milliseconds since the Unix epoch (`Date.now()`). **`controls`** · `Partial>` Every setting the camera has now, by id. It is what the camera reports at this moment, not a promise for the model: a mode, lens or card change can add or remove one. See [`CameraControlId`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracontrolid), [`CameraControlState`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracontrolstate). **`advertisedOperations`** · `number[] | null` The PTP operation codes the camera lists in its DeviceInfo, or `null` when it gives none. A listed code does not prove the operation works: `operations` says what does. **`lens?`** · `CameraLens` The attached lens, from the same observation as `controls`; absent when the camera reports neither field. See [`CameraLens`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameralens). **`operations?`** · `Partial>` Whether each public operation is possible right now, with the reason when it is not. Camera fills this from its driver's capability groups; an operation absent here has no availability report yet, and a call still answers [CameraUnsupportedError](https://darkgrade.com/docs/slate/reference/errors.md#cameraunsupportederror) when it cannot run. See [`OperationAvailability`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#operationavailability). ### CameraControlId A setting id, such as `iso` or `shutterSpeed`. The [settings reference](https://darkgrade.com/docs/slate/reference/settings.md) lists every one. ```typescript type CameraControlId = keyof typeof cameraControlDefinitions ``` #### Every value (33) `shutterSpeed` `aperture` `iso` `exposureMode` `exposureCompensation` `meteringMode` `photoVideoMode` `driveMode` `whiteBalance` `colorTemperature` `pictureStyle` `pictureProfile` `focusMode` `focusArea` `subjectDetection` `continuousAutofocus` `imageStabilization` `audioLevel` `shutterType` `detectionSubject` `eyeSelection` `photoFormat` `photoSize` `aspectRatio` `jpegQuality` `rawCompression` `flashMode` `videoFormat` `videoQuality` `frameRate` `audioRecording` `digitalZoom` `liveViewQuality` ### CameraControlInputs What [`setControl`](https://darkgrade.com/docs/slate/getting_started/camera.md#setcontrol) accepts as a value, by setting id: an [`ExposureTimeInput`](https://darkgrade.com/docs/slate/reference/types-setting-values.md#exposuretimeinput) for `shutterSpeed`, a number for `colorTemperature` and `audioLevel`, and a string for every other setting. ```typescript type CameraControlInputs = { [Id in CameraControlId]: Id extends 'shutterSpeed' ? ExposureTimeInput : Id extends NumericControlId ? number : string } ``` Uses [`CameraControlId`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracontrolid). ### CameraControlState One setting as the camera reports it now: its value, the values it offers, and whether it can be written. ```typescript interface CameraControlState { id: CameraControlId label: string aliases: readonly string[] source: { name: string code: number protocol: 'ptp' | 'sony-sdk' } value?: string allowedValues?: string[] writable: boolean enabled: boolean range?: { minimum: number maximum: number step: number } exposureTime?: ExposureTime unrecognized?: UnrecognizedValues } ``` #### CameraControlState fields **`id`** · `CameraControlId` The setting's id. See [`CameraControlId`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracontrolid). **`label`** · `string` Its name for a person, such as `Shutter speed`. **`aliases`** · `readonly string[]` Other words for it, for search. **`source`** · `{ name: string; code: number; protocol: 'ptp' | 'sony-sdk' }` The protocol property behind this setting on the connected camera, kept for diagnostics. Write by `id`, never by this. **`value?`** · `string` The current value in Slate's spelling. Absent when the control does not apply now (`enabled: false`, no choices, the raw reading in `unrecognized.value`): colour temperature under a white balance preset, Sony drive mode in movie mode. **`allowedValues?`** · `string[]` The values the camera offers now, in Slate's spelling. Only these can be written. **`writable`** · `boolean` Whether the camera accepts a write to it now. **`enabled`** · `boolean` Whether it applies in the camera's current mode. **`range?`** · `{ minimum: number; maximum: number; step: number }` For a numeric setting: the lowest and highest value and the step between them. **`exposureTime?`** · `ExposureTime` Shutter speed only: the value as a duration or an angle. See [`ExposureTime`](https://darkgrade.com/docs/slate/reference/types-setting-values.md#exposuretime). **`unrecognized?`** · `UnrecognizedValues` Raw values the camera reported that Slate has no name for. See [`UnrecognizedValues`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#unrecognizedvalues). ### CameraControlSession The same control contract on an already-connected native PTP or vendor SDK session, including one typed getter and setter per typed setting ([`getShutterSpeed`](https://darkgrade.com/docs/slate/reference/settings-exposure.md#getshutterspeed), [`setShutterSpeed`](https://darkgrade.com/docs/slate/reference/settings-exposure.md#setshutterspeed), ...). ```typescript interface CameraControlSession extends TypedSettingMethods { getCapabilities: () => Promise setControl: ( id: Id, value: CameraControlInputs[Id], context?: ExposureContext, ) => Promise } ``` #### CameraControlSession fields **`getCapabilities`** · `() => Promise` The same read as [`Camera.getCapabilities`](https://darkgrade.com/docs/slate/getting_started/camera.md#getcapabilities). See [`CameraCapabilities`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracapabilities). **`setControl`** · `(id: Id, value: CameraContro…` The same write as [`Camera.setControl`](https://darkgrade.com/docs/slate/getting_started/camera.md#setcontrol). See [`CameraControlId`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracontrolid), [`CameraControlInputs`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracontrolinputs), [`ExposureContext`](https://darkgrade.com/docs/slate/reference/types-setting-values.md#exposurecontext), [`CameraControlState`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracontrolstate). Extends [`TypedSettingMethods`](https://darkgrade.com/docs/slate/reference/types-setting-values.md#typedsettingmethods). ### UnrecognizedValues Raw values the camera reported that Slate has no name for. They are shown and never written. ```typescript interface UnrecognizedValues { value?: string choices?: string[] } ``` #### UnrecognizedValues fields **`value?`** · `string` The current raw value. The control is then read-only and its `value` reads `Unrecognized ()`, or, when it does not apply now, has no `value` at all. **`choices?`** · `string[]` Advertised choices left out of `allowedValues`; they are never writable. ### CameraLens The attached lens as the camera reports it. Each field is null when the camera does not report it. ```typescript interface CameraLens { name: string | null focalLengthMillimetres: number | null } ``` #### CameraLens fields **`name`** · `string | null` The lens's name. **`focalLengthMillimetres`** · `number | null` The current focal length, in millimetres. ## Identification Which model a camera is, and whether Slate has validated it. ### VerifiedFeature A vendor feature confirmed on specific bodies on Darkgrade's benches, for `isVerifiedFeature`. ```typescript type VerifiedFeature = keyof typeof verifiedFeatureModels ``` #### Every value (3) `sony-wireless` `sony-card-fallback` `nikon-wireless-status` ### CameraIdentification What `identifyCamera` makes of a USB vendor and product ID, without opening the device. Recognising an ID proves no control. ```typescript interface CameraIdentification { usb: { vendorId: number; productId: number } status: 'unknown' | 'matched' | 'ambiguous' | 'identity-mismatch' candidates: CameraIdentityCandidate[] } ``` #### CameraIdentification fields **`usb`** · `{ vendorId: number; productId: number }` The USB vendor and product ID that were asked about. **`status`** · `'unknown' | 'matched' | 'ambiguous' | 'identity-mismatch'` `matched`: one camera line is known for the ID. `ambiguous`: several share it. `identity-mismatch`: a model was given and none of them names it. `unknown`: the ID is not in Slate's list. **`candidates`** · `CameraIdentityCandidate[]` The camera lines known for the ID; when a model was given and matched, only those that name it. See [`CameraIdentityCandidate`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameraidentitycandidate). ### CameraIdentityCandidate A camera line and model aliases that a cited source associates with one USB vendor/product ID. ```typescript interface CameraIdentityCandidate { manufacturer: string line: string models: string[] sources: string[] } ``` #### CameraIdentityCandidate fields **`manufacturer`** · `string` The make. **`line`** · `string` The camera line, as the source names it. **`models`** · `string[]` The model names and aliases of the line. **`sources`** · `string[]` The sources that associate the line with the USB ID. ## 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] [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] [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.