-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscale.time.d.ts
More file actions
130 lines (130 loc) · 3.63 KB
/
scale.time.d.ts
File metadata and controls
130 lines (130 loc) · 3.63 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
export default class TimeScale extends Scale {
static id: string;
/**
* @type {any}
*/
static defaults: any;
/**
* @param {object} props
*/
constructor(props: object);
/** @type {{data: number[], labels: number[], all: number[]}} */
_cache: {
data: number[];
labels: number[];
all: number[];
};
/** @type {Unit} */
_unit: Unit;
/** @type {Unit=} */
_majorUnit: Unit | undefined;
_offsets: {};
_normalized: boolean;
_parseOpts: {
parser: any;
round: any;
isoWeekday: any;
};
init(scaleOpts: any, opts?: {}): void;
_adapter: DateAdapter;
/**
* @param {*} raw
* @param {number?} [index]
* @return {number}
*/
parse(raw: any, index?: number | null): number;
/**
* @private
*/
private _getLabelBounds;
/**
* Returns the start and end offsets from edges in the form of {start, end}
* where each value is a relative width to the scale and ranges between 0 and 1.
* They add extra margins on the both sides by scaling down the original scale.
* Offsets are added when the `offset` option is true.
* @param {number[]} timestamps
* @protected
*/
protected initOffsets(timestamps?: number[]): void;
/**
* Generates a maximum of `capacity` timestamps between min and max, rounded to the
* `minor` unit using the given scale time `options`.
* Important: this method can return ticks outside the min and max range, it's the
* responsibility of the calling code to clamp values if needed.
* @protected
*/
protected _generate(): number[];
/**
* @param {number} value
* @return {string}
*/
getLabelForValue(value: number): string;
/**
* @param {number} value
* @param {string|undefined} format
* @return {string}
*/
format(value: number, format: string | undefined): string;
/**
* Function to format an individual tick mark
* @param {number} time
* @param {number} index
* @param {object[]} ticks
* @param {string|undefined} [format]
* @return {string}
* @private
*/
private _tickFormatFunction;
/**
* @param {object[]} ticks
*/
generateTickLabels(ticks: object[]): void;
/**
* @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)
* @return {number}
*/
getDecimalForValue(value: number): number;
/**
* @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)
* @return {number}
*/
getPixelForValue(value: number): number;
/**
* @param {number} pixel
* @return {number}
*/
getValueForPixel(pixel: number): number;
/**
* @param {string} label
* @return {{w:number, h:number}}
* @private
*/
private _getLabelSize;
/**
* @param {number} exampleTime
* @return {number}
* @private
*/
private _getLabelCapacity;
/**
* @protected
*/
protected getDataTimestamps(): any;
/**
* @protected
*/
protected getLabelTimestamps(): number[];
/**
* @param {number[]} values
* @protected
*/
protected normalize(values: number[]): number[];
}
export type Unit = import('../core/core.adapters.js').TimeUnit;
export type Interval = {
common: boolean;
size: number;
steps?: number;
};
export type DateAdapter = import('../core/core.adapters.js').DateAdapter;
import Scale from "../core/core.scale.js";