From e84d5a3cf746464d3c6c9ee68b29a09a4c24917b Mon Sep 17 00:00:00 2001 From: Saurav Date: Fri, 26 Jul 2024 11:28:02 -0400 Subject: [PATCH] start js docs work --- .../client.api/src/timeseries/timeseries.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/client.api/src/timeseries/timeseries.ts b/packages/client.api/src/timeseries/timeseries.ts index be8d2ffb5..9add51d87 100644 --- a/packages/client.api/src/timeseries/timeseries.ts +++ b/packages/client.api/src/timeseries/timeseries.ts @@ -68,8 +68,36 @@ export interface TimeSeriesPoint { } export interface TimeSeriesProperty { + /** + * Queries the first point of the Timeseries + */ getFirstPoint(): Promise>; + /** + * Queries the last point of the Timeseries + */ getLastPoint(): Promise>; + /** + * Loads all points, within the given time range if that's provided + * @param query a query representing either an absolute or relative range of time + * @example + * const points = await employee.employeeStatus?.getAllPoints({ + $after: 1, + $unit: "month", + }); + */ getAllPoints(query?: TimeSeriesQuery): Promise>>; + /** + * Returns an async iterator to load all points + * within the given time range if that's provided + * @param query a query representing either an absolute or relative range of time + * @example + * const iterator = employee.employeeStatus?.asyncIter({ + $after: 1, + $unit: "month", + }); + for await (const point of iterator) { + // Handle time series point + } + */ asyncIterPoints(query?: TimeSeriesQuery): AsyncGenerator>; }