@camstack/ui-library 1.1.17 → 1.1.19
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/composites/device-controls/pet-feeder-panel.d.ts +12 -0
- package/dist/composites/device-controls/types.d.ts +1 -1
- package/dist/composites/device-item/children-accordion.d.ts +4 -1
- package/dist/composites/device-item/helpers.d.ts +27 -5
- package/dist/composites/device-item/index.d.ts +4 -4
- package/dist/composites/device-list/group.d.ts +10 -1
- package/dist/composites/device-meta.d.ts +11 -0
- package/dist/generated/system-hooks.d.ts +28 -0
- package/dist/index.cjs +5100 -4303
- package/dist/index.js +5081 -4304
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/resolve-sensor-display.d.ts +25 -0
- package/package.json +1 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export { cn } from './cn';
|
|
|
2
2
|
export { formatLastSeen } from './format-last-seen';
|
|
3
3
|
export { formatControlDateTime } from './format-control-datetime';
|
|
4
4
|
export type { ControlDateTimeFormat } from './format-control-datetime';
|
|
5
|
+
export { formatNumeric } from './format-numeric';
|
|
6
|
+
export { resolveSensorDisplay } from './resolve-sensor-display';
|
|
7
|
+
export type { SensorDisplayInput, ResolvedSensorDisplay } from './resolve-sensor-display';
|
|
5
8
|
export { isAbsentProvider } from './cap-error';
|
|
6
9
|
export * from './responsive';
|
|
7
10
|
export { mirror } from './pipeline-mirror';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DeviceDisplayOverride, RoleDisplayDefault } from '@camstack/types';
|
|
2
|
+
export interface SensorDisplayInput {
|
|
3
|
+
/** Per-device override from the row (`DeviceInfo.display`). */
|
|
4
|
+
readonly display?: DeviceDisplayOverride;
|
|
5
|
+
/** Cap name for `perCap` refinement (e.g. 'numeric-sensor'); undefined skips it. */
|
|
6
|
+
readonly capName?: string;
|
|
7
|
+
/** Role default (`roleDisplayDefaults[device.role]`). */
|
|
8
|
+
readonly roleDefault?: RoleDisplayDefault;
|
|
9
|
+
/** Live slice unit (the unit the raw VALUE is actually in, for generic sensors). */
|
|
10
|
+
readonly sliceUnit?: string;
|
|
11
|
+
/** Live slice precision. */
|
|
12
|
+
readonly slicePrecision?: number;
|
|
13
|
+
/** ROLE_DESCRIPTOR canonical unit fallback (typed roles). */
|
|
14
|
+
readonly canonicalUnit?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ResolvedSensorDisplay {
|
|
17
|
+
/** Display unit — `''` when none resolves anywhere. */
|
|
18
|
+
readonly unit: string;
|
|
19
|
+
/** Display precision (int 0-10) or undefined for auto-format. */
|
|
20
|
+
readonly precision: number | undefined;
|
|
21
|
+
/** Convert a raw slice value into the display unit. Identity unless an
|
|
22
|
+
* override unit differs from the source unit AND both share a dimension. */
|
|
23
|
+
readonly toDisplayValue: (raw: number) => number;
|
|
24
|
+
}
|
|
25
|
+
export declare function resolveSensorDisplay(input: SensorDisplayInput): ResolvedSensorDisplay;
|