@jdg-keyforge/protocol 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/common.d.ts CHANGED
@@ -35,6 +35,13 @@ export type Color = string;
35
35
  * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
36
36
  */
37
37
  export type Color1 = string;
38
+ /**
39
+ * Clockwise rotation, in degrees, applied to the canonical orientation of a device's layout so clients show it the way the user has the device on the desk. Presentation only: bindings and colors stay tied to the physical input (input_id) and do not change when the device is rotated. It is a per-device preference, not a per-profile one: switching profiles does not change it. Set through set_device_rotation and exposed in Device.rotation, where absent means 0.
40
+ *
41
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
42
+ * via the `definition` "DeviceRotation".
43
+ */
44
+ export type DeviceRotation = 0 | 90 | 180 | 270;
38
45
  /**
39
46
  * Globally unique plugin identifier in reverse-DNS form (e.g. 'dev.jonidg.spotify'). Lowercase, at least two dot-separated segments, each starting with a letter. Used as the install folder name and as <plugin_id> in Action.type.
40
47
  *
@@ -234,15 +241,40 @@ export interface Input {
234
241
  id: string;
235
242
  kind: InputKind;
236
243
  /**
237
- * Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
244
+ * Fixed name of the input (e.g. 'Enter', 'Play') that clients show as-is in any orientation. When absent, clients name the input by position: they number inputs per kind in reading order of the current view, sorting by each input's top-left corner after applying Device.rotation (y first, then x), so 'Key 1' is always the top-left key as the device sits on the desk. If the device has no complete layout, they number inputs per kind in the order list_devices returns them. Catalogs should not send positional labels like 'Key 1': they would be wrong once the device is rotated.
238
245
  */
239
246
  label?: string;
247
+ layout?: InputLayout;
240
248
  /**
241
249
  * Whether the input has an RGB LED the daemon can drive through set_input_color. Absent means false.
242
250
  */
243
251
  rgb?: boolean;
244
252
  color?: Color1;
245
253
  }
254
+ /**
255
+ * Physical position and size of an input, in key units (1 = one standard key). Fractions are allowed (e.g. x: 5.5 leaves a gap before a column of encoders). Coordinates are in the device's canonical orientation, defined by the daemon's device catalog: the origin is the top-left corner and y grows downwards. This is a coordinate system, not how the user has the device on the desk (that is Device.rotation). The shape is not modeled: clients derive it from Input.kind (key = rectangle, encoder = circle). Clients can draw a device only when every one of its inputs has a layout; otherwise they fall back to a view without positions (e.g. a list). Prior art: the {x, y, w, h} key model of QMK/VIA info.json.
256
+ *
257
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
258
+ * via the `definition` "InputLayout".
259
+ */
260
+ export interface InputLayout {
261
+ /**
262
+ * Horizontal position of the input's top-left corner, in key units.
263
+ */
264
+ x: number;
265
+ /**
266
+ * Vertical position of the input's top-left corner, in key units. Grows downwards.
267
+ */
268
+ y: number;
269
+ /**
270
+ * Width in key units. Absent means 1.
271
+ */
272
+ w?: number;
273
+ /**
274
+ * Height in key units. Absent means 1.
275
+ */
276
+ h?: number;
277
+ }
246
278
  /**
247
279
  * A HID device known to the daemon. Returned by list_devices.
248
280
  *
@@ -279,6 +311,7 @@ export interface Device {
279
311
  * Inputs (keys/encoders) the daemon knows this device exposes. Empty for unrecognized devices the daemon can't map.
280
312
  */
281
313
  inputs: Input[];
314
+ rotation?: DeviceRotation;
282
315
  }
283
316
  /**
284
317
  * Maps a foreground application to the profile that should become active while that app is frontmost. When the frontmost app matches no rule, the active profile is left unchanged (sticky behavior); there is no fallback profile.
@@ -292,7 +325,7 @@ export interface AutoSwitchRule {
292
325
  */
293
326
  app: string;
294
327
  /**
295
- * Identifier of the profile to activate when this app is frontmost.
328
+ * Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
296
329
  */
297
330
  profile_id: string;
298
331
  }
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export type { MethodRenameProfile } from './methods/rename_profile.js';
18
18
  export type { MethodSetActiveProfile } from './methods/set_active_profile.js';
19
19
  export type { MethodSetAutoSwitch } from './methods/set_auto_switch.js';
20
20
  export type { MethodSetBinding } from './methods/set_binding.js';
