UNPKG

1.16 kBTypeScriptView Raw
1/**
2 * FieldType is an enumeration of InfluxDB field data types.
3 * @typedef {Number} FieldType
4 * @example
5 * import { FieldType } from 'influx'; // or const FieldType = require('influx').FieldType
6 *
7 * const schema = {
8 * measurement: 'my_measurement',
9 * fields: {
10 * my_int: FieldType.INTEGER,
11 * my_float: FieldType.FLOAT,
12 * my_string: FieldType.STRING,
13 * my_boolean: FieldType.BOOLEAN,
14 * }
15 * }
16 */
17export declare enum FieldType {
18 FLOAT = 0,
19 INTEGER = 1,
20 STRING = 2,
21 BOOLEAN = 3
22}
23export declare function isNumeric(value: string): boolean;
24/**
25 * You can provide Raw values to Influx methods to prevent it from escaping
26 * your provided string.
27 * @class
28 * @example
29 * influx.createDatabase(new Influx.Raw('This won\'t be escaped!'));
30 */
31export declare class Raw {
32 private readonly value;
33 /**
34 * Wraps a string so that it is not escaped in Influx queries.
35 * @param value
36 * @example
37 * influx.createDatabase(new Influx.Raw('This won\'t be escaped!'));
38 */
39 constructor(value: string);
40 /**
41 * Returns the wrapped string.
42 * @return
43 */
44 getValue(): string;
45}