@azohra/meteo.station 0.7.0 → 0.7.2
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/air.d.ts +4 -7
- package/dist/air.js +1 -2
- package/dist/client/climatology.d.ts +5 -8
- package/dist/client/climatology.js +1 -2
- package/dist/client/history.d.ts +14 -17
- package/dist/client/history.js +2 -3
- package/dist/client/index.js +1 -1
- package/dist/client/live.d.ts +10 -12
- package/dist/client/live.js +1 -2
- package/dist/client/poll.d.ts +9 -12
- package/dist/client/poll.js +1 -2
- package/dist/client/stores.d.ts +9 -11
- package/dist/client/stores.js +2 -3
- package/dist/client/ticker.d.ts +1 -4
- package/dist/client/ticker.js +1 -2
- package/dist/climatology.d.ts +13 -15
- package/dist/climatology.js +1 -2
- package/dist/connectivity.d.ts +7 -10
- package/dist/connectivity.js +1 -2
- package/dist/contract-climatology.d.ts +11 -14
- package/dist/contract-climatology.js +1 -2
- package/dist/contract.d.ts +45 -48
- package/dist/contract.js +1 -2
- package/dist/derive.d.ts +24 -26
- package/dist/derive.js +1 -2
- package/dist/display.d.ts +7 -10
- package/dist/display.js +1 -2
- package/dist/elements/elements/AirExtremesElement.d.ts +2 -5
- package/dist/elements/elements/AirExtremesElement.js +1 -2
- package/dist/elements/elements/AirMatrixElement.d.ts +2 -5
- package/dist/elements/elements/AirMatrixElement.js +1 -2
- package/dist/elements/elements/ClimatologyDailyPatternElement.d.ts +2 -5
- package/dist/elements/elements/ClimatologyDailyPatternElement.js +2 -3
- package/dist/elements/elements/ClimatologyRoseElement.d.ts +2 -5
- package/dist/elements/elements/ClimatologyRoseElement.js +2 -3
- package/dist/elements/elements/CompassFanElement.d.ts +2 -5
- package/dist/elements/elements/CompassFanElement.js +1 -2
- package/dist/elements/elements/CurrentConditionsElement.d.ts +2 -5
- package/dist/elements/elements/CurrentConditionsElement.js +1 -2
- package/dist/elements/elements/DailyPatternElement.d.ts +2 -5
- package/dist/elements/elements/DailyPatternElement.js +2 -3
- package/dist/elements/elements/DialElement.d.ts +2 -5
- package/dist/elements/elements/DialElement.js +1 -2
- package/dist/elements/elements/FavorableShareElement.d.ts +2 -5
- package/dist/elements/elements/FavorableShareElement.js +1 -2
- package/dist/elements/elements/FreshnessBadgeElement.d.ts +2 -5
- package/dist/elements/elements/FreshnessBadgeElement.js +1 -2
- package/dist/elements/elements/RecentSummariesElement.d.ts +2 -5
- package/dist/elements/elements/RecentSummariesElement.js +1 -2
- package/dist/elements/elements/SparklineElement.d.ts +2 -5
- package/dist/elements/elements/SparklineElement.js +1 -2
- package/dist/elements/elements/StationCardElement.d.ts +6 -8
- package/dist/elements/elements/StationCardElement.js +4 -5
- package/dist/elements/elements/StationFeedElement.d.ts +2 -5
- package/dist/elements/elements/StationFeedElement.js +3 -4
- package/dist/elements/elements/StationStripElement.d.ts +2 -5
- package/dist/elements/elements/StationStripElement.js +1 -2
- package/dist/elements/elements/StationTableElement.d.ts +3 -6
- package/dist/elements/elements/StationTableElement.js +2 -3
- package/dist/elements/elements/TrendChartElement.d.ts +2 -5
- package/dist/elements/elements/TrendChartElement.js +2 -3
- package/dist/elements/elements/WindArrowElement.d.ts +2 -5
- package/dist/elements/elements/WindArrowElement.js +1 -2
- package/dist/elements/elements/WindHistoryChartElement.d.ts +2 -5
- package/dist/elements/elements/WindHistoryChartElement.js +4 -5
- package/dist/elements/elements/WindRoseElement.d.ts +2 -5
- package/dist/elements/elements/WindRoseElement.js +1 -2
- package/dist/elements/elements/atoms.d.ts +9 -11
- package/dist/elements/elements/atoms.js +2 -3
- package/dist/elements/index.d.ts +4 -6
- package/dist/elements/index.js +1 -2
- package/dist/elements/lib/ambient.d.ts +2 -5
- package/dist/elements/lib/ambient.js +1 -2
- package/dist/elements/lib/attributes.js +1 -2
- package/dist/elements/lib/base.d.ts +3 -6
- package/dist/elements/lib/base.js +2 -3
- package/dist/elements/lib/context.js +1 -2
- package/dist/elements/lib/fragments.js +2 -3
- package/dist/elements/lib/h.js +1 -2
- package/dist/elements/lib/pinned-cursor.js +1 -2
- package/dist/elements/lib/render.js +1 -2
- package/dist/elements/register.js +1 -2
- package/dist/endpoints.d.ts +6 -9
- package/dist/endpoints.js +6 -3
- package/dist/fixtures.d.ts +7 -10
- package/dist/fixtures.js +1 -2
- package/dist/format.d.ts +11 -14
- package/dist/format.js +1 -2
- package/dist/geometry.d.ts +36 -39
- package/dist/geometry.js +7 -8
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/instruments.d.ts +37 -40
- package/dist/instruments.js +1 -2
- package/dist/merge-current.d.ts +4 -7
- package/dist/merge-current.js +1 -2
- package/dist/react/components/AirExtremes.d.ts +2 -5
- package/dist/react/components/AirExtremes.js +1 -2
- package/dist/react/components/AirMatrix.d.ts +2 -5
- package/dist/react/components/AirMatrix.js +1 -2
- package/dist/react/components/ClimatologyDailyPattern.d.ts +2 -5
- package/dist/react/components/ClimatologyDailyPattern.js +1 -2
- package/dist/react/components/ClimatologyRose.d.ts +2 -5
- package/dist/react/components/ClimatologyRose.js +1 -2
- package/dist/react/components/CompassFan.d.ts +2 -5
- package/dist/react/components/CompassFan.js +1 -2
- package/dist/react/components/CurrentConditions.d.ts +2 -5
- package/dist/react/components/CurrentConditions.js +3 -4
- package/dist/react/components/DailyPattern.d.ts +2 -5
- package/dist/react/components/DailyPattern.js +2 -3
- package/dist/react/components/Dial.d.ts +2 -5
- package/dist/react/components/Dial.js +3 -4
- package/dist/react/components/FavorableShare.d.ts +2 -5
- package/dist/react/components/FavorableShare.js +1 -2
- package/dist/react/components/FreshnessBadge.d.ts +2 -5
- package/dist/react/components/FreshnessBadge.js +1 -2
- package/dist/react/components/Readout.d.ts +2 -5
- package/dist/react/components/Readout.js +1 -2
- package/dist/react/components/RecentSummaries.d.ts +2 -5
- package/dist/react/components/RecentSummaries.js +1 -2
- package/dist/react/components/SceneTree.js +1 -2
- package/dist/react/components/Sparkline.d.ts +2 -5
- package/dist/react/components/Sparkline.js +2 -3
- package/dist/react/components/StationCard.d.ts +6 -8
- package/dist/react/components/StationCard.js +4 -5
- package/dist/react/components/StationFeedProvider.d.ts +3 -6
- package/dist/react/components/StationFeedProvider.js +2 -3
- package/dist/react/components/StationStrip.d.ts +2 -5
- package/dist/react/components/StationStrip.js +3 -4
- package/dist/react/components/StationTable.d.ts +3 -6
- package/dist/react/components/StationTable.js +4 -5
- package/dist/react/components/TrendChart.d.ts +3 -6
- package/dist/react/components/TrendChart.js +3 -4
- package/dist/react/components/WindArrow.d.ts +2 -5
- package/dist/react/components/WindArrow.js +1 -2
- package/dist/react/components/WindHistoryChart.d.ts +2 -5
- package/dist/react/components/WindHistoryChart.js +4 -5
- package/dist/react/components/WindRose.d.ts +2 -5
- package/dist/react/components/WindRose.js +1 -2
- package/dist/react/components/WindSampleStrip.d.ts +2 -5
- package/dist/react/components/WindSampleStrip.js +4 -5
- package/dist/react/components/atoms.d.ts +9 -11
- package/dist/react/components/atoms.js +3 -4
- package/dist/react/hooks/useFreshness.d.ts +1 -4
- package/dist/react/hooks/useFreshness.js +2 -3
- package/dist/react/hooks/useMeasuredChartWidth.d.ts +2 -5
- package/dist/react/hooks/useMeasuredChartWidth.js +1 -2
- package/dist/react/hooks/usePolledJson.js +1 -2
- package/dist/react/hooks/useStation.d.ts +2 -5
- package/dist/react/hooks/useStation.js +1 -2
- package/dist/react/hooks/useStationClimatology.d.ts +2 -5
- package/dist/react/hooks/useStationClimatology.js +2 -3
- package/dist/react/hooks/useStationCurrent.d.ts +2 -5
- package/dist/react/hooks/useStationCurrent.js +1 -2
- package/dist/react/hooks/useStationFeed.d.ts +2 -5
- package/dist/react/hooks/useStationFeed.js +1 -2
- package/dist/react/hooks/useStationLive.d.ts +2 -5
- package/dist/react/hooks/useStationLive.js +1 -2
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +3 -3
- package/dist/react/lib/cells.js +1 -2
- package/dist/react/lib/use-pinned-cursor.js +1 -2
- package/dist/samples.d.ts +8 -11
- package/dist/samples.js +1 -2
- package/dist/scene/air-extremes.js +1 -2
- package/dist/scene/air-matrix.js +1 -2
- package/dist/scene/atoms.d.ts +2 -2
- package/dist/scene/atoms.js +2 -3
- package/dist/scene/card.js +2 -3
- package/dist/scene/cells.d.ts +2 -2
- package/dist/scene/cells.js +2 -3
- package/dist/scene/chart.d.ts +2 -5
- package/dist/scene/chart.js +1 -2
- package/dist/scene/climatology-pattern.d.ts +2 -2
- package/dist/scene/climatology-pattern.js +2 -3
- package/dist/scene/climatology-rose.d.ts +2 -2
- package/dist/scene/climatology-rose.js +2 -3
- package/dist/scene/compass-fan.d.ts +2 -2
- package/dist/scene/compass-fan.js +2 -3
- package/dist/scene/current.d.ts +2 -2
- package/dist/scene/current.js +3 -4
- package/dist/scene/daily-pattern.d.ts +2 -2
- package/dist/scene/daily-pattern.js +2 -3
- package/dist/scene/dial-parts.js +1 -2
- package/dist/scene/dial.d.ts +2 -2
- package/dist/scene/dial.js +3 -4
- package/dist/scene/favorable-share.d.ts +2 -2
- package/dist/scene/favorable-share.js +1 -2
- package/dist/scene/glyphs.js +1 -2
- package/dist/scene/node.js +1 -2
- package/dist/scene/recent-summaries.d.ts +2 -2
- package/dist/scene/recent-summaries.js +2 -3
- package/dist/scene/rose.d.ts +2 -2
- package/dist/scene/rose.js +1 -2
- package/dist/scene/sample-strip.d.ts +2 -2
- package/dist/scene/sample-strip.js +2 -3
- package/dist/scene/sparkline.js +2 -3
- package/dist/scene/strip.js +3 -4
- package/dist/scene/table.js +3 -4
- package/dist/scene/trend.d.ts +2 -2
- package/dist/scene/trend.js +1 -2
- package/dist/scene/wind-history.d.ts +2 -2
- package/dist/scene/wind-history.js +3 -4
- package/dist/scene/wind-plot.d.ts +1 -1
- package/dist/scene/wind-plot.js +2 -3
- package/dist/server/adapter.d.ts +7 -10
- package/dist/server/adapter.js +1 -2
- package/dist/server/adapters/campbell.d.ts +12 -14
- package/dist/server/adapters/campbell.js +2 -3
- package/dist/server/adapters/ecowitt.d.ts +5 -8
- package/dist/server/adapters/ecowitt.js +2 -3
- package/dist/server/adapters/tempest.d.ts +5 -8
- package/dist/server/adapters/tempest.js +2 -3
- package/dist/server/adapters/windnerd-climatology.d.ts +6 -9
- package/dist/server/adapters/windnerd-climatology.js +3 -4
- package/dist/server/adapters/windnerd-live.d.ts +3 -6
- package/dist/server/adapters/windnerd-live.js +1 -2
- package/dist/server/adapters/windnerd.d.ts +24 -27
- package/dist/server/adapters/windnerd.js +7 -8
- package/dist/server/config.d.ts +18 -20
- package/dist/server/config.js +1 -2
- package/dist/server/environment.d.ts +21 -23
- package/dist/server/environment.js +14 -15
- package/dist/server/feed.d.ts +20 -22
- package/dist/server/feed.js +3 -4
- package/dist/server/handler.d.ts +5 -8
- package/dist/server/handler.js +3 -4
- package/dist/server/hologram.d.ts +9 -12
- package/dist/server/hologram.js +1 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +9 -9
- package/dist/server/live.d.ts +2 -5
- package/dist/server/live.js +1 -2
- package/dist/sse.js +1 -2
- package/dist/strings.d.ts +8 -11
- package/dist/strings.js +1 -2
- package/dist/windnerd.d.ts +4 -7
- package/dist/windnerd.js +1 -2
- package/package.json +10 -10
|
@@ -2,8 +2,7 @@ import { Station } from "../../contract.js";
|
|
|
2
2
|
import { SpeedUnit } from "../../derive.js";
|
|
3
3
|
import { FormatTime, StationStringOverrides } from "../../strings.js";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
|
|
6
|
-
declare function StationStrip({ station: stationProp, stationId, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, unit: unitProp, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
5
|
+
export declare function StationStrip({ station: stationProp, stationId, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, unit: unitProp, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
7
6
|
station?: Station;
|
|
8
7
|
stationId?: string;
|
|
9
8
|
servedAt?: string | null;
|
|
@@ -11,6 +10,4 @@ declare function StationStrip({ station: stationProp, stationId, servedAt: serve
|
|
|
11
10
|
unit?: SpeedUnit;
|
|
12
11
|
strings?: StationStringOverrides;
|
|
13
12
|
formatTime?: FormatTime;
|
|
14
|
-
}): import("react").ReactNode;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { StationStrip };
|
|
13
|
+
}): import("react").ReactNode;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { stationFreshnessThresholds } from "../../derive.js";
|
|
3
2
|
import { resolveDisplay } from "../../display.js";
|
|
3
|
+
import { stationFreshnessThresholds } from "../../derive.js";
|
|
4
4
|
import { stationStripScene } from "../../scene/strip.js";
|
|
5
|
+
import { useFreshness } from "../hooks/useFreshness.js";
|
|
5
6
|
import { renderScene } from "./SceneTree.js";
|
|
6
7
|
import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
|
|
7
|
-
|
|
8
|
-
//#region src/react/components/StationStrip.tsx
|
|
8
|
+
// src/react/components/StationStrip.tsx
|
|
9
9
|
function StationStrip({ station: stationProp, stationId, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, unit: unitProp, strings: stringsProp, formatTime: formatTimeProp }) {
|
|
10
10
|
const context = useStationFeedContext();
|
|
11
11
|
const station = requireResolved("StationStrip", "station", stationProp ?? resolveStation(context, stationId));
|
|
@@ -25,5 +25,4 @@ function StationStrip({ station: stationProp, stationId, servedAt: servedAtProp,
|
|
|
25
25
|
words
|
|
26
26
|
}));
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { StationStrip };
|
|
@@ -3,9 +3,8 @@ import { SpeedUnit } from "../../derive.js";
|
|
|
3
3
|
import { FormatTime, StationStringOverrides } from "../../strings.js";
|
|
4
4
|
import "../../index.js";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
declare function StationTable({ stations: stationsProp, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, unit: unitProp, strings: stringsProp, formatTime: formatTimeProp, stationMeta }: {
|
|
6
|
+
export type StationMetaRenderer = (station: Station) => ReactNode;
|
|
7
|
+
export declare function StationTable({ stations: stationsProp, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, unit: unitProp, strings: stringsProp, formatTime: formatTimeProp, stationMeta }: {
|
|
9
8
|
stations?: readonly Station[];
|
|
10
9
|
servedAt?: string;
|
|
11
10
|
receivedAtMs?: number | null;
|
|
@@ -13,6 +12,4 @@ declare function StationTable({ stations: stationsProp, servedAt: servedAtProp,
|
|
|
13
12
|
strings?: StationStringOverrides;
|
|
14
13
|
formatTime?: FormatTime;
|
|
15
14
|
stationMeta?: StationMetaRenderer;
|
|
16
|
-
}): import("react").JSX.Element;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { StationMetaRenderer, StationTable };
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { stationFreshnessThresholds } from "../../derive.js";
|
|
3
2
|
import { resolveDisplay } from "../../display.js";
|
|
3
|
+
import { stationFreshnessThresholds } from "../../derive.js";
|
|
4
4
|
import { TABLE_BODY_CLASS, TABLE_ROW_CLASS, TABLE_STATION_CELL_CLASS, stationTableHeadNode, stationTableRootAttrs, stationTableRowCells } from "../../scene/table.js";
|
|
5
|
-
import { renderChildren, renderScene } from "./SceneTree.js";
|
|
6
|
-
import { requireResolved, useStationFeedContext } from "./StationFeedProvider.js";
|
|
7
5
|
import { useFreshness } from "../hooks/useFreshness.js";
|
|
8
6
|
import { StationNameLink } from "../lib/cells.js";
|
|
7
|
+
import { renderChildren, renderScene } from "./SceneTree.js";
|
|
8
|
+
import { requireResolved, useStationFeedContext } from "./StationFeedProvider.js";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
|
|
10
|
+
// src/react/components/StationTable.tsx
|
|
11
11
|
function StationTable({ stations: stationsProp, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, unit: unitProp, strings: stringsProp, formatTime: formatTimeProp, stationMeta }) {
|
|
12
12
|
const context = useStationFeedContext();
|
|
13
13
|
const stations = requireResolved("StationTable", "stations", stationsProp ?? context?.feed?.stations);
|
|
@@ -57,5 +57,4 @@ function TableRow({ formatTime, receivedAtMs, servedAt, station, stationMeta, un
|
|
|
57
57
|
}))]
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
//#endregion
|
|
61
60
|
export { StationTable };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { Station } from "../../contract.js";
|
|
2
2
|
import { FormatTime, StationStringOverrides } from "../../strings.js";
|
|
3
|
-
import { TrendSeries } from "../../geometry.js";
|
|
4
3
|
import "../../index.js";
|
|
5
|
-
|
|
6
|
-
declare function TrendChart({ station: stationProp, stationId, series, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
4
|
+
import { TrendSeries } from "../../geometry.js";
|
|
5
|
+
export declare function TrendChart({ station: stationProp, stationId, series, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
7
6
|
station?: Station;
|
|
8
7
|
stationId?: string;
|
|
9
8
|
series: TrendSeries;
|
|
10
9
|
strings?: StationStringOverrides;
|
|
11
10
|
formatTime?: FormatTime;
|
|
12
|
-
}): import("react").JSX.Element | null;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { TrendChart };
|
|
11
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { resolveDisplay } from "../../display.js";
|
|
3
3
|
import { measuredChartWidth } from "../../geometry.js";
|
|
4
|
-
import { readoutAriaLive } from "../../scene/chart.js";
|
|
5
4
|
import { TREND_CLASS, trendGate, trendScene } from "../../scene/trend.js";
|
|
5
|
+
import { readoutAriaLive } from "../../scene/chart.js";
|
|
6
6
|
import { renderScene } from "./SceneTree.js";
|
|
7
|
-
import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
|
|
8
7
|
import { usePinnedCursor } from "../lib/use-pinned-cursor.js";
|
|
8
|
+
import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
|
|
9
9
|
import { useEffect, useRef, useState } from "react";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/react/components/TrendChart.tsx
|
|
12
12
|
function TrendChart({ station: stationProp, stationId, series, strings: stringsProp, formatTime: formatTimeProp }) {
|
|
13
13
|
const context = useStationFeedContext();
|
|
14
14
|
const station = requireResolved("TrendChart", "station", stationProp ?? resolveStation(context, stationId));
|
|
@@ -74,5 +74,4 @@ function MeasuredTrend({ formatTime, history, series, stationName, width, words
|
|
|
74
74
|
onPointerMove: pinned.handlePointerMove
|
|
75
75
|
}))] });
|
|
76
76
|
}
|
|
77
|
-
//#endregion
|
|
78
77
|
export { TrendChart };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
declare function WindArrow({ deg, size }: {
|
|
1
|
+
export declare function WindArrow({ deg, size }: {
|
|
3
2
|
deg: number;
|
|
4
3
|
size?: number;
|
|
5
|
-
}): import("react").ReactNode;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { WindArrow };
|
|
4
|
+
}): import("react").ReactNode;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { windArrowNode } from "../../scene/glyphs.js";
|
|
3
3
|
import { renderScene } from "./SceneTree.js";
|
|
4
|
-
|
|
4
|
+
// src/react/components/WindArrow.tsx
|
|
5
5
|
function WindArrow({ deg, size = 12 }) {
|
|
6
6
|
return renderScene(windArrowNode(deg, size));
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { WindArrow };
|
|
@@ -3,8 +3,7 @@ import { SpeedThresholds, SpeedUnit } from "../../derive.js";
|
|
|
3
3
|
import { FormatTime, StationStringOverrides } from "../../strings.js";
|
|
4
4
|
import { FavorableDirection } from "../../instruments.js";
|
|
5
5
|
import "../../index.js";
|
|
6
|
-
|
|
7
|
-
declare function WindHistoryChart({ station: stationProp, stationId, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, unit: unitProp, plotHeight, windowHours, compareOffsetDays, nightShading, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
6
|
+
export declare function WindHistoryChart({ station: stationProp, stationId, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, unit: unitProp, plotHeight, windowHours, compareOffsetDays, nightShading, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
8
7
|
station?: Station;
|
|
9
8
|
stationId?: string;
|
|
10
9
|
thresholds?: SpeedThresholds | null;
|
|
@@ -18,6 +17,4 @@ declare function WindHistoryChart({ station: stationProp, stationId, thresholds:
|
|
|
18
17
|
nightShading?: boolean;
|
|
19
18
|
strings?: StationStringOverrides;
|
|
20
19
|
formatTime?: FormatTime;
|
|
21
|
-
}): import("react").JSX.Element | null;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { WindHistoryChart };
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { resolveDisplay } from "../../display.js";
|
|
3
|
-
import { readoutAriaLive } from "../../scene/chart.js";
|
|
4
3
|
import { WIND_CHART_CLASS, windChartGate, windChartScene } from "../../scene/wind-history.js";
|
|
4
|
+
import { readoutAriaLive } from "../../scene/chart.js";
|
|
5
5
|
import { renderScene } from "./SceneTree.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useMeasuredChartWidth } from "../hooks/useMeasuredChartWidth.js";
|
|
7
7
|
import { usePinnedCursor } from "../lib/use-pinned-cursor.js";
|
|
8
8
|
import { Readout } from "./Readout.js";
|
|
9
|
-
import {
|
|
9
|
+
import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
|
|
10
10
|
import { useId, useRef } from "react";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
|
|
12
|
+
// src/react/components/WindHistoryChart.tsx
|
|
13
13
|
function WindHistoryChart({ station: stationProp, stationId, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, unit: unitProp, plotHeight, windowHours, compareOffsetDays, nightShading = false, strings: stringsProp, formatTime: formatTimeProp }) {
|
|
14
14
|
const context = useStationFeedContext();
|
|
15
15
|
const station = requireResolved("WindHistoryChart", "station", stationProp ?? resolveStation(context, stationId));
|
|
@@ -82,5 +82,4 @@ function MeasuredChart({ compareOffsetDays, favorableDirections, formatTime, his
|
|
|
82
82
|
onPointerMove: pinned.handlePointerMove
|
|
83
83
|
}))] });
|
|
84
84
|
}
|
|
85
|
-
//#endregion
|
|
86
85
|
export { WindHistoryChart };
|
|
@@ -3,8 +3,7 @@ import { SpeedThresholds } from "../../derive.js";
|
|
|
3
3
|
import { StationStringOverrides } from "../../strings.js";
|
|
4
4
|
import { FavorableDirection } from "../../instruments.js";
|
|
5
5
|
import "../../index.js";
|
|
6
|
-
|
|
7
|
-
declare function WindRose({ station: stationProp, stationId, points, sectorCount, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, strings: stringsProp }: {
|
|
6
|
+
export declare function WindRose({ station: stationProp, stationId, points, sectorCount, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, strings: stringsProp }: {
|
|
8
7
|
station?: Station;
|
|
9
8
|
stationId?: string;
|
|
10
9
|
points?: HistoryPoint[];
|
|
@@ -12,6 +11,4 @@ declare function WindRose({ station: stationProp, stationId, points, sectorCount
|
|
|
12
11
|
thresholds?: SpeedThresholds | null;
|
|
13
12
|
favorableDirections?: FavorableDirection[] | null;
|
|
14
13
|
strings?: StationStringOverrides;
|
|
15
|
-
}): import("react").ReactNode;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { WindRose };
|
|
14
|
+
}): import("react").ReactNode;
|
|
@@ -3,7 +3,7 @@ import { resolveDisplay } from "../../display.js";
|
|
|
3
3
|
import { windRoseScene, windRoseSource } from "../../scene/rose.js";
|
|
4
4
|
import { renderScene } from "./SceneTree.js";
|
|
5
5
|
import { resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
|
|
6
|
-
|
|
6
|
+
// src/react/components/WindRose.tsx
|
|
7
7
|
function WindRose({ station: stationProp, stationId, points, sectorCount = 16, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, strings: stringsProp }) {
|
|
8
8
|
const context = useStationFeedContext();
|
|
9
9
|
const station = stationProp ?? (points == null ? resolveStation(context, stationId) ?? void 0 : void 0);
|
|
@@ -21,5 +21,4 @@ function WindRose({ station: stationProp, stationId, points, sectorCount = 16, t
|
|
|
21
21
|
words
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { WindRose };
|
|
@@ -3,8 +3,7 @@ import { SpeedUnit } from "../../derive.js";
|
|
|
3
3
|
import { FormatTime, StationStringOverrides } from "../../strings.js";
|
|
4
4
|
import { FavorableDirection } from "../../instruments.js";
|
|
5
5
|
import "../../index.js";
|
|
6
|
-
|
|
7
|
-
declare function WindSampleStrip({ samples, stationName, unit: unitProp, favorableDirections: favorableDirectionsProp, plotHeight, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
6
|
+
export declare function WindSampleStrip({ samples, stationName, unit: unitProp, favorableDirections: favorableDirectionsProp, plotHeight, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
8
7
|
samples: LiveSamples | null | undefined;
|
|
9
8
|
stationName: string;
|
|
10
9
|
unit?: SpeedUnit;
|
|
@@ -12,6 +11,4 @@ declare function WindSampleStrip({ samples, stationName, unit: unitProp, favorab
|
|
|
12
11
|
plotHeight?: number;
|
|
13
12
|
strings?: StationStringOverrides;
|
|
14
13
|
formatTime?: FormatTime;
|
|
15
|
-
}): import("react").JSX.Element;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { WindSampleStrip };
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { resolveDisplay } from "../../display.js";
|
|
3
|
-
import { readoutAriaLive } from "../../scene/chart.js";
|
|
4
3
|
import { SAMPLE_STRIP_CLASS, sampleStripGate, sampleStripScene } from "../../scene/sample-strip.js";
|
|
4
|
+
import { readoutAriaLive } from "../../scene/chart.js";
|
|
5
5
|
import { renderScene } from "./SceneTree.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useMeasuredChartWidth } from "../hooks/useMeasuredChartWidth.js";
|
|
7
7
|
import { usePinnedCursor } from "../lib/use-pinned-cursor.js";
|
|
8
8
|
import { Readout } from "./Readout.js";
|
|
9
|
-
import {
|
|
9
|
+
import { useStationFeedContext } from "./StationFeedProvider.js";
|
|
10
10
|
import { useRef } from "react";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
|
|
12
|
+
// src/react/components/WindSampleStrip.tsx
|
|
13
13
|
function WindSampleStrip({ samples, stationName, unit: unitProp, favorableDirections: favorableDirectionsProp, plotHeight, strings: stringsProp, formatTime: formatTimeProp }) {
|
|
14
14
|
const context = useStationFeedContext();
|
|
15
15
|
const { favorableDirections, formatTime, unit, words } = resolveDisplay(context, {
|
|
@@ -66,5 +66,4 @@ function MeasuredStrip({ favorableDirections, formatTime, plotHeight, samples, s
|
|
|
66
66
|
onPointerMove: pinned.handlePointerMove
|
|
67
67
|
}))] });
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
export { WindSampleStrip };
|
|
@@ -3,7 +3,6 @@ import { SpeedThresholds, SpeedUnit } from "../../derive.js";
|
|
|
3
3
|
import { FormatTime, StationStringOverrides } from "../../strings.js";
|
|
4
4
|
import { FavorableDirection } from "../../instruments.js";
|
|
5
5
|
import "../../index.js";
|
|
6
|
-
//#region src/react/components/atoms.d.ts
|
|
7
6
|
type AtomProps = {
|
|
8
7
|
station?: Station;
|
|
9
8
|
stationId?: string;
|
|
@@ -12,15 +11,15 @@ type AtomProps = {
|
|
|
12
11
|
type SpeedAtomProps = AtomProps & {
|
|
13
12
|
unit?: SpeedUnit;
|
|
14
13
|
};
|
|
15
|
-
declare function Speed(props: SpeedAtomProps): import("react").JSX.Element;
|
|
16
|
-
declare function Gust(props: SpeedAtomProps): import("react").JSX.Element;
|
|
17
|
-
declare function Lull(props: SpeedAtomProps): import("react").JSX.Element;
|
|
18
|
-
declare function Temperature({ station: stationProp, stationId, strings: stringsProp }: AtomProps): import("react").ReactNode;
|
|
19
|
-
declare function Pressure({ station: stationProp, stationId, strings: stringsProp }: AtomProps): import("react").ReactNode;
|
|
20
|
-
declare function Direction({ station: stationProp, stationId, strings: stringsProp, favorableDirections: favorableDirectionsProp }: AtomProps & {
|
|
14
|
+
export declare function Speed(props: SpeedAtomProps): import("react").JSX.Element;
|
|
15
|
+
export declare function Gust(props: SpeedAtomProps): import("react").JSX.Element;
|
|
16
|
+
export declare function Lull(props: SpeedAtomProps): import("react").JSX.Element;
|
|
17
|
+
export declare function Temperature({ station: stationProp, stationId, strings: stringsProp }: AtomProps): import("react").ReactNode;
|
|
18
|
+
export declare function Pressure({ station: stationProp, stationId, strings: stringsProp }: AtomProps): import("react").ReactNode;
|
|
19
|
+
export declare function Direction({ station: stationProp, stationId, strings: stringsProp, favorableDirections: favorableDirectionsProp }: AtomProps & {
|
|
21
20
|
favorableDirections?: FavorableDirection[] | null;
|
|
22
21
|
}): import("react").ReactNode;
|
|
23
|
-
declare function UpdatedAt({ station: stationProp, stationId, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
22
|
+
export declare function UpdatedAt({ station: stationProp, stationId, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, strings: stringsProp, formatTime: formatTimeProp }: {
|
|
24
23
|
station?: Station;
|
|
25
24
|
stationId?: string;
|
|
26
25
|
servedAt?: string | null;
|
|
@@ -28,9 +27,8 @@ declare function UpdatedAt({ station: stationProp, stationId, servedAt: servedAt
|
|
|
28
27
|
strings?: StationStringOverrides;
|
|
29
28
|
formatTime?: FormatTime;
|
|
30
29
|
}): import("react").ReactNode;
|
|
31
|
-
declare function BandChip({ station: stationProp, stationId, thresholds: thresholdsProp, labels, unit: unitProp, strings: stringsProp }: SpeedAtomProps & {
|
|
30
|
+
export declare function BandChip({ station: stationProp, stationId, thresholds: thresholdsProp, labels, unit: unitProp, strings: stringsProp }: SpeedAtomProps & {
|
|
32
31
|
thresholds?: SpeedThresholds | null;
|
|
33
32
|
labels?: readonly string[];
|
|
34
33
|
}): import("react").ReactNode;
|
|
35
|
-
|
|
36
|
-
export { BandChip, Direction, Gust, Lull, Pressure, Speed, Temperature, UpdatedAt };
|
|
34
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { resolveDisplay } from "../../display.js";
|
|
3
2
|
import { subscribeTicker } from "../../client/ticker.js";
|
|
4
|
-
import {
|
|
3
|
+
import { resolveDisplay } from "../../display.js";
|
|
5
4
|
import { bandChipNode, directionAtomNode, updatedAtNode, valueAtomNode } from "../../scene/cells.js";
|
|
5
|
+
import { pressureAtomScene, speedAtomScene, temperatureAtomScene } from "../../scene/atoms.js";
|
|
6
6
|
import { renderScene } from "./SceneTree.js";
|
|
7
7
|
import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
|
|
8
8
|
import { useEffect, useState } from "react";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
|
|
10
|
+
// src/react/components/atoms.tsx
|
|
11
11
|
function useResolvedStation(component, stationProp, stationId) {
|
|
12
12
|
const context = useStationFeedContext();
|
|
13
13
|
return {
|
|
@@ -99,5 +99,4 @@ function BandChip({ station: stationProp, stationId, thresholds: thresholdsProp,
|
|
|
99
99
|
words
|
|
100
100
|
}));
|
|
101
101
|
}
|
|
102
|
-
//#endregion
|
|
103
102
|
export { BandChip, Direction, Gust, Lull, Pressure, Speed, Temperature, UpdatedAt };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { FreshnessStatus, FreshnessThresholds } from "../../derive.js";
|
|
2
2
|
import "../../index.js";
|
|
3
|
-
|
|
4
|
-
declare function useFreshness(observedAt: string | null | undefined, servedAt: string | null | undefined, receivedAtMs: number | null | undefined, thresholds?: FreshnessThresholds): FreshnessStatus | null;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { useFreshness };
|
|
3
|
+
export declare function useFreshness(observedAt: string | null | undefined, servedAt: string | null | undefined, receivedAtMs: number | null | undefined, thresholds?: FreshnessThresholds): FreshnessStatus | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { freshness } from "../../derive.js";
|
|
3
2
|
import { subscribeTicker } from "../../client/ticker.js";
|
|
3
|
+
import { freshness } from "../../derive.js";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
|
-
|
|
5
|
+
// src/react/hooks/useFreshness.ts
|
|
6
6
|
function useFreshness(observedAt, servedAt, receivedAtMs, thresholds) {
|
|
7
7
|
const [nowMs, setNowMs] = useState(() => receivedAtMs ?? Date.now());
|
|
8
8
|
useEffect(() => {
|
|
@@ -17,5 +17,4 @@ function useFreshness(observedAt, servedAt, receivedAtMs, thresholds) {
|
|
|
17
17
|
nowMs
|
|
18
18
|
}, thresholds);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { useFreshness };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
declare function useMeasuredChartWidth(ref: {
|
|
1
|
+
export declare function useMeasuredChartWidth(ref: {
|
|
3
2
|
readonly current: Element | null;
|
|
4
3
|
}, { enabled }?: {
|
|
5
4
|
enabled?: boolean;
|
|
6
|
-
}): number | null;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { useMeasuredChartWidth };
|
|
5
|
+
}): number | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { measuredChartWidth } from "../../geometry.js";
|
|
3
3
|
import { useEffect, useLayoutEffect, useState } from "react";
|
|
4
|
-
|
|
4
|
+
// src/react/hooks/useMeasuredChartWidth.ts
|
|
5
5
|
const useMeasureEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
6
6
|
function useMeasuredChartWidth(ref, { enabled = true } = {}) {
|
|
7
7
|
const [width, setWidth] = useState(null);
|
|
@@ -22,5 +22,4 @@ function useMeasuredChartWidth(ref, { enabled = true } = {}) {
|
|
|
22
22
|
}, [ref, enabled]);
|
|
23
23
|
return width;
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { useMeasuredChartWidth };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback, useEffect, useSyncExternalStore } from "react";
|
|
3
|
-
|
|
3
|
+
// src/react/hooks/usePolledJson.ts
|
|
4
4
|
function usePoller(poller, enabled) {
|
|
5
5
|
const snapshot = useSyncExternalStore(poller.subscribe, poller.getSnapshot, poller.getSnapshot);
|
|
6
6
|
useEffect(() => {
|
|
@@ -13,5 +13,4 @@ function usePoller(poller, enabled) {
|
|
|
13
13
|
refresh: useCallback(() => poller.refresh(), [poller])
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { usePoller };
|
|
@@ -2,8 +2,7 @@ import { PollError } from "../../client/poll.js";
|
|
|
2
2
|
import { Station, StationFeed } from "../../contract.js";
|
|
3
3
|
import "../../client/index.js";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
|
|
6
|
-
declare function useStation(url: string, stationId: string, options?: {
|
|
5
|
+
export declare function useStation(url: string, stationId: string, options?: {
|
|
7
6
|
pollSeconds?: number;
|
|
8
7
|
currentPollSeconds?: number;
|
|
9
8
|
enabled?: boolean;
|
|
@@ -19,6 +18,4 @@ declare function useStation(url: string, stationId: string, options?: {
|
|
|
19
18
|
receivedAtMs: number | null;
|
|
20
19
|
error: PollError | null;
|
|
21
20
|
refresh: () => void;
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
export { useStation };
|
|
21
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createStationStore } from "../../client/stores.js";
|
|
3
3
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
4
|
-
|
|
4
|
+
// src/react/hooks/useStation.ts
|
|
5
5
|
function useStation(url, stationId, options = {}) {
|
|
6
6
|
const { pollSeconds, currentPollSeconds, enabled = true, fetchInit, initialData } = options;
|
|
7
7
|
const live = options.live === true;
|
|
@@ -36,5 +36,4 @@ function useStation(url, stationId, options = {}) {
|
|
|
36
36
|
refresh: () => store.refresh()
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { useStation };
|
|
@@ -2,10 +2,9 @@ import { PollError } from "../../client/poll.js";
|
|
|
2
2
|
import { StationClimatology } from "../../contract-climatology.js";
|
|
3
3
|
import "../../client/index.js";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
//#region src/react/hooks/useStationClimatology.d.ts
|
|
6
5
|
/** Fetches the station's climatology document once and holds it — near-
|
|
7
6
|
* immutable history needs no poller; filters re-aggregate client-side. */
|
|
8
|
-
declare function useStationClimatology(base: string, stationId: string, options?: {
|
|
7
|
+
export declare function useStationClimatology(base: string, stationId: string, options?: {
|
|
9
8
|
enabled?: boolean;
|
|
10
9
|
fetchInit?: RequestInit;
|
|
11
10
|
}): {
|
|
@@ -13,6 +12,4 @@ declare function useStationClimatology(base: string, stationId: string, options?
|
|
|
13
12
|
loading: boolean;
|
|
14
13
|
error: PollError | null;
|
|
15
14
|
refresh: () => void;
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { useStationClimatology };
|
|
15
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { climatologyEndpoint } from "../../endpoints.js";
|
|
3
2
|
import { createStationClimatologyStore } from "../../client/climatology.js";
|
|
3
|
+
import { climatologyEndpoint } from "../../endpoints.js";
|
|
4
4
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
5
|
-
|
|
5
|
+
// src/react/hooks/useStationClimatology.ts
|
|
6
6
|
/** Fetches the station's climatology document once and holds it — near-
|
|
7
7
|
* immutable history needs no poller; filters re-aggregate client-side. */
|
|
8
8
|
function useStationClimatology(base, stationId, options = {}) {
|
|
@@ -21,5 +21,4 @@ function useStationClimatology(base, stationId, options = {}) {
|
|
|
21
21
|
refresh: () => void store.refresh()
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { useStationClimatology };
|
|
@@ -2,8 +2,7 @@ import { PollError } from "../../client/poll.js";
|
|
|
2
2
|
import { Station, StationCurrent } from "../../contract.js";
|
|
3
3
|
import "../../client/index.js";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
|
|
6
|
-
declare function useStationCurrent(url: string, stationId: string, options?: {
|
|
5
|
+
export declare function useStationCurrent(url: string, stationId: string, options?: {
|
|
7
6
|
pollSeconds?: number;
|
|
8
7
|
enabled?: boolean;
|
|
9
8
|
fetchInit?: RequestInit;
|
|
@@ -18,6 +17,4 @@ declare function useStationCurrent(url: string, stationId: string, options?: {
|
|
|
18
17
|
error: PollError | null;
|
|
19
18
|
receivedAtMs: number | null;
|
|
20
19
|
refresh: () => void;
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
export { useStationCurrent };
|
|
20
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createStationCurrentStore } from "../../client/stores.js";
|
|
3
3
|
import { usePoller } from "./usePolledJson.js";
|
|
4
4
|
import { useMemo, useRef } from "react";
|
|
5
|
-
|
|
5
|
+
// src/react/hooks/useStationCurrent.ts
|
|
6
6
|
function useStationCurrent(url, stationId, options = {}) {
|
|
7
7
|
const { pollSeconds, enabled = true, fetchInit, initialData } = options;
|
|
8
8
|
const fetchInitRef = useRef(fetchInit);
|
|
@@ -29,5 +29,4 @@ function useStationCurrent(url, stationId, options = {}) {
|
|
|
29
29
|
refresh
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { useStationCurrent };
|
|
@@ -2,8 +2,7 @@ import { PollError } from "../../client/poll.js";
|
|
|
2
2
|
import { StationFeed } from "../../contract.js";
|
|
3
3
|
import "../../client/index.js";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
|
|
6
|
-
declare function useStationFeed(url: string, options?: {
|
|
5
|
+
export declare function useStationFeed(url: string, options?: {
|
|
7
6
|
pollSeconds?: number;
|
|
8
7
|
enabled?: boolean;
|
|
9
8
|
fetchInit?: RequestInit;
|
|
@@ -16,6 +15,4 @@ declare function useStationFeed(url: string, options?: {
|
|
|
16
15
|
error: PollError | null;
|
|
17
16
|
receivedAtMs: number | null;
|
|
18
17
|
refresh: () => void;
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
export { useStationFeed };
|
|
18
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createStationFeedStore } from "../../client/stores.js";
|
|
3
3
|
import { usePoller } from "./usePolledJson.js";
|
|
4
4
|
import { useMemo, useRef } from "react";
|
|
5
|
-
|
|
5
|
+
// src/react/hooks/useStationFeed.ts
|
|
6
6
|
function useStationFeed(url, options = {}) {
|
|
7
7
|
const { pollSeconds, enabled = true, fetchInit, initialData } = options;
|
|
8
8
|
const fetchInitRef = useRef(fetchInit);
|
|
@@ -25,5 +25,4 @@ function useStationFeed(url, options = {}) {
|
|
|
25
25
|
refresh
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { useStationFeed };
|
|
@@ -3,8 +3,7 @@ import { LiveSample, Station } from "../../contract.js";
|
|
|
3
3
|
import { LiveStatus } from "../../client/live.js";
|
|
4
4
|
import "../../client/index.js";
|
|
5
5
|
import "../../index.js";
|
|
6
|
-
|
|
7
|
-
declare function useStationLive(url: string, stationId: string, options?: {
|
|
6
|
+
export declare function useStationLive(url: string, stationId: string, options?: {
|
|
8
7
|
enabled?: boolean;
|
|
9
8
|
fetchInit?: RequestInit;
|
|
10
9
|
windowSeconds?: number;
|
|
@@ -15,6 +14,4 @@ declare function useStationLive(url: string, stationId: string, options?: {
|
|
|
15
14
|
servedAt: string | null;
|
|
16
15
|
receivedAtMs: number | null;
|
|
17
16
|
error: PollError | null;
|
|
18
|
-
};
|
|
19
|
-
//#endregion
|
|
20
|
-
export { useStationLive };
|
|
17
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createStationLiveStore } from "../../client/live.js";
|
|
3
3
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
4
|
-
|
|
4
|
+
// src/react/hooks/useStationLive.ts
|
|
5
5
|
function useStationLive(url, stationId, options = {}) {
|
|
6
6
|
const { enabled = true, fetchInit, windowSeconds } = options;
|
|
7
7
|
const fetchInitRef = useRef(fetchInit);
|
|
@@ -29,5 +29,4 @@ function useStationLive(url, stationId, options = {}) {
|
|
|
29
29
|
error: snapshot.error
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { useStationLive };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ import { RecentSummaries } from "./components/RecentSummaries.js";
|
|
|
17
17
|
import { ClimatologyRose } from "./components/ClimatologyRose.js";
|
|
18
18
|
import { DailyPattern } from "./components/DailyPattern.js";
|
|
19
19
|
import { ReadoutPart } from "../scene/chart.js";
|
|
20
|
-
import "../scene/index.js";
|
|
21
20
|
import { Readout } from "./components/Readout.js";
|
|
21
|
+
import "../scene/index.js";
|
|
22
22
|
import { WindHistoryChart } from "./components/WindHistoryChart.js";
|
|
23
23
|
import { WindRose } from "./components/WindRose.js";
|
|
24
24
|
import { WindSampleStrip } from "./components/WindSampleStrip.js";
|