# DevicePreferences

Reports device and accessibility preferences, and tells the ui when they
change. Separate from [`ThemeSource`](https://docs.mapcairn.com/api/core/ThemeSource.md) because these never touch the
document; they only steer behaviour such as animation and default controls.

This is an interface exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import type { DevicePreferences } from "@mapcairn/core";
 
interface DevicePreferences
```

## Methods

### get

```ts
get(): DevicePreferencesValue;
```

The current preferences. The same object is returned until something changes.

### subscribe

```ts
subscribe(listener: (value: DevicePreferencesValue) => void): () => void;
```

Calls the listener when a preference changes. Returns the unsubscribe function.

- `listener` (`(value: DevicePreferencesValue) => void`)

## See also

- [`DevicePreferencesValue`](https://docs.mapcairn.com/api/core/DevicePreferencesValue.md)

Source: [packages/core/src/ports/preferences.ts:30](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/ports/preferences.ts#L30)
