-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
60 lines (51 loc) · 1.7 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/// <reference types="node" />
/// <reference types="@types/es6-shim" />
/// <reference types="@slimio/addon" />
/// <reference types="@slimio/tsd" />
import * as events from "events";
declare function Metrics(addon: Addon): {
Global: {
entities: Set<number | Metrics.Entity>;
mics: Map<string, Metrics.MetricIdentityCard>;
};
sendRawQoS: (micName: string, value: any, harvestedAt?: number) => void;
Entity: typeof Metrics.Entity;
MetricIdentityCard: typeof Metrics.MetricIdentityCard;
};
declare namespace Metrics {
declare class Entity {
constructor(name: string, options?: {
description?: string;
parent?: Entity | number;
});
public name: string;
public description: string;
public parent: Entity | number;
public descriptors: Map<string, string|number>;
public id: number | null;
public mics: MetricIdentityCard[];
toJSON(): SlimIO.RawEntity;
set(key: string, value: number|string): Entity;
}
declare class MetricIdentityCard extends events {
constructor(name: string, options?: {
unit: Units;
entity: Entity | number;
description?: string;
max?: number;
interval?: number;
});
public name: string;
public description: string;
public unit: Units;
public interval: number;
public max: number;
public entity: Entity | number;
public id: number;
public readonly hasLocalRef: boolean;
publish(value: any, harvestedAt?: number): void;
toJSON(): SlimIO.RawIdentityCard;
}
}
export as namespace Metrics;
export = Metrics;