21
+ export type { MethodSetDeviceRotation } from './methods/set_device_rotation.js';
21
22
  export type { MethodSetInputColor } from './methods/set_input_color.js';
22
23
  export type { MethodUninstallPlugin } from './methods/uninstall_plugin.js';
23
24
  export type { EventActionInvoked } from './events/action_invoked.js';
@@ -4,7 +4,7 @@
4
4
  * and run json-schema-to-typescript to regenerate this file.
5
5
  */
6
6
  /**
7
- * Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned.
7
+ * Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned. Auto-switch rules whose profile_id points to the deleted profile are deleted with it, so the stored rule set never references a missing profile.
8
8
  */
9
9
  export interface MethodDeleteProfile {
10
10
  params: {
@@ -31,7 +31,7 @@ export interface AutoSwitchRule {
31
31
  */
32
32
  app: string;
33
33
  /**
34
- * Identifier of the profile to activate when this app is frontmost.
34
+ * Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
35
35
  */
36
36
  profile_id: string;
37
37
  }
@@ -15,6 +15,10 @@ export type InputKind = "key" | "encoder";
15
15
  * Color the active profile paints on this input. Only set on RGB inputs that have a color in the active profile; absent means the LED is off.
16
16
  */
17
17
  export type Color = string;
18
+ /**
19
+ * Clockwise rotation, in degrees, applied to the canonical orientation of a device's layout so clients show it the way the user has the device on the desk. Presentation only: bindings and colors stay tied to the physical input (input_id) and do not change when the device is rotated. It is a per-device preference, not a per-profile one: switching profiles does not change it. Set through set_device_rotation and exposed in Device.rotation, where absent means 0.
20
+ */
21
+ export type DeviceRotation = 0 | 90 | 180 | 270;
18
22
  /**
19
23
  * Returns the HID devices currently known to the daemon. No filters in v1; clients filter client-side if needed.
20
24
  */
@@ -63,6 +67,7 @@ export interface Device {
63
67
  * Inputs (keys/encoders) the daemon knows this device exposes. Empty for unrecognized devices the daemon can't map.
64
68
  */
65
69
  inputs: Input[];
70
+ rotation?: DeviceRotation;
66
71
  }
67
72
  /**
68
73
  * A single physical input exposed by a device (a key or an encoder).
@@ -74,12 +79,34 @@ export interface Input {
74
79
  id: string;
75
80
  kind: InputKind;
76
81
  /**
77
- * Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
82
+ * Fixed name of the input (e.g. 'Enter', 'Play') that clients show as-is in any orientation. When absent, clients name the input by position: they number inputs per kind in reading order of the current view, sorting by each input's top-left corner after applying Device.rotation (y first, then x), so 'Key 1' is always the top-left key as the device sits on the desk. If the device has no complete layout, they number inputs per kind in the order list_devices returns them. Catalogs should not send positional labels like 'Key 1': they would be wrong once the device is rotated.
78
83
  */
79
84
  label?: string;
85
+ layout?: InputLayout;
80
86
  /**
81
87
  * Whether the input has an RGB LED the daemon can drive through set_input_color. Absent means false.
82
88
  */
83
89
  rgb?: boolean;
84
90
  color?: Color;
85
91
  }
92
+ /**
93
+ * Physical position and size of an input, in key units (1 = one standard key). Fractions are allowed (e.g. x: 5.5 leaves a gap before a column of encoders). Coordinates are in the device's canonical orientation, defined by the daemon's device catalog: the origin is the top-left corner and y grows downwards. This is a coordinate system, not how the user has the device on the desk (that is Device.rotation). The shape is not modeled: clients derive it from Input.kind (key = rectangle, encoder = circle). Clients can draw a device only when every one of its inputs has a layout; otherwise they fall back to a view without positions (e.g. a list). Prior art: the {x, y, w, h} key model of QMK/VIA info.json.
94
+ */
95
+ export interface InputLayout {
96
+ /**
97
+ * Horizontal position of the input's top-left corner, in key units.
98
+ */
99
+ x: number;
100
+ /**
101
+ * Vertical position of the input's top-left corner, in key units. Grows downwards.
102
+ */
103
+ y: number;
104
+ /**
105
+ * Width in key units. Absent means 1.
106
+ */
107
+ w?: number;
108
+ /**
109
+ * Height in key units. Absent means 1.
110
+ */
111
+ h?: number;
112
+ }
@@ -4,7 +4,7 @@
4
4
  * and run json-schema-to-typescript to regenerate this file.
5
5
  */
6
6
  /**
7
- * Replaces the entire auto-switch configuration in one shot (bulk set, not per-rule CRUD): the master toggle and the full rule set. The result echoes the persisted state.
7
+ * Replaces the entire auto-switch configuration in one shot (bulk set, not per-rule CRUD): the master toggle and the full rule set. The result echoes the persisted state. The daemon rejects the whole request with error code PROFILE_NOT_FOUND if any rule's profile_id does not exist; nothing is persisted in that case.
8
8
  */
9
9
  export interface MethodSetAutoSwitch {
10
10
  params: {
@@ -37,7 +37,7 @@ export interface AutoSwitchRule {
37
37
  */
38
38
  app: string;
39
39
  /**
40
- * Identifier of the profile to activate when this app is frontmost.
40
+ * Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
41
41
  */
42
42
  profile_id: string;
43
43
  }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Stable identifier for a HID device. Format: VID_<hex>_PID_<hex>[_<serial>].
8
+ */
9
+ export type DeviceID = string;
10
+ /**
11
+ * Clockwise rotation, in degrees, applied to the canonical orientation of a device's layout so clients show it the way the user has the device on the desk. Presentation only: bindings and colors stay tied to the physical input (input_id) and do not change when the device is rotated. It is a per-device preference, not a per-profile one: switching profiles does not change it. Set through set_device_rotation and exposed in Device.rotation, where absent means 0.
12
+ */
13
+ export type DeviceRotation = 0 | 90 | 180 | 270;
14
+ /**
15
+ * Persists how the user has a device rotated on the desk, so clients draw its layout in that orientation. The rotation is stored per device (by device_id), not per profile: switching profiles does not change it. list_devices exposes it in Device.rotation. Presentation only: bindings and colors stay tied to input_id and are not touched. The daemon rejects unknown device_ids; error codes are defined by the daemon.
16
+ */
17
+ export interface MethodSetDeviceRotation {
18
+ params: {
19
+ device_id: DeviceID;
20
+ rotation: DeviceRotation;
21
+ };
22
+ /**
23
+ * Empty acknowledgement object.
24
+ */
25
+ result: {};
26
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jdg-keyforge/protocol",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "TypeScript types for the KeyForge WebSocket protocol, generated from the canonical JSON Schema contracts.",
5
5
  "keywords": ["keyforge", "protocol", "types", "json-schema", "websocket"],
6
6
  "license": "Apache-2.0",
package/src/common.ts CHANGED
@@ -37,6 +37,13 @@ export type Color = string;
37
37
  * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
38
38
  */
39
39
  export type Color1 = string;
40
+ /**
41
+ * Clockwise rotation, in degrees, applied to the canonical orientation of a device's layout so clients show it the way the user has the device on the desk. Presentation only: bindings and colors stay tied to the physical input (input_id) and do not change when the device is rotated. It is a per-device preference, not a per-profile one: switching profiles does not change it. Set through set_device_rotation and exposed in Device.rotation, where absent means 0.
42
+ *
43
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
44
+ * via the `definition` "DeviceRotation".
45
+ */
46
+ export type DeviceRotation = 0 | 90 | 180 | 270;
40
47
  /**
41
48
  * Globally unique plugin identifier in reverse-DNS form (e.g. 'dev.jonidg.spotify'). Lowercase, at least two dot-separated segments, each starting with a letter. Used as the install folder name and as <plugin_id> in Action.type.
42
49
  *
@@ -237,15 +244,40 @@ export interface Input {
237
244
  id: string;
238
245
  kind: InputKind;
239
246
  /**
240
- * Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
247
+ * Fixed name of the input (e.g. 'Enter', 'Play') that clients show as-is in any orientation. When absent, clients name the input by position: they number inputs per kind in reading order of the current view, sorting by each input's top-left corner after applying Device.rotation (y first, then x), so 'Key 1' is always the top-left key as the device sits on the desk. If the device has no complete layout, they number inputs per kind in the order list_devices returns them. Catalogs should not send positional labels like 'Key 1': they would be wrong once the device is rotated.
241
248
  */
242
249
  label?: string;
250
+ layout?: InputLayout;
243
251
  /**
244
252
  * Whether the input has an RGB LED the daemon can drive through set_input_color. Absent means false.
245
253
  */
246
254
  rgb?: boolean;
247
255
  color?: Color1;
248
256
  }
257
+ /**
258
+ * Physical position and size of an input, in key units (1 = one standard key). Fractions are allowed (e.g. x: 5.5 leaves a gap before a column of encoders). Coordinates are in the device's canonical orientation, defined by the daemon's device catalog: the origin is the top-left corner and y grows downwards. This is a coordinate system, not how the user has the device on the desk (that is Device.rotation). The shape is not modeled: clients derive it from Input.kind (key = rectangle, encoder = circle). Clients can draw a device only when every one of its inputs has a layout; otherwise they fall back to a view without positions (e.g. a list). Prior art: the {x, y, w, h} key model of QMK/VIA info.json.
259
+ *
260
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
261
+ * via the `definition` "InputLayout".
262
+ */
263
+ export interface InputLayout {
264
+ /**
265
+ * Horizontal position of the input's top-left corner, in key units.
266
+ */
267
+ x: number;
268
+ /**
269
+ * Vertical position of the input's top-left corner, in key units. Grows downwards.
270
+ */
271
+ y: number;
272
+ /**
273
+ * Width in key units. Absent means 1.
274
+ */
275
+ w?: number;
276
+ /**
277
+ * Height in key units. Absent means 1.
278
+ */
279
+ h?: number;
280
+ }
249
281
  /**
250
282
  * A HID device known to the daemon. Returned by list_devices.
251
283
  *
@@ -282,6 +314,7 @@ export interface Device {
282
314
  * Inputs (keys/encoders) the daemon knows this device exposes. Empty for unrecognized devices the daemon can't map.
283
315
  */
284
316
  inputs: Input[];
317
+ rotation?: DeviceRotation;
285
318
  }
286
319
  /**
287
320
  * Maps a foreground application to the profile that should become active while that app is frontmost. When the frontmost app matches no rule, the active profile is left unchanged (sticky behavior); there is no fallback profile.
@@ -295,7 +328,7 @@ export interface AutoSwitchRule {
295
328
  */
296
329
  app: string;
297
330
  /**
298
- * Identifier of the profile to activate when this app is frontmost.
331
+ * Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
299
332
  */
300
333
  profile_id: string;
301
334
  }
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ export type { MethodRenameProfile } from './methods/rename_profile.js';
21
21
  export type { MethodSetActiveProfile } from './methods/set_active_profile.js';
22
22
  export type { MethodSetAutoSwitch } from './methods/set_auto_switch.js';
23
23
  export type { MethodSetBinding } from './methods/set_binding.js';
24
+ export type { MethodSetDeviceRotation } from './methods/set_device_rotation.js';
24
25
  export type { MethodSetInputColor } from './methods/set_input_color.js';
25
26
  export type { MethodUninstallPlugin } from './methods/uninstall_plugin.js';
26
27
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  /**
9
- * Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned.
9
+ * Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned. Auto-switch rules whose profile_id points to the deleted profile are deleted with it, so the stored rule set never references a missing profile.
10
10
  */
11
11
  export interface MethodDeleteProfile {
12
12
  params: {
@@ -33,7 +33,7 @@ export interface AutoSwitchRule {
33
33
  */
34
34
  app: string;
35
35
  /**
36
- * Identifier of the profile to activate when this app is frontmost.
36
+ * Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
37
37
  */
38
38
  profile_id: string;
39
39
  }
@@ -17,6 +17,10 @@ export type InputKind = "key" | "encoder";
17
17
  * Color the active profile paints on this input. Only set on RGB inputs that have a color in the active profile; absent means the LED is off.
18
18
  */
19
19
  export type Color = string;
20
+ /**
21
+ * Clockwise rotation, in degrees, applied to the canonical orientation of a device's layout so clients show it the way the user has the device on the desk. Presentation only: bindings and colors stay tied to the physical input (input_id) and do not change when the device is rotated. It is a per-device preference, not a per-profile one: switching profiles does not change it. Set through set_device_rotation and exposed in Device.rotation, where absent means 0.
22
+ */
23
+ export type DeviceRotation = 0 | 90 | 180 | 270;
20
24
 
21
25
  /**
22
26
  * Returns the HID devices currently known to the daemon. No filters in v1; clients filter client-side if needed.
@@ -66,6 +70,7 @@ export interface Device {
66
70
  * Inputs (keys/encoders) the daemon knows this device exposes. Empty for unrecognized devices the daemon can't map.
67
71
  */
68
72
  inputs: Input[];
73
+ rotation?: DeviceRotation;
69
74
  }
70
75
  /**
71
76
  * A single physical input exposed by a device (a key or an encoder).
@@ -77,12 +82,34 @@ export interface Input {
77
82
  id: string;
78
83
  kind: InputKind;
79
84
  /**
80
- * Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
85
+ * Fixed name of the input (e.g. 'Enter', 'Play') that clients show as-is in any orientation. When absent, clients name the input by position: they number inputs per kind in reading order of the current view, sorting by each input's top-left corner after applying Device.rotation (y first, then x), so 'Key 1' is always the top-left key as the device sits on the desk. If the device has no complete layout, they number inputs per kind in the order list_devices returns them. Catalogs should not send positional labels like 'Key 1': they would be wrong once the device is rotated.
81
86
  */
82
87
  label?: string;
88
+ layout?: InputLayout;
83
89
  /**
84
90
  * Whether the input has an RGB LED the daemon can drive through set_input_color. Absent means false.
85
91
  */
86
92
  rgb?: boolean;
87
93
  color?: Color;
88
94
  }
95
+ /**
96
+ * Physical position and size of an input, in key units (1 = one standard key). Fractions are allowed (e.g. x: 5.5 leaves a gap before a column of encoders). Coordinates are in the device's canonical orientation, defined by the daemon's device catalog: the origin is the top-left corner and y grows downwards. This is a coordinate system, not how the user has the device on the desk (that is Device.rotation). The shape is not modeled: clients derive it from Input.kind (key = rectangle, encoder = circle). Clients can draw a device only when every one of its inputs has a layout; otherwise they fall back to a view without positions (e.g. a list). Prior art: the {x, y, w, h} key model of QMK/VIA info.json.
97
+ */
98
+ export interface InputLayout {
99
+ /**
100
+ * Horizontal position of the input's top-left corner, in key units.
101
+ */
102
+ x: number;
103
+ /**
104
+ * Vertical position of the input's top-left corner, in key units. Grows downwards.
105
+ */
106
+ y: number;
107
+ /**
108
+ * Width in key units. Absent means 1.
109
+ */
110
+ w?: number;
111
+ /**
112
+ * Height in key units. Absent means 1.
113
+ */
114
+ h?: number;
115
+ }
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  /**
9
- * Replaces the entire auto-switch configuration in one shot (bulk set, not per-rule CRUD): the master toggle and the full rule set. The result echoes the persisted state.
9
+ * Replaces the entire auto-switch configuration in one shot (bulk set, not per-rule CRUD): the master toggle and the full rule set. The result echoes the persisted state. The daemon rejects the whole request with error code PROFILE_NOT_FOUND if any rule's profile_id does not exist; nothing is persisted in that case.
10
10
  */
11
11
  export interface MethodSetAutoSwitch {
12
12
  params: {
@@ -39,7 +39,7 @@ export interface AutoSwitchRule {
39
39
  */
40
40
  app: string;
41
41
  /**
42
- * Identifier of the profile to activate when this app is frontmost.
42
+ * Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
43
43
  */
44
44
  profile_id: string;
45
45
  }
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * Stable identifier for a HID device. Format: VID_<hex>_PID_<hex>[_<serial>].
10
+ */
11
+ export type DeviceID = string;
12
+ /**
13
+ * Clockwise rotation, in degrees, applied to the canonical orientation of a device's layout so clients show it the way the user has the device on the desk. Presentation only: bindings and colors stay tied to the physical input (input_id) and do not change when the device is rotated. It is a per-device preference, not a per-profile one: switching profiles does not change it. Set through set_device_rotation and exposed in Device.rotation, where absent means 0.
14
+ */
15
+ export type DeviceRotation = 0 | 90 | 180 | 270;
16
+
17
+ /**
18
+ * Persists how the user has a device rotated on the desk, so clients draw its layout in that orientation. The rotation is stored per device (by device_id), not per profile: switching profiles does not change it. list_devices exposes it in Device.rotation. Presentation only: bindings and colors stay tied to input_id and are not touched. The daemon rejects unknown device_ids; error codes are defined by the daemon.
19
+ */
20
+ export interface MethodSetDeviceRotation {
21
+ params: {
22
+ device_id: DeviceID;
23
+ rotation: DeviceRotation;
24
+ };
25
+ /**
26
+ * Empty acknowledgement object.
27
+ */
28
+ result: {};
29
+ }