-
Notifications
You must be signed in to change notification settings - Fork 0
/
playground_wasm_tsify.d.ts
214 lines (200 loc) · 5.78 KB
/
playground_wasm_tsify.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
/* tslint:disable */
/* eslint-disable */
/**
* Given a Vec<u32> vector, return its length.
* In TS, the Rust `Vec<u32>` is typed as `Uint32Array`.
* @param {number | undefined} x
* @returns {number}
*/
export function inc_or_fail(x?: number): number;
/**
* Given a `Provider` C-style enum instance, return its human-friendly label.
* @param {Provider} provider
* @returns {string}
*/
export function enum_to_string(provider: Provider): string;
/**
* Given a `Provider` enum label, construct its relative `Provider` C-style enum instance.
* @param {string} label
* @returns {Provider}
*/
export function enum_from_string(label: string): Provider;
/**
* Given an `Either` ADT enum instance, return its human-friendly label.
* @param {Either} either
* @returns {string}
*/
export function either_to_string(either: Either): string;
/**
* Given an `Either` "ok" branch, construct its relative `Either` ADT enum instance.
* @param {number} ok
* @returns {Either}
*/
export function either_from_ok(ok: number): Either;
/**
* Given an `Either` "err" branch, construct its relative `Either` ADT enum instance.
* @param {string} err
* @returns {Either}
*/
export function either_from_err(err: string): Either;
/**
* Given an unsigned 64-bit number, return the number multiplied by two.
* In TS, the Rust `u64` is typed as `bigint`.
* @param {bigint} x
* @returns {bigint}
*/
export function duplicate_biguint(x: bigint): bigint;
/**
* Given a signed 64-bit number, return the number multiplied by two.
* In TS, the Rust `i64` is typed as `bigint`.
* @param {bigint} x
* @returns {bigint}
*/
export function duplicate_bigint(x: bigint): bigint;
/**
* Given an unsigned 32-bit number, return the number multiplied by two.
* In TS, the Rust `u32` is typed as `bigint`.
* @param {number} x
* @returns {number}
*/
export function duplicate_uint(x: number): number;
/**
* Given a signed 32-bit number, return the number multiplied by two.
* In TS, the Rust `i32` is typed as `bigint`.
* @param {number} x
* @returns {number}
*/
export function duplicate_int(x: number): number;
/**
* Given a double number, return the number multiplied by two.
* In TS, the Rust `f64` is typed as `number`.
* @param {number} x
* @returns {number}
*/
export function duplicate_f64(x: number): number;
/**
* Given a float number, return the number multiplied by two.
* In TS, the Rust `f32` is typed as `number`.
* @param {number} x
* @returns {number}
*/
export function duplicate_f32(x: number): number;
/**
* Given a `Scalars` instance, return its `letter` member.
* In TS, the Rust `char` is typed as `string`, and every character after the first one is truncated.
* @param {Scalars} params
* @returns {string}
*/
export function get_letter(params: Scalars): string;
/**
* Given a `Scalars` instance, return the number of its members.
* @param {Scalars} params
* @returns {number}
*/
export function get_key_length(params: Scalars): number;
/**
* Given a `Scalars` instance, return the labels of its keys.
* @param {Scalars} _params
* @returns {VecData}
*/
export function get_keys(_params: Scalars): VecData;
/**
* Given an `OptionalParams` instance, return its `int32` member incremented by 1, or None.
* In TS, the Rust `char` is typed as `string`, and every character after the first one is truncated.
* @param {number | undefined} x
* @returns {number | undefined}
*/
export function maybe_inc(x?: number): number | undefined;
/**
* Given a Vec<u32> vector, return its length.
* In TS, the Rust `Vec<u32>` is typed as `Uint32Array`.
* @param {Uint32Array} x
* @returns {number}
*/
export function get_u32_array_length(x: Uint32Array): number;
/**
* Given a Vec<i32> vector, return its length.
* In TS, the Rust `Vec<i32>` is typed as `Int32Array`.
* @param {Int32Array} x
* @returns {number}
*/
export function get_i32_array_length(x: Int32Array): number;
/**
* Given a wrapper over a Vec<Vec<i32>> vector, return its length.
* @param {MatrixDataI32} x
* @returns {number}
*/
export function get_nested_array_length(x: MatrixDataI32): number;
/**
* Given a wrapper over a Vec<String> vector, return its length.
* @param {VecString} x
* @returns {number}
*/
export function get_string_array_length(x: VecString): number;
/**
* Given a wrapped BTreeMap<i32, i32>, return its keys separated by a comma.
* @param {I32TreeMap} x
* @returns {string}
*/
export function object_keys_as_string(x: I32TreeMap): string;
/**
* Given a string, return its length.
* In TS, the Rust `String` is typed as `string`.
* @param {string} x
* @returns {number}
*/
export function get_string_length(x: string): number;
/**
* Given a string, return its length.
* In TS, the Rust `String` is typed as `string`.
* @param {StringParams} x
* @returns {number}
*/
export function get_string_length_from_params(x: StringParams): number;
/**
* Given a string, return the same string in uppercase.
* In TS, the Rust `String` is typed as `string`.
* @param {string} x
* @returns {string}
*/
export function to_uppercase(x: string): string;
export type Provider = "postgres" | "mysql" | "sqlite";
export interface OptionalParams {
int32: number | undefined;
}
export type MatrixDataI32 = MatrixData<number>;
export interface MatrixData<T> {
data: T[][];
}
export type VecBool = VecData<boolean>;
export type VecString = VecData<string>;
export interface VecData<T> {
data: T[];
}
export interface NumericArrays {
int32: number[];
uint32: number[];
uint64: number[];
int64: number[];
float: number[];
double: number[];
}
export interface StringParams {
id: string;
}
export interface Scalars {
n: number;
id: number;
letter: string;
toggle: boolean;
}
export interface VecString {
data: string[];
}
export interface MatrixDataI32 {
data: number[][];
}
export type Either = { _tag: "ok"; value: number } | { _tag: "err"; value: string };
export interface I32TreeMap {
data: Map<number, number>;
}