@camstack/types 1.2.528 → 1.2.530
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/CHANGELOG.md +18 -0
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/capability-definition.d.ts +15 -0
- package/dist/capabilities/climate-control.cap.d.ts +26 -1
- package/dist/capabilities/enum-sensor.cap.d.ts +1 -1
- package/dist/capabilities/hero-layout.cap.d.ts +158 -17
- package/dist/capabilities/water-heater.cap.d.ts +5 -1
- package/dist/device/hero/climate-view.d.ts +45 -0
- package/dist/device/hero/hero-contribution-kit.d.ts +27 -0
- package/dist/device/hero/hero-contributions-access.d.ts +2 -0
- package/dist/device/hero/hero-contributions-actuators.d.ts +2 -0
- package/dist/device/hero/hero-contributions-climate.d.ts +3 -0
- package/dist/device/hero/hero-contributions-devices.d.ts +2 -0
- package/dist/device/hero/hero-contributions-groups.d.ts +2 -0
- package/dist/device/hero/hero-contributions-sensors.d.ts +2 -0
- package/dist/device/hero/hero-contributions.d.ts +2 -5
- package/dist/device/hero/hero-fragment.d.ts +11 -1
- package/dist/device/hero/hero-look.d.ts +80 -14
- package/dist/device/hero/hero-model.d.ts +224 -34
- package/dist/device/hero/hero-row.d.ts +30 -5
- package/dist/device/hero/media-player-view.d.ts +6 -0
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/runtime-state-durability.d.ts +6 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2918 -367
- package/dist/index.mjs +2914 -368
- package/dist/ir/flipper.d.ts +43 -0
- package/dist/ir/index.d.ts +1 -0
- package/dist/ir/ir-error.d.ts +1 -1
- package/dist/remote/flipper-ir-draft.d.ts +13 -0
- package/dist/remote/smartir-draft.d.ts +5 -1
- package/dist/{sleep-CqvzKIq2.mjs → sleep-CfYvHNFz.mjs} +16 -0
- package/dist/{sleep-DX_umr22.js → sleep-CqsZMKxq.js} +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { IrTimings } from './ir-timings.js';
|
|
2
|
+
import type { RemoteCommandTable, SkippedCommand } from './smartir.js';
|
|
3
|
+
export interface FlipperParsedButton {
|
|
4
|
+
readonly type: 'parsed';
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly protocol: string;
|
|
7
|
+
/** Little-endian value of the 4 address bytes. */
|
|
8
|
+
readonly address: number;
|
|
9
|
+
/** Little-endian value of the 4 command bytes. */
|
|
10
|
+
readonly command: number;
|
|
11
|
+
}
|
|
12
|
+
export interface FlipperRawButton {
|
|
13
|
+
readonly type: 'raw';
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly frequency: number;
|
|
16
|
+
readonly dutyCycle: number;
|
|
17
|
+
/** Durations in µs, mark first, all positive as the file spells them. */
|
|
18
|
+
readonly data: readonly number[];
|
|
19
|
+
}
|
|
20
|
+
export type FlipperButton = FlipperParsedButton | FlipperRawButton;
|
|
21
|
+
export interface FlipperIrFile {
|
|
22
|
+
readonly buttons: readonly FlipperButton[];
|
|
23
|
+
}
|
|
24
|
+
/** Parse a `.ir` file. Throws `IrCodecError` (`flipper-malformed`). */
|
|
25
|
+
export declare function parseFlipperIr(text: string): FlipperIrFile;
|
|
26
|
+
export interface EncodedFlipper {
|
|
27
|
+
readonly timings: IrTimings;
|
|
28
|
+
readonly carrierHz: number;
|
|
29
|
+
}
|
|
30
|
+
/** Protocols this encoder emits: NEC, NECext and Samsung32. Any other throws, naming the protocol. */
|
|
31
|
+
export declare function encodeFlipperParsed(code: {
|
|
32
|
+
readonly protocol: string;
|
|
33
|
+
readonly address: number;
|
|
34
|
+
readonly command: number;
|
|
35
|
+
}): EncodedFlipper;
|
|
36
|
+
/**
|
|
37
|
+
* The file as a command table (every button a `raw` payload carrying its
|
|
38
|
+
* carrier), plus the buttons that could not be encoded, named with the reason.
|
|
39
|
+
*/
|
|
40
|
+
export declare function flipperIrTable(file: FlipperIrFile): {
|
|
41
|
+
table: RemoteCommandTable;
|
|
42
|
+
skipped: SkippedCommand[];
|
|
43
|
+
};
|
package/dist/ir/index.d.ts
CHANGED
package/dist/ir/ir-error.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Why an IR/RF codec refused an input. Callers branch on the code, never on the message. */
|
|
2
|
-
export type IrCodecErrorCode = 'invalid-timings' | 'invalid-raw' | 'pronto-malformed' | 'pronto-unsupported-form' | 'smartir-malformed' | 'samsung-invalid';
|
|
2
|
+
export type IrCodecErrorCode = 'invalid-timings' | 'invalid-raw' | 'pronto-malformed' | 'pronto-unsupported-form' | 'smartir-malformed' | 'samsung-invalid' | 'flipper-malformed';
|
|
3
3
|
export declare class IrCodecError extends Error {
|
|
4
4
|
readonly code: IrCodecErrorCode;
|
|
5
5
|
constructor(code: IrCodecErrorCode, message: string);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns a Flipper `.ir` file into the same draft of the `remote`
|
|
3
|
+
* configuration a SmartIR file produces (`smartIrDraft`), with Flipper's
|
|
4
|
+
* button names mapped to roles. Names the table does not know (an app such as
|
|
5
|
+
* "Netflix") become custom buttons named as the file spells them; a button
|
|
6
|
+
* whose protocol cannot be encoded comes back in `skipped` with the reason.
|
|
7
|
+
* PURE and browser-safe, like the SmartIR path.
|
|
8
|
+
*/
|
|
9
|
+
import { type FlipperIrFile } from '../ir/flipper.js';
|
|
10
|
+
import { type SmartIrDraft, type SmartIrTarget } from './smartir-draft.js';
|
|
11
|
+
/** The role a Flipper button name fills, or undefined when it is not a known one. */
|
|
12
|
+
export declare function flipperRole(name: string): string | undefined;
|
|
13
|
+
export declare function flipperIrDraft(file: FlipperIrFile, target: SmartIrTarget): SmartIrDraft;
|
|
@@ -8,6 +8,10 @@ export interface SmartIrSkipped {
|
|
|
8
8
|
readonly name: string;
|
|
9
9
|
readonly reason: string;
|
|
10
10
|
}
|
|
11
|
+
/** How a different source format names its buttons: the role a name fills, or undefined for a custom button. */
|
|
12
|
+
export interface SmartIrDraftOptions {
|
|
13
|
+
readonly roleOf?: (name: string) => string | undefined;
|
|
14
|
+
}
|
|
11
15
|
export interface SmartIrDraft {
|
|
12
16
|
readonly bindings: Record<string, RemoteBinding>;
|
|
13
17
|
readonly customButtons: RemoteCustomButton[];
|
|
@@ -22,4 +26,4 @@ export interface SmartIrDraft {
|
|
|
22
26
|
* command SmartIR knows fills its role; a source, or any command it does not
|
|
23
27
|
* know, becomes a custom button named as the file spells it.
|
|
24
28
|
*/
|
|
25
|
-
export declare function smartIrDraft(table: RemoteCommandTable, target: SmartIrTarget): SmartIrDraft;
|
|
29
|
+
export declare function smartIrDraft(table: RemoteCommandTable, target: SmartIrTarget, options?: SmartIrDraftOptions): SmartIrDraft;
|
|
@@ -13299,6 +13299,18 @@ var CAP_STATE_LEAVES = Object.freeze({
|
|
|
13299
13299
|
{
|
|
13300
13300
|
"path": "tempStep",
|
|
13301
13301
|
"valueType": "number"
|
|
13302
|
+
},
|
|
13303
|
+
{
|
|
13304
|
+
"path": "lastActiveMode",
|
|
13305
|
+
"valueType": "enum",
|
|
13306
|
+
"enumValues": [
|
|
13307
|
+
"heat",
|
|
13308
|
+
"cool",
|
|
13309
|
+
"auto",
|
|
13310
|
+
"heat_cool",
|
|
13311
|
+
"fan_only",
|
|
13312
|
+
"dry"
|
|
13313
|
+
]
|
|
13302
13314
|
}
|
|
13303
13315
|
],
|
|
13304
13316
|
"color": [
|
|
@@ -14723,6 +14735,10 @@ var CAP_STATE_LEAVES = Object.freeze({
|
|
|
14723
14735
|
{
|
|
14724
14736
|
"path": "maxTemp",
|
|
14725
14737
|
"valueType": "number"
|
|
14738
|
+
},
|
|
14739
|
+
{
|
|
14740
|
+
"path": "lastActiveMode",
|
|
14741
|
+
"valueType": "string"
|
|
14726
14742
|
}
|
|
14727
14743
|
],
|
|
14728
14744
|
"weather": [
|
|
@@ -13299,6 +13299,18 @@ var CAP_STATE_LEAVES = Object.freeze({
|
|
|
13299
13299
|
{
|
|
13300
13300
|
"path": "tempStep",
|
|
13301
13301
|
"valueType": "number"
|
|
13302
|
+
},
|
|
13303
|
+
{
|
|
13304
|
+
"path": "lastActiveMode",
|
|
13305
|
+
"valueType": "enum",
|
|
13306
|
+
"enumValues": [
|
|
13307
|
+
"heat",
|
|
13308
|
+
"cool",
|
|
13309
|
+
"auto",
|
|
13310
|
+
"heat_cool",
|
|
13311
|
+
"fan_only",
|
|
13312
|
+
"dry"
|
|
13313
|
+
]
|
|
13302
13314
|
}
|
|
13303
13315
|
],
|
|
13304
13316
|
"color": [
|
|
@@ -14723,6 +14735,10 @@ var CAP_STATE_LEAVES = Object.freeze({
|
|
|
14723
14735
|
{
|
|
14724
14736
|
"path": "maxTemp",
|
|
14725
14737
|
"valueType": "number"
|
|
14738
|
+
},
|
|
14739
|
+
{
|
|
14740
|
+
"path": "lastActiveMode",
|
|
14741
|
+
"valueType": "string"
|
|
14726
14742
|
}
|
|
14727
14743
|
],
|
|
14728
14744
|
"weather": [
|