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>; }