@camstack/types 1.2.547 → 1.2.548
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 +8 -0
- package/dist/automation/condition-eval.d.ts +24 -0
- package/dist/automation/hold.d.ts +11 -0
- package/dist/automation/index.d.ts +6 -4
- package/dist/automation/recipe.d.ts +5 -0
- package/dist/automation/step-condition.d.ts +7 -2
- package/dist/automation/trace.d.ts +6 -0
- package/dist/automation/trigger-variables.d.ts +3 -1
- package/dist/automation/when-site.d.ts +27 -0
- package/dist/automation/when.d.ts +107 -1
- package/dist/capabilities/actions.cap.d.ts +2 -0
- package/dist/capabilities/core-blocks.cap.d.ts +6 -0
- package/dist/capabilities/schedulers.cap.d.ts +2 -0
- package/dist/generated/addon-api.d.ts +20 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +508 -42
- package/dist/index.mjs +497 -43
- package/dist/time/index.d.ts +1 -0
- package/dist/time/time-spec.d.ts +5 -0
- package/dist/time/time-window.d.ts +33 -0
- package/package.json +1 -1
package/dist/time/index.d.ts
CHANGED
package/dist/time/time-spec.d.ts
CHANGED
|
@@ -57,6 +57,11 @@ export interface TimeSite {
|
|
|
57
57
|
readonly lat: number;
|
|
58
58
|
readonly lon: number;
|
|
59
59
|
readonly timeZone: string;
|
|
60
|
+
/**
|
|
61
|
+
* Set by {@link zoneOnlySite}: the coordinates are placeholders, so a sun
|
|
62
|
+
* event cannot be placed on this site and a caller must not read one.
|
|
63
|
+
*/
|
|
64
|
+
readonly zoneOnly?: true;
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
67
|
* A moment as epoch ms, or `null` — "nothing happens". `null` means one of two
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A daily window as a STATE: is this instant inside it, and when does that
|
|
3
|
+
* next change? Pure — the answer is built per local date from
|
|
4
|
+
* {@link occurrenceOn}, so a DST change needs no special case.
|
|
5
|
+
*
|
|
6
|
+
* Rules:
|
|
7
|
+
* - A window whose `to` is not after its `from` on the same local date WRAPS:
|
|
8
|
+
* it runs from `from` on day D to `to` on D+1.
|
|
9
|
+
* - `days` names the local day a window STARTS on. 22:00-06:00 on weekdays is
|
|
10
|
+
* inside at 01:00 Saturday (it started Friday). With `days` and no
|
|
11
|
+
* `between` the window is the whole local day.
|
|
12
|
+
* - A sun event that does not happen on a day (polar day or night) gives that
|
|
13
|
+
* day no window. A sun event on a site WITHOUT a location (or an unknown
|
|
14
|
+
* zone) cannot be judged at all: the result is `unknown`, never a guess.
|
|
15
|
+
*/
|
|
16
|
+
import { type TimeSite, type TimeSpec, type WeekdayKey } from './time-spec.js';
|
|
17
|
+
export interface TimeWindow {
|
|
18
|
+
readonly between?: {
|
|
19
|
+
readonly from: TimeSpec;
|
|
20
|
+
readonly to: TimeSpec;
|
|
21
|
+
};
|
|
22
|
+
readonly days?: readonly WeekdayKey[];
|
|
23
|
+
}
|
|
24
|
+
export interface TimeWindowJudgement {
|
|
25
|
+
/** Is `nowMs` inside the window. Always false when `unknown`. */
|
|
26
|
+
readonly inside: boolean;
|
|
27
|
+
/** The window cannot be placed on this site; `inside` is false and means nothing. */
|
|
28
|
+
readonly unknown: boolean;
|
|
29
|
+
/** The soonest boundary strictly after `nowMs`, or null when none is within reach (or unknown). */
|
|
30
|
+
readonly nextChangeAtMs: number | null;
|
|
31
|
+
readonly why: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function judgeTimeWindow(window: TimeWindow, nowMs: number, site: TimeSite): TimeWindowJudgement;
|