Skip to content

Commit

Permalink
start js docs work
Browse files Browse the repository at this point in the history
  • Loading branch information
ssanjay1 committed Jul 26, 2024
1 parent cd37441 commit e84d5a3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/client.api/src/timeseries/timeseries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,36 @@ export interface TimeSeriesPoint<T extends string | number> {
}

export interface TimeSeriesProperty<T extends number | string> {
/**
* Queries the first point of the Timeseries
*/
getFirstPoint(): Promise<TimeSeriesPoint<T>>;
/**
* Queries the last point of the Timeseries
*/
getLastPoint(): Promise<TimeSeriesPoint<T>>;
/**
* 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<Array<TimeSeriesPoint<T>>>;
/**
* 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<TimeSeriesPoint<T>>;
}

0 comments on commit e84d5a3

Please sign in to comment.