-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
122 lines (101 loc) · 2.53 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
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
/*
* index.d.ts
*
* Copyright (c) 2024 Xiongfei Shi
*
* Author: Xiongfei Shi <xiongfei.shi(a)icloud.com>
* License: Apache-2.0
*
* https://github.com/shixiongfei/napi-talib
*/
export * from "./types.js";
import { Compatibility, FuncUnstId } from "./types.js";
export type InputParameterType = "price" | "real" | "integer";
export type InputFlags =
| "open"
| "high"
| "low"
| "close"
| "volume"
| "openinterest"
| "timestamp";
export type InputParameterInfo = {
name: string;
type: InputParameterType;
flags: InputFlags[];
};
export type OptInputParameterType =
| "real_range"
| "real_list"
| "integer_range"
| "integer_list";
export type OptInputFlags = "percent" | "degree" | "currency" | "advanced";
export type OptInputParameterInfo = {
name: string;
displayName: string;
defaultValue: number;
hint: string;
type: OptInputParameterType;
flags: OptInputFlags[];
};
export type OutputParameterType = "real" | "integer";
export type OutputFlags =
| "line"
| "line_dot"
| "line_dash"
| "dot"
| "histogram"
| "pattern_bool"
| "pattern_bull_bear"
| "pattern_strength"
| "positive"
| "negative"
| "zero"
| "limit_upper"
| "limit_lower";
export type OutputParameterInfo = {
name: string;
type: OutputParameterType;
flags: OutputFlags;
};
export type FuncInfo = {
name: string;
group: string;
hint: string;
inputs: InputParameterInfo[];
optInputs: OptInputParameterInfo[];
outputs: OutputParameterInfo[];
};
export type FuncParam = {
name: string;
startIdx: number;
endIdx: number;
params: { [name: string]: number[] | number };
};
export type FuncResult = {
begIndex: number;
nbElement: number;
results: { [name: string]: number[] };
};
/** Get functions including grouping */
export declare function getFunctionGroups(): Record<string, string[]>;
/** Get functions */
export declare function getFunctions(): string[];
/** Set unstable period function */
export declare function setUnstablePeriod(
funcId: FuncUnstId,
period: number
): void;
/** Set compatibility function */
export declare function setCompatibility(value: Compatibility): void;
/** Get function infomation */
export declare function explain(funcName: string): FuncInfo;
/** Execute sync function */
export declare function execute(param: FuncParam): FuncResult;
/** Execute async function */
export declare function execute(
param: FuncParam,
callback: (error: Error | undefined, result: FuncResult) => void
): void;
/** Get TA-Lib version */
export declare function version(): string;