@konsumation/db-level
Version:
timeseries database on leveldb
57 lines (56 loc) • 1.79 kB
text/typescript
/**
* Value Category.
* @param {string} name category name
* @param {Object} options
* @param {string} options.description
* @param {string} options.unit physical unit like kWh or m3
* @param {number} options.fractionalDigits display precission
*
* @property {string} name category name
* @property {string} description
* @property {string} unit physical unit
* @property {number} fractionalDigits display precission
*/
export class LevelCategory extends Category {
static get factories(): {
[LevelMeter.type]: typeof LevelMeter;
};
static get keyPrefix(): string;
/**
* Get categories.
* @param {ClassicLevel} db
* @param {string|undefined} gte lowest name
* @param {string|undefined} lte highst name
* @return {AsyncIterable<Category>}
*/
static entries(db: ClassicLevel, gte?: string | undefined, lte?: string | undefined): AsyncIterable<Category>;
/**
* Writes object into database.
* Leaves all other entries alone.
* @see {key}
* @param {ClassicLevel} db
*/
write(db: ClassicLevel): Promise<void>;
/**
* @return {string}
*/
get key(): string;
/**
* Get Meters of the category.
* @param {ClassicLevel} db
* @param {Object} [options]
* @param {string} [options.gte] from name
* @param {string} [options.lte] up to name
* @param {boolean} [options.reverse] order
* @return {AsyncIterable<Meter>}
*/
meters(db: ClassicLevel, options?: {
gte?: string;
lte?: string;
reverse?: boolean;
}): AsyncIterable<Meter>;
}
import { Category } from "@konsumation/model";
import { ClassicLevel } from "classic-level";
import { Meter } from "@konsumation/model";
import { LevelMeter } from "./meter.mjs";