Skip to content

Commit ed14554

Browse files
Changed type of session id to number. (#2982)
* Changed type of session id to number. * Extended GetHistoryOptions type * Extended GetHistoryOptions type * Added onchange
1 parent bfa740b commit ed14554

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

packages/types-dev/index.d.ts

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,56 @@ declare global {
290290

291291
interface GetHistoryOptions {
292292
instance?: string;
293+
/** Start time in ms */
293294
start?: number;
295+
/** End time in ms. If not defined, it is "now" */
294296
end?: number;
297+
/** Step in ms of intervals. Used in aggregate (max, min, average, total, ...) */
295298
step?: number;
299+
/** number of values if aggregate is 'onchange' or number of intervals if other aggregate method. Count will be ignored if step is set, else default is 500 if not set */
296300
count?: number;
301+
/** if `from` field should be included in answer */
297302
from?: boolean;
303+
/** if `ack` field should be included in answer */
298304
ack?: boolean;
305+
/** if `q` field should be included in answer */
299306
q?: boolean;
300-
addID?: boolean;
307+
/** if `id` field should be included in answer */
308+
addId?: boolean;
309+
/** do not return more entries than limit */
301310
limit?: number;
302-
ignoreNull?: boolean;
303-
sessionId?: any;
304-
aggregate?: 'minmax' | 'min' | 'max' | 'average' | 'total' | 'count' | 'none';
311+
/** round result to number of digits after decimal point */
312+
round?: number;
313+
/** if null values should be included (false), replaced by last not null value (true) or replaced with 0 (0) */
314+
ignoreNull?: boolean | 0;
315+
/** This number will be returned in answer, so the client can assign the request for it */
316+
sessionId?: number;
317+
/** aggregate method (Default: 'average') */
318+
aggregate?:
319+
| 'onchange'
320+
| 'minmax'
321+
| 'min'
322+
| 'max'
323+
| 'average'
324+
| 'total'
325+
| 'count'
326+
| 'none'
327+
| 'percentile'
328+
| 'quantile'
329+
| 'integral'
330+
| 'integralTotal';
305331
/** Returned data is normally sorted ascending by date, this option lets you return the newest instead of the oldest values if the number of returned points is limited */
306332
returnNewestEntries?: boolean;
333+
/** By default, the additional border values are returned to optimize charting. Set this option to true if this is not wanted (e.g. for script data processing) */
334+
removeBorderValues?: boolean;
335+
/** when using aggregate method `percentile` defines the percentile level (0..100)(defaults to 50) */
336+
percentile?: number;
337+
/** when using aggregate method `quantile` defines the quantile level (0..1)(defaults to 0.5) */
338+
quantile?: number;
339+
/** when using aggregate method `integral` defines the unit in seconds (defaults to 60s). e.g. to get integral in hours for Wh or such, set to 3600. */
340+
integralUnit?: number;
341+
/** when using aggregate method `integral` defines the interpolation method (defaults to `none`). */
342+
integralInterpolation?: 'none' | 'linear';
307343
}
308344

309345
interface DelObjectOptions {
@@ -442,7 +478,7 @@ declare global {
442478
err: Error | null,
443479
result?: GetHistoryResult,
444480
step?: number,
445-
sessionId?: string,
481+
sessionId?: number,
446482
) => void;
447483

448484
/** Contains the return values of readDir */

0 commit comments

Comments
 (0)