@camstack/types 1.2.553 → 1.2.555
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 +12 -4
- package/dist/addon.js +3 -2
- package/dist/addon.mjs +3 -2
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/ir-transmitter.cap.d.ts +47 -2
- package/dist/capabilities/notification-rules.cap.d.ts +24 -0
- package/dist/capabilities/remote.cap.d.ts +24 -0
- package/dist/client.js +14 -1
- package/dist/client.mjs +14 -1
- package/dist/generated/addon-api.d.ts +7 -0
- package/dist/generated/cap-input-defaults.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +289 -15
- package/dist/index.mjs +277 -16
- package/dist/ir/fastlz.d.ts +7 -0
- package/dist/ir/index.d.ts +2 -0
- package/dist/ir/ir-error.d.ts +1 -1
- package/dist/ir/ir-payload.d.ts +7 -1
- package/dist/ir/native.d.ts +24 -0
- package/dist/ir/tuya.d.ts +5 -0
- package/dist/notification/group-within.d.ts +22 -0
- package/dist/remote/remote-config.d.ts +6 -0
- package/dist/remote/remote-sources.d.ts +12 -0
- package/dist/{sleep-dcR4vBFG.js → sleep-4qch9WKa.js} +5 -1
- package/dist/{sleep-D0roI_CZ.mjs → sleep-Ba1dJYDo.mjs} +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Most bytes a decoded IR code may hold: two bytes per timing. A level-1 stream
|
|
3
|
+
* can expand ~130x, so the decoder checks this bound before every write.
|
|
4
|
+
*/
|
|
5
|
+
export declare const IR_DECOMPRESSED_MAX: number;
|
|
6
|
+
export declare function fastlzDecompress(input: Uint8Array): Uint8Array;
|
|
7
|
+
export declare function fastlzCompress(input: Uint8Array): Uint8Array;
|
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' | 'flipper-malformed';
|
|
2
|
+
export type IrCodecErrorCode = 'invalid-timings' | 'invalid-raw' | 'pronto-malformed' | 'pronto-unsupported-form' | 'smartir-malformed' | 'samsung-invalid' | 'flipper-malformed' | 'tuya-malformed';
|
|
3
3
|
export declare class IrCodecError extends Error {
|
|
4
4
|
readonly code: IrCodecErrorCode;
|
|
5
5
|
constructor(code: IrCodecErrorCode, message: string);
|
package/dist/ir/ir-payload.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type IrTimings, type TransmitSettings } from './ir-timings.js';
|
|
3
|
-
/** What a remote command stores: a raw pulse train,
|
|
3
|
+
/** What a remote command stores: a raw pulse train, a learned Pronto code, or a device-native code. */
|
|
4
4
|
export declare const IrPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
5
|
kind: z.ZodLiteral<"raw">;
|
|
6
6
|
timings: z.ZodArray<z.ZodNumber>;
|
|
@@ -13,6 +13,12 @@ export declare const IrPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
13
13
|
}, z.core.$strip>, z.ZodObject<{
|
|
14
14
|
kind: z.ZodLiteral<"pronto">;
|
|
15
15
|
code: z.ZodString;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
kind: z.ZodLiteral<"native">;
|
|
18
|
+
format: z.ZodEnum<{
|
|
19
|
+
tuya: "tuya";
|
|
20
|
+
}>;
|
|
21
|
+
code: z.ZodString;
|
|
16
22
|
}, z.core.$strip>], "kind">;
|
|
17
23
|
export type IrPayload = z.infer<typeof IrPayloadSchema>;
|
|
18
24
|
export interface ResolvedTransmission {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { IrTimings } from './ir-timings.js';
|
|
3
|
+
/** Device-native IR code formats a transmitter can replay verbatim. */
|
|
4
|
+
export declare const IrNativeFormatSchema: z.ZodEnum<{
|
|
5
|
+
tuya: "tuya";
|
|
6
|
+
}>;
|
|
7
|
+
export type IrNativeFormat = z.infer<typeof IrNativeFormatSchema>;
|
|
8
|
+
/**
|
|
9
|
+
* Longest native code accepted: base64 of the worst-case compressed stream
|
|
10
|
+
* (every decoded byte as a literal, plus one control byte per 32), with margin.
|
|
11
|
+
*/
|
|
12
|
+
export declare const IR_NATIVE_CODE_MAX_CHARS: number;
|
|
13
|
+
export declare const IrNativeCodeSchema: z.ZodObject<{
|
|
14
|
+
format: z.ZodEnum<{
|
|
15
|
+
tuya: "tuya";
|
|
16
|
+
}>;
|
|
17
|
+
code: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type IrNativeCode = z.infer<typeof IrNativeCodeSchema>;
|
|
20
|
+
export interface IrNativeCodec {
|
|
21
|
+
encode(timings: IrTimings): string;
|
|
22
|
+
decode(code: string): IrTimings;
|
|
23
|
+
}
|
|
24
|
+
export declare const IR_NATIVE_CODECS: Record<IrNativeFormat, IrNativeCodec>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IrTimings } from './ir-timings.js';
|
|
2
|
+
/** Signed pulse train to a Tuya IR code: base64(FastLZ(uint16 LE durations)). */
|
|
3
|
+
export declare function encodeTuya(timings: IrTimings): string;
|
|
4
|
+
/** A Tuya IR code to a signed pulse train (mark first). Throws `IrCodecError`. */
|
|
5
|
+
export declare function decodeTuya(code: string): IrTimings;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long a rule holds deliveries before it sends them (operator, 2026-11-12).
|
|
3
|
+
*
|
|
4
|
+
* Absent means the kind's default: a system-event rule waits
|
|
5
|
+
* {@link NC_GROUP_WITHIN_SYSTEM_DEFAULT_SEC}, every other rule sends at once.
|
|
6
|
+
* `0` is the explicit "send each one now". The number is never a Zod default —
|
|
7
|
+
* the addon cap path does not run those, and a default that depended on
|
|
8
|
+
* `delivery` cannot be one value on the schema.
|
|
9
|
+
*
|
|
10
|
+
* The constants live on the cap schema (one owner). `delivery === 'system-event'`
|
|
11
|
+
* is the comparison `isSystemDelivery` makes; this module does not import that
|
|
12
|
+
* function because its module imports the cap, and the cap must not import this.
|
|
13
|
+
*/
|
|
14
|
+
import { NC_GROUP_WITHIN_MAX_SEC, NC_GROUP_WITHIN_OTHER_DEFAULT_SEC, NC_GROUP_WITHIN_SYSTEM_DEFAULT_SEC } from '../capabilities/notification-rules.cap.js';
|
|
15
|
+
export { NC_GROUP_WITHIN_MAX_SEC, NC_GROUP_WITHIN_OTHER_DEFAULT_SEC, NC_GROUP_WITHIN_SYSTEM_DEFAULT_SEC, };
|
|
16
|
+
/** The rule fields the window reads. A stored rule and a half-built form both fit. */
|
|
17
|
+
export interface GroupWithinRule {
|
|
18
|
+
readonly delivery: string;
|
|
19
|
+
readonly groupWithinSec?: number;
|
|
20
|
+
}
|
|
21
|
+
/** Seconds to hold. `0` sends immediately. */
|
|
22
|
+
export declare function groupWithinSecOf(rule: GroupWithinRule): number;
|
|
@@ -89,6 +89,12 @@ export declare const RemoteConfigSchema: z.ZodObject<{
|
|
|
89
89
|
}, z.core.$strip>, z.ZodObject<{
|
|
90
90
|
kind: z.ZodLiteral<"pronto">;
|
|
91
91
|
code: z.ZodString;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
kind: z.ZodLiteral<"native">;
|
|
94
|
+
format: z.ZodEnum<{
|
|
95
|
+
tuya: "tuya";
|
|
96
|
+
}>;
|
|
97
|
+
code: z.ZodString;
|
|
92
98
|
}, z.core.$strip>], "kind">;
|
|
93
99
|
}, z.core.$strip>], "kind">>>;
|
|
94
100
|
stepDelayMs: z.ZodDefault<z.ZodNumber>;
|
|
@@ -57,6 +57,12 @@ export declare const RemoteIrSourceSchema: z.ZodObject<{
|
|
|
57
57
|
}, z.core.$strip>, z.ZodObject<{
|
|
58
58
|
kind: z.ZodLiteral<"pronto">;
|
|
59
59
|
code: z.ZodString;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
kind: z.ZodLiteral<"native">;
|
|
62
|
+
format: z.ZodEnum<{
|
|
63
|
+
tuya: "tuya";
|
|
64
|
+
}>;
|
|
65
|
+
code: z.ZodString;
|
|
60
66
|
}, z.core.$strip>], "kind">;
|
|
61
67
|
}, z.core.$strip>;
|
|
62
68
|
export type RemoteIrSource = z.infer<typeof RemoteIrSourceSchema>;
|
|
@@ -87,6 +93,12 @@ export declare const RemoteSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
87
93
|
}, z.core.$strip>, z.ZodObject<{
|
|
88
94
|
kind: z.ZodLiteral<"pronto">;
|
|
89
95
|
code: z.ZodString;
|
|
96
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
+
kind: z.ZodLiteral<"native">;
|
|
98
|
+
format: z.ZodEnum<{
|
|
99
|
+
tuya: "tuya";
|
|
100
|
+
}>;
|
|
101
|
+
code: z.ZodString;
|
|
90
102
|
}, z.core.$strip>], "kind">;
|
|
91
103
|
}, z.core.$strip>], "kind">;
|
|
92
104
|
export type RemoteSource = z.infer<typeof RemoteSourceSchema>;
|
|
@@ -9497,7 +9497,10 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
9497
9497
|
"ir-transmitter": {
|
|
9498
9498
|
scope: "device",
|
|
9499
9499
|
noun: t("IR / RF transmitter", "Trasmettitore IR / RF"),
|
|
9500
|
-
notOperatorFacing: {
|
|
9500
|
+
notOperatorFacing: {
|
|
9501
|
+
send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it",
|
|
9502
|
+
learn: "an interactive capture the operator starts from the source dialog and answers by pressing a physical remote; no automation can supply the signal"
|
|
9503
|
+
}
|
|
9501
9504
|
},
|
|
9502
9505
|
control: {
|
|
9503
9506
|
scope: "device",
|
|
@@ -15806,6 +15809,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
15806
15809
|
};
|
|
15807
15810
|
const irTransmitterInterface = {
|
|
15808
15811
|
send: (input) => dispatch("ir-transmitter", "irTransmitter", "send", "mutation", input),
|
|
15812
|
+
learn: (input) => dispatch("ir-transmitter", "irTransmitter", "learn", "mutation", input),
|
|
15809
15813
|
getInfo: (input) => dispatch("ir-transmitter", "irTransmitter", "getInfo", "query", input)
|
|
15810
15814
|
};
|
|
15811
15815
|
const lawnMowerControlInterface = {
|
|
@@ -9497,7 +9497,10 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
9497
9497
|
"ir-transmitter": {
|
|
9498
9498
|
scope: "device",
|
|
9499
9499
|
noun: t("IR / RF transmitter", "Trasmettitore IR / RF"),
|
|
9500
|
-
notOperatorFacing: {
|
|
9500
|
+
notOperatorFacing: {
|
|
9501
|
+
send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it",
|
|
9502
|
+
learn: "an interactive capture the operator starts from the source dialog and answers by pressing a physical remote; no automation can supply the signal"
|
|
9503
|
+
}
|
|
9501
9504
|
},
|
|
9502
9505
|
control: {
|
|
9503
9506
|
scope: "device",
|
|
@@ -15806,6 +15809,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
15806
15809
|
};
|
|
15807
15810
|
const irTransmitterInterface = {
|
|
15808
15811
|
send: (input) => dispatch("ir-transmitter", "irTransmitter", "send", "mutation", input),
|
|
15812
|
+
learn: (input) => dispatch("ir-transmitter", "irTransmitter", "learn", "mutation", input),
|
|
15809
15813
|
getInfo: (input) => dispatch("ir-transmitter", "irTransmitter", "getInfo", "query", input)
|
|
15810
15814
|
};
|
|
15811
15815
|
const lawnMowerControlInterface = {
|