@camstack/types 1.2.302 → 1.2.304

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.
@@ -1,3 +1,4 @@
1
+ import { DeviceType } from './device-type.js';
1
2
  /** An arg the authoring UI collects (not baked into the catalogue entry). */
2
3
  export interface DeviceDoOpenArg {
3
4
  readonly key: string;
@@ -27,6 +28,36 @@ export interface DeviceDoAction {
27
28
  export declare const DEVICE_DO_ACTIONS: readonly DeviceDoAction[];
28
29
  /** True when METHOD_ACCESS_MAP still exposes this cap.method as actuatable. */
29
30
  export declare function isDoActionActuatable(action: DeviceDoAction): boolean;
31
+ /**
32
+ * Catalogue caps a `DeviceType` is expected to offer in the Do picker.
33
+ *
34
+ * Exhaustive over {@link DeviceType}: adding a new enum member without an
35
+ * entry fails the TypeScript build here (same pattern as
36
+ * {@link DEVICE_TYPE_CONTROL_KIND}). An empty list is a deliberate choice
37
+ * for read-only / non-actuatable types — never "forgotten".
38
+ *
39
+ * Camera accessories (ptz, privacy-mask, …) are listed on Camera even though
40
+ * a given camera may bind only a subset; {@link actionsForBoundCaps} still
41
+ * filters to what the device actually binds.
42
+ */
43
+ export declare const DEVICE_TYPE_DO_CAPS: Record<DeviceType, readonly string[]>;
44
+ /**
45
+ * Whether a device type belongs in a Do / automation action device picker.
46
+ *
47
+ * Containers stay in {@link DEVICE_TYPE_DO_CAPS} (empty, for exhaustiveness)
48
+ * but must never appear as selectable targets — actuate the children instead.
49
+ */
50
+ export declare function isDoPickerDeviceType(type: string): boolean;
51
+ /**
52
+ * Do-picker family id — devices that share one may be multi-selected for
53
+ * the same action (several locks, the climate family, cover+valve, …).
54
+ *
55
+ * Distinct from {@link DeviceControlKind}: humidifier / water-heater keep
56
+ * their own control widgets but author with climate siblings.
57
+ */
58
+ export declare function deviceDoFamily(type: string): string;
59
+ /** True when two device types may share one multi-target Do step. */
60
+ export declare function sameDoFamily(leftType: string, rightType: string): boolean;
30
61
  /**
31
62
  * Actions offered for a device that binds the given caps.
32
63
  *
@@ -34,6 +65,32 @@ export declare function isDoActionActuatable(action: DeviceDoAction): boolean;
34
65
  * METHOD_ACCESS_MAP. Empty bindings → empty list (pick a device first).
35
66
  */
36
67
  export declare function actionsForBoundCaps(boundCaps: readonly string[]): readonly DeviceDoAction[];
68
+ /**
69
+ * Catalogue actions for a wire `DeviceType` string — the fallback when
70
+ * bindings have not answered yet (or answered empty for a typed actuator).
71
+ * Unknown type strings → empty.
72
+ */
73
+ export declare function actionsForDeviceType(type: string): readonly DeviceDoAction[];
74
+ /**
75
+ * Union of bound-cap actions with the type's expected catalogue caps.
76
+ *
77
+ * Bindings win for filtering (a lock without `lock-control` bound still
78
+ * offers nothing from bindings alone); the type map fills gaps when the
79
+ * binding read is empty so a Lock / Valve / Climate never shows
80
+ * "No actions for this device" solely because getBindings lagged.
81
+ */
82
+ export declare function actionsForDevice(input: {
83
+ readonly boundCaps: readonly string[] | undefined;
84
+ readonly deviceType: string | undefined;
85
+ }): readonly DeviceDoAction[];
86
+ /**
87
+ * Intersection of {@link actionsForDevice} across several targets — what a
88
+ * multi-select same-family Do step may offer.
89
+ */
90
+ export declare function actionsForDevices(targets: readonly {
91
+ readonly boundCaps?: readonly string[];
92
+ readonly deviceType?: string;
93
+ }[]): readonly DeviceDoAction[];
37
94
  /** The whole catalogue (still actuatable) — for a `{$var}` automation target. */
38
95
  export declare function allDoActions(): readonly DeviceDoAction[];
39
96
  /**
@@ -30,11 +30,11 @@ export declare const VideoEncodeSchema: z.ZodObject<{
30
30
  gopFrames: z.ZodOptional<z.ZodNumber>;
31
31
  bf: z.ZodOptional<z.ZodNumber>;
32
32
  preset: z.ZodOptional<z.ZodEnum<{
33
- fast: "fast";
34
33
  ultrafast: "ultrafast";
35
34
  superfast: "superfast";
36
35
  veryfast: "veryfast";
37
36
  faster: "faster";
37
+ fast: "fast";
38
38
  medium: "medium";
39
39
  }>>;
40
40
  tune: z.ZodOptional<z.ZodEnum<{
@@ -78,11 +78,11 @@ export declare const EncodeProfileSchema: z.ZodObject<{
78
78
  gopFrames: z.ZodOptional<z.ZodNumber>;
79
79
  bf: z.ZodOptional<z.ZodNumber>;
80
80
  preset: z.ZodOptional<z.ZodEnum<{
81
- fast: "fast";
82
81
  ultrafast: "ultrafast";
83
82
  superfast: "superfast";
84
83
  veryfast: "veryfast";
85
84
  faster: "faster";
85
+ fast: "fast";
86
86
  medium: "medium";
87
87
  }>>;
88
88
  tune: z.ZodOptional<z.ZodEnum<{
package/dist/index.d.ts CHANGED
@@ -179,7 +179,7 @@ export type { DeviceConstructor, DeviceContext, DeviceManagerApi, IDeviceRegistr
179
179
  export type { AccessoryControlInput, AccessoryControlKind, AccessoryControlPick, DeviceControlKind, SensorMapping, } from './device/device-control-resolution.js';
180
180
  export { DEVICE_TYPE_CONTROL_KIND, hasMotionTrigger, isNode, MOTION_TRIGGER_FEATURE, pickAccessoryControl, resolveDeviceControlKind, resolveMutate, SENSOR_FEATURES, SENSOR_MAP, } from './device/device-control-resolution.js';
181
181
  export type { DeviceDoAction, DeviceDoOpenArg } from './device/device-do-actions.js';
182
- export { actionsForBoundCaps, allDoActions, DEVICE_DO_ACTIONS, doActionSelectValue, isDoActionActuatable, matchDoAction, } from './device/device-do-actions.js';
182
+ export { actionsForBoundCaps, actionsForDevice, actionsForDevices, actionsForDeviceType, allDoActions, DEVICE_DO_ACTIONS, DEVICE_TYPE_DO_CAPS, deviceDoFamily, doActionSelectValue, isDoActionActuatable, isDoPickerDeviceType, matchDoAction, sameDoFamily, } from './device/device-do-actions.js';
183
183
  export type { ChildLayout, ChildLayoutEntry, CreateDeviceSpec, DeviceCapDisplayOverride, DeviceDiscovery, DeviceDisplayOverride, DeviceManualCreation, DeviceMeta, DiscoveredDevice, InitialDeviceMeta, RoleDisplayDefault, SavedDevice, } from './device/device-management.js';
184
184
  export type { DeviceProfile, DeviceProfileDefaults, DeviceProfileMatch, PipelinePhaseMode, } from './device/device-profile.js';
185
185
  export { BATTERY_DEVICE_PROFILE, DEVICE_PROFILES, deviceMatchesProfile, resolveDeviceProfile, } from './device/device-profile.js';
@@ -242,9 +242,9 @@ export { type PreparedAction, type PreparedAttachment, type PreparedNotification
242
242
  export { htmlToText, markdownToHtmlLite, markdownToText, type NotificationFormat as NotificationBodyFormat, resolveFormat, textToHtml, transcodeBody, } from './notification/format-transcode.js';
243
243
  export { conditionExclusionReason, conditionVisibleForKind, defaultDeliveryForSection, droppedConditionsForKind, isAudioRule, isOccupancyRule, isSystemDelivery, isSystemRuleKind, kindsForDiscriminator, NC_AUDIO_SEED, NC_CAMERA_SCOPE_CAP_NAME, NC_OCCUPANCY_DEFAULTS, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_RULE_SECTIONS, NC_SYSTEM_DELIVERY, NC_SYSTEM_RULE_KINDS, type NcDroppedCondition, type NcKindVisibilitySubject, type NcRuleEditorSection, type NcRuleEditorSectionKey, type NcRuleKind, type NcRuleKindSpec, type NcRuleOwningSectionKey, type NcRuleSection, type NcRuleSectionKey, type NcRuleConditionsSubject, type NcRuleSectionSubject, type NcRuleSeed, parseRuleSection, ruleDeviceCompatCapNames, ruleDeviceCompatCapQueries, ruleEditorSectionsForKind, ruleGroupingApplies, ruleKindOf, ruleKindSpec, ruleMatchesSection, ruleSection, ruleSectionOf, ruleSeedForSection, systemFamilyOfKind, systemRuleKindOf, } from './notification/rule-kinds.js';
244
244
  export { isScheduleActive } from './notification/schedule.js';
245
- export { isAlarmControllableCap, NC_ALARM_CONTROLLABLE_CAPS, NC_ALARM_OPENING_EVENT_KINDS, NC_SENSOR_TRANSITION_NEVER_FIRES_WARNING, type NcAlarmControllableCap, type NcAlarmMembershipSubject, type NcAlarmOpeningEventKind, ruleBelongsToAlarm, sensorTransitionNeverFires, } from './notification/alarm-membership.js';
245
+ export { isAlarmControllableCap, NC_ALARM_CONTROLLABLE_CAPS, NC_ALARM_OPENING_EVENT_KINDS, NC_SENSOR_TRANSITION_NEVER_FIRES_WARNING, type NcAlarmControllableCap, type NcAlarmMembershipSubject, type NcAlarmOpeningEventKind, ruleAutoTriggersAlarm, ruleBelongsToAlarm, ruleGatedOnArmedState, sensorTransitionNeverFires, } from './notification/alarm-membership.js';
246
246
  export { alarmDeviceBlocksArming, alarmDeviceSecureOnArm, type AlarmDeviceBlocksInput, type AlarmDeviceSecureOnArmInput, type NcAlarmSecureActuation, secureActuationFor, } from './notification/alarm-controllable.js';
247
- export { alarmPatchLanded, applyBlockingEdit, applyModeDelaysEdits, applyModeDeviceListEdit, applyNonBlockingEdit, applySecureOnArmEdit, NC_ALARM_DELAY_FIELDS, type NcAlarmDelayField, type NcAlarmDelaySettings, type NcAlarmDelaySource, type NcAlarmModeDeviceListEditResult, type NcAlarmNonBlockingEditResult, type NcAlarmResolvedDelays, resolveModeDelays, } from './notification/alarm-settings.js';
247
+ export { alarmPatchLanded, applyBlockingEdit, applyModeDelaysEdits, applyModeDeviceListEdit, applyNonBlockingEdit, applySecureOnArmEdit, derivePostTriggeredAction, NC_ALARM_DELAY_FIELDS, type NcAlarmDelayField, type NcAlarmDelaySettings, type NcAlarmDelaySource, type NcAlarmModeDeviceListEditResult, type NcAlarmNonBlockingEditResult, type NcAlarmResolvedDelays, resolveModeDelays, } from './notification/alarm-settings.js';
248
248
  export { activateAlarmProfile, alarmProfileById, cloneAlarmSettings, createAlarmProfile, deleteAlarmProfile, ensureAlarmProfiles, isDefaultAlarmProfileId, NC_ALARM_DEFAULT_PROFILE_ID, NC_ALARM_DEFAULT_PROFILE_NAME, NC_ALARM_SYSTEM_DEFAULT_DELAYS, ncAlarmSystemDefaultSettings, type NcAlarmProfileCreateSource, type NcAlarmProfileRecord, type NcAlarmProfilesMutationResult, type NcAlarmProfilesRefuseReason, type NcAlarmProfilesState, renameAlarmProfile, syncActiveAlarmProfileSettings, } from './notification/alarm-profiles.js';
249
249
  export { NC_SENSOR_RAISED_FIELD_BY_KIND, NC_SENSOR_TRANSITION_KINDS, NC_SENSOR_TRANSITION_UNSUPPORTED_REASON, sensorRaisedOf, sensorTransitionOffered, } from './notification/sensor-raised.js';
250
250
  export { NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS, NC_TEMPLATE_VARS, isHeldBackTemplateVar, isKnownTemplateVar, servedTemplateVars, templateVarDeliveryApplies, templateVarKindApplies, templateVarSystemEventApplies, templateVarsFor, } from './notification/template-vars.js';