@tsukilabs/nil-ffi 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/def.d.ts +547 -0
- package/dist/error.d.ts +20 -0
- package/dist/{src/index.d.ts → index.d.ts} +8 -1
- package/dist/index.js +398 -330
- package/dist/queue.d.ts +29 -0
- package/dist/request.d.ts +5 -0
- package/package.json +21 -28
- package/dist/src/def.d.ts +0 -547
- package/dist/src/error.d.ts +0 -15
- package/dist/src/queue.d.ts +0 -17
- /package/dist/{src/ptr.d.ts → ptr.d.ts} +0 -0
package/dist/queue.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Handle } from '.';
|
|
2
|
+
import { Option } from '@tb-dev/utils';
|
|
3
|
+
import { ffi_RequestId } from '@tsukilabs/nil-bindings';
|
|
4
|
+
export declare class Queue implements Disposable {
|
|
5
|
+
private static readonly POLL_INTERVAL;
|
|
6
|
+
private static readonly LIMIT_PER_TICK;
|
|
7
|
+
private disposed;
|
|
8
|
+
private readonly functions;
|
|
9
|
+
private readonly emitter;
|
|
10
|
+
private readonly requestId;
|
|
11
|
+
private readonly pendingRequests;
|
|
12
|
+
private timer;
|
|
13
|
+
private readonly errorHandler;
|
|
14
|
+
constructor(handle: Handle, options?: QueueOptions);
|
|
15
|
+
[Symbol.dispose](): void;
|
|
16
|
+
request<T = unknown>(start: RequestFn): Promise<T>;
|
|
17
|
+
private drain;
|
|
18
|
+
private poll;
|
|
19
|
+
private dispatch;
|
|
20
|
+
private rejectAll;
|
|
21
|
+
private clearTimeout;
|
|
22
|
+
private onResponse;
|
|
23
|
+
}
|
|
24
|
+
type RequestFn = (requestId: ffi_RequestId) => void;
|
|
25
|
+
type ErrorHandler = (error: unknown) => void;
|
|
26
|
+
export interface QueueOptions {
|
|
27
|
+
onError?: Option<ErrorHandler>;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsukilabs/nil-ffi",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"packageManager": "pnpm@11.17.0",
|
|
5
6
|
"license": "AGPL-3.0-only",
|
|
6
7
|
"private": false,
|
|
7
8
|
"homepage": "https://nil.dev.br",
|
|
8
|
-
"contributors": [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"url": "https://github.com/danilofs18"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
9
|
+
"contributors": [{
|
|
10
|
+
"name": "Andrew Ferreira",
|
|
11
|
+
"email": "andrew.shien2@gmail.com",
|
|
12
|
+
"url": "https://tb.dev.br"
|
|
13
|
+
}, {
|
|
14
|
+
"name": "Danilo Soares",
|
|
15
|
+
"email": "danilofs18@gmail.com",
|
|
16
|
+
"url": "https://github.com/danilofs18"
|
|
17
|
+
}],
|
|
20
18
|
"repository": {
|
|
21
19
|
"type": "git",
|
|
22
20
|
"url": "https://github.com/tsukilabs/nil"
|
|
@@ -24,22 +22,17 @@
|
|
|
24
22
|
"bugs": {
|
|
25
23
|
"url": "https://github.com/tsukilabs/nil/issues"
|
|
26
24
|
},
|
|
27
|
-
"keywords": [
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
25
|
+
"keywords": ["call-of-nil", "ffi"],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "vite build",
|
|
28
|
+
"type-check": "tsc --noEmit"
|
|
29
|
+
},
|
|
31
30
|
"dependencies": {
|
|
32
31
|
"@tb-dev/utils": "^8.1.1",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
32
|
+
"@tsukilabs/nil-bindings": "workspace:*",
|
|
33
|
+
"es-toolkit": "^1.50.0"
|
|
35
34
|
},
|
|
36
|
-
"files": [
|
|
37
|
-
"dist"
|
|
38
|
-
],
|
|
35
|
+
"files": ["dist"],
|
|
39
36
|
"main": "./dist/index.js",
|
|
40
|
-
"types": "./dist/
|
|
41
|
-
|
|
42
|
-
"build": "vite build",
|
|
43
|
-
"type-check": "tsc --noEmit"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
37
|
+
"types": "./dist/index.d.ts"
|
|
38
|
+
}
|
package/dist/src/def.d.ts
DELETED
|
@@ -1,547 +0,0 @@
|
|
|
1
|
-
import * as ffi from "node:ffi";
|
|
2
|
-
export declare const definitions: {
|
|
3
|
-
readonly nil_ffi_free_str: {
|
|
4
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
5
|
-
readonly return: ffi.types.VOID;
|
|
6
|
-
};
|
|
7
|
-
readonly nil_ffi_poll: {
|
|
8
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
9
|
-
readonly return: ffi.types.INT_32;
|
|
10
|
-
};
|
|
11
|
-
readonly nil_ffi_shutdown: {
|
|
12
|
-
readonly arguments: readonly [];
|
|
13
|
-
readonly return: ffi.types.VOID;
|
|
14
|
-
};
|
|
15
|
-
readonly nil_ffi_version: {
|
|
16
|
-
readonly arguments: readonly [];
|
|
17
|
-
readonly return: ffi.types.UINT_32;
|
|
18
|
-
};
|
|
19
|
-
readonly nil_client_version: {
|
|
20
|
-
readonly arguments: readonly [];
|
|
21
|
-
readonly return: ffi.types.UINT_32;
|
|
22
|
-
};
|
|
23
|
-
readonly nil_is_local: {
|
|
24
|
-
readonly arguments: readonly [];
|
|
25
|
-
readonly return: ffi.types.UINT_32;
|
|
26
|
-
};
|
|
27
|
-
readonly nil_is_ready: {
|
|
28
|
-
readonly arguments: readonly [];
|
|
29
|
-
readonly return: ffi.types.UINT_32;
|
|
30
|
-
};
|
|
31
|
-
readonly nil_is_remote: {
|
|
32
|
-
readonly arguments: readonly [];
|
|
33
|
-
readonly return: ffi.types.UINT_32;
|
|
34
|
-
};
|
|
35
|
-
readonly nil_server_addr: {
|
|
36
|
-
readonly arguments: readonly [];
|
|
37
|
-
readonly return: ffi.types.UINT_32;
|
|
38
|
-
};
|
|
39
|
-
readonly nil_set_user_agent: {
|
|
40
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
41
|
-
readonly return: ffi.types.UINT_32;
|
|
42
|
-
};
|
|
43
|
-
readonly nil_stop_client: {
|
|
44
|
-
readonly arguments: readonly [];
|
|
45
|
-
readonly return: ffi.types.UINT_32;
|
|
46
|
-
};
|
|
47
|
-
readonly nil_update_client: {
|
|
48
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
49
|
-
readonly return: ffi.types.UINT_32;
|
|
50
|
-
};
|
|
51
|
-
readonly nil_user_agent: {
|
|
52
|
-
readonly arguments: readonly [];
|
|
53
|
-
readonly return: ffi.types.UINT_32;
|
|
54
|
-
};
|
|
55
|
-
readonly nil_world: {
|
|
56
|
-
readonly arguments: readonly [];
|
|
57
|
-
readonly return: ffi.types.UINT_32;
|
|
58
|
-
};
|
|
59
|
-
readonly nil_add_academy_recruit_order: {
|
|
60
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
61
|
-
readonly return: ffi.types.UINT_32;
|
|
62
|
-
};
|
|
63
|
-
readonly nil_add_prefecture_build_order: {
|
|
64
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
65
|
-
readonly return: ffi.types.UINT_32;
|
|
66
|
-
};
|
|
67
|
-
readonly nil_add_stable_recruit_order: {
|
|
68
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
69
|
-
readonly return: ffi.types.UINT_32;
|
|
70
|
-
};
|
|
71
|
-
readonly nil_add_workshop_recruit_order: {
|
|
72
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
73
|
-
readonly return: ffi.types.UINT_32;
|
|
74
|
-
};
|
|
75
|
-
readonly nil_authorize: {
|
|
76
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
77
|
-
readonly return: ffi.types.UINT_32;
|
|
78
|
-
};
|
|
79
|
-
readonly nil_cancel_academy_recruit_order: {
|
|
80
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
81
|
-
readonly return: ffi.types.UINT_32;
|
|
82
|
-
};
|
|
83
|
-
readonly nil_cancel_maneuver: {
|
|
84
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
85
|
-
readonly return: ffi.types.UINT_32;
|
|
86
|
-
};
|
|
87
|
-
readonly nil_cancel_prefecture_build_order: {
|
|
88
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
89
|
-
readonly return: ffi.types.UINT_32;
|
|
90
|
-
};
|
|
91
|
-
readonly nil_cancel_stable_recruit_order: {
|
|
92
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
93
|
-
readonly return: ffi.types.UINT_32;
|
|
94
|
-
};
|
|
95
|
-
readonly nil_cancel_workshop_recruit_order: {
|
|
96
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
97
|
-
readonly return: ffi.types.UINT_32;
|
|
98
|
-
};
|
|
99
|
-
readonly nil_cheat_fill_world: {
|
|
100
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
101
|
-
readonly return: ffi.types.UINT_32;
|
|
102
|
-
};
|
|
103
|
-
readonly nil_cheat_get_academy_recruit_queue: {
|
|
104
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
105
|
-
readonly return: ffi.types.UINT_32;
|
|
106
|
-
};
|
|
107
|
-
readonly nil_cheat_get_academy_recruit_queues: {
|
|
108
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
109
|
-
readonly return: ffi.types.UINT_32;
|
|
110
|
-
};
|
|
111
|
-
readonly nil_cheat_get_all_academy_recruit_queues: {
|
|
112
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
113
|
-
readonly return: ffi.types.UINT_32;
|
|
114
|
-
};
|
|
115
|
-
readonly nil_cheat_get_all_prefecture_build_queues: {
|
|
116
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
117
|
-
readonly return: ffi.types.UINT_32;
|
|
118
|
-
};
|
|
119
|
-
readonly nil_cheat_get_all_stable_recruit_queues: {
|
|
120
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
121
|
-
readonly return: ffi.types.UINT_32;
|
|
122
|
-
};
|
|
123
|
-
readonly nil_cheat_get_build_steps: {
|
|
124
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
125
|
-
readonly return: ffi.types.UINT_32;
|
|
126
|
-
};
|
|
127
|
-
readonly nil_cheat_get_cities: {
|
|
128
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
129
|
-
readonly return: ffi.types.UINT_32;
|
|
130
|
-
};
|
|
131
|
-
readonly nil_cheat_get_city: {
|
|
132
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
133
|
-
readonly return: ffi.types.UINT_32;
|
|
134
|
-
};
|
|
135
|
-
readonly nil_cheat_get_ethics: {
|
|
136
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
137
|
-
readonly return: ffi.types.UINT_32;
|
|
138
|
-
};
|
|
139
|
-
readonly nil_cheat_get_idle_armies_at: {
|
|
140
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
141
|
-
readonly return: ffi.types.UINT_32;
|
|
142
|
-
};
|
|
143
|
-
readonly nil_cheat_get_idle_personnel_at: {
|
|
144
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
145
|
-
readonly return: ffi.types.UINT_32;
|
|
146
|
-
};
|
|
147
|
-
readonly nil_cheat_get_infrastructure: {
|
|
148
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
149
|
-
readonly return: ffi.types.UINT_32;
|
|
150
|
-
};
|
|
151
|
-
readonly nil_cheat_get_maneuvers: {
|
|
152
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
153
|
-
readonly return: ffi.types.UINT_32;
|
|
154
|
-
};
|
|
155
|
-
readonly nil_cheat_get_maneuvers_of: {
|
|
156
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
157
|
-
readonly return: ffi.types.UINT_32;
|
|
158
|
-
};
|
|
159
|
-
readonly nil_cheat_get_player: {
|
|
160
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
161
|
-
readonly return: ffi.types.UINT_32;
|
|
162
|
-
};
|
|
163
|
-
readonly nil_cheat_get_players: {
|
|
164
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
165
|
-
readonly return: ffi.types.UINT_32;
|
|
166
|
-
};
|
|
167
|
-
readonly nil_cheat_get_prefecture_build_queue: {
|
|
168
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
169
|
-
readonly return: ffi.types.UINT_32;
|
|
170
|
-
};
|
|
171
|
-
readonly nil_cheat_get_prefecture_build_queues: {
|
|
172
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
173
|
-
readonly return: ffi.types.UINT_32;
|
|
174
|
-
};
|
|
175
|
-
readonly nil_cheat_get_resources: {
|
|
176
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
177
|
-
readonly return: ffi.types.UINT_32;
|
|
178
|
-
};
|
|
179
|
-
readonly nil_cheat_get_stable_recruit_queue: {
|
|
180
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
181
|
-
readonly return: ffi.types.UINT_32;
|
|
182
|
-
};
|
|
183
|
-
readonly nil_cheat_get_stable_recruit_queues: {
|
|
184
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
185
|
-
readonly return: ffi.types.UINT_32;
|
|
186
|
-
};
|
|
187
|
-
readonly nil_cheat_get_storage_capacity: {
|
|
188
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
189
|
-
readonly return: ffi.types.UINT_32;
|
|
190
|
-
};
|
|
191
|
-
readonly nil_cheat_set_bot_ethics: {
|
|
192
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
193
|
-
readonly return: ffi.types.UINT_32;
|
|
194
|
-
};
|
|
195
|
-
readonly nil_cheat_set_building_level: {
|
|
196
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
197
|
-
readonly return: ffi.types.UINT_32;
|
|
198
|
-
};
|
|
199
|
-
readonly nil_cheat_set_food: {
|
|
200
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
201
|
-
readonly return: ffi.types.UINT_32;
|
|
202
|
-
};
|
|
203
|
-
readonly nil_cheat_set_iron: {
|
|
204
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
205
|
-
readonly return: ffi.types.UINT_32;
|
|
206
|
-
};
|
|
207
|
-
readonly nil_cheat_set_max_food: {
|
|
208
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
209
|
-
readonly return: ffi.types.UINT_32;
|
|
210
|
-
};
|
|
211
|
-
readonly nil_cheat_set_max_infrastructure: {
|
|
212
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
213
|
-
readonly return: ffi.types.UINT_32;
|
|
214
|
-
};
|
|
215
|
-
readonly nil_cheat_set_max_iron: {
|
|
216
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
217
|
-
readonly return: ffi.types.UINT_32;
|
|
218
|
-
};
|
|
219
|
-
readonly nil_cheat_set_max_resources: {
|
|
220
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
221
|
-
readonly return: ffi.types.UINT_32;
|
|
222
|
-
};
|
|
223
|
-
readonly nil_cheat_set_max_silo_resources: {
|
|
224
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
225
|
-
readonly return: ffi.types.UINT_32;
|
|
226
|
-
};
|
|
227
|
-
readonly nil_cheat_set_max_stone: {
|
|
228
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
229
|
-
readonly return: ffi.types.UINT_32;
|
|
230
|
-
};
|
|
231
|
-
readonly nil_cheat_set_max_warehouse_resources: {
|
|
232
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
233
|
-
readonly return: ffi.types.UINT_32;
|
|
234
|
-
};
|
|
235
|
-
readonly nil_cheat_set_max_wood: {
|
|
236
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
237
|
-
readonly return: ffi.types.UINT_32;
|
|
238
|
-
};
|
|
239
|
-
readonly nil_cheat_set_resources: {
|
|
240
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
241
|
-
readonly return: ffi.types.UINT_32;
|
|
242
|
-
};
|
|
243
|
-
readonly nil_cheat_set_stability: {
|
|
244
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
245
|
-
readonly return: ffi.types.UINT_32;
|
|
246
|
-
};
|
|
247
|
-
readonly nil_cheat_set_stone: {
|
|
248
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
249
|
-
readonly return: ffi.types.UINT_32;
|
|
250
|
-
};
|
|
251
|
-
readonly nil_cheat_set_wood: {
|
|
252
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
253
|
-
readonly return: ffi.types.UINT_32;
|
|
254
|
-
};
|
|
255
|
-
readonly nil_cheat_skip_round: {
|
|
256
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
257
|
-
readonly return: ffi.types.UINT_32;
|
|
258
|
-
};
|
|
259
|
-
readonly nil_cheat_spawn_bot: {
|
|
260
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
261
|
-
readonly return: ffi.types.UINT_32;
|
|
262
|
-
};
|
|
263
|
-
readonly nil_cheat_spawn_city: {
|
|
264
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
265
|
-
readonly return: ffi.types.UINT_32;
|
|
266
|
-
};
|
|
267
|
-
readonly nil_cheat_spawn_personnel: {
|
|
268
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
269
|
-
readonly return: ffi.types.UINT_32;
|
|
270
|
-
};
|
|
271
|
-
readonly nil_create_remote_world: {
|
|
272
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
273
|
-
readonly return: ffi.types.UINT_32;
|
|
274
|
-
};
|
|
275
|
-
readonly nil_create_user: {
|
|
276
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
277
|
-
readonly return: ffi.types.UINT_32;
|
|
278
|
-
};
|
|
279
|
-
readonly nil_delete_remote_world: {
|
|
280
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
281
|
-
readonly return: ffi.types.UINT_32;
|
|
282
|
-
};
|
|
283
|
-
readonly nil_forward_report: {
|
|
284
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
285
|
-
readonly return: ffi.types.UINT_32;
|
|
286
|
-
};
|
|
287
|
-
readonly nil_get_academy_recruit_catalog: {
|
|
288
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
289
|
-
readonly return: ffi.types.UINT_32;
|
|
290
|
-
};
|
|
291
|
-
readonly nil_get_armies: {
|
|
292
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
293
|
-
readonly return: ffi.types.UINT_32;
|
|
294
|
-
};
|
|
295
|
-
readonly nil_get_army: {
|
|
296
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
297
|
-
readonly return: ffi.types.UINT_32;
|
|
298
|
-
};
|
|
299
|
-
readonly nil_get_army_owner: {
|
|
300
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
301
|
-
readonly return: ffi.types.UINT_32;
|
|
302
|
-
};
|
|
303
|
-
readonly nil_get_bot_coords: {
|
|
304
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
305
|
-
readonly return: ffi.types.UINT_32;
|
|
306
|
-
};
|
|
307
|
-
readonly nil_get_chat_history: {
|
|
308
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
309
|
-
readonly return: ffi.types.UINT_32;
|
|
310
|
-
};
|
|
311
|
-
readonly nil_get_cities: {
|
|
312
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
313
|
-
readonly return: ffi.types.UINT_32;
|
|
314
|
-
};
|
|
315
|
-
readonly nil_get_city: {
|
|
316
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
317
|
-
readonly return: ffi.types.UINT_32;
|
|
318
|
-
};
|
|
319
|
-
readonly nil_get_city_score: {
|
|
320
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
321
|
-
readonly return: ffi.types.UINT_32;
|
|
322
|
-
};
|
|
323
|
-
readonly nil_get_continent_size: {
|
|
324
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
325
|
-
readonly return: ffi.types.UINT_32;
|
|
326
|
-
};
|
|
327
|
-
readonly nil_get_idle_armies_at: {
|
|
328
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
329
|
-
readonly return: ffi.types.UINT_32;
|
|
330
|
-
};
|
|
331
|
-
readonly nil_get_idle_armies_coords: {
|
|
332
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
333
|
-
readonly return: ffi.types.UINT_32;
|
|
334
|
-
};
|
|
335
|
-
readonly nil_get_maneuver: {
|
|
336
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
337
|
-
readonly return: ffi.types.UINT_32;
|
|
338
|
-
};
|
|
339
|
-
readonly nil_get_player: {
|
|
340
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
341
|
-
readonly return: ffi.types.UINT_32;
|
|
342
|
-
};
|
|
343
|
-
readonly nil_get_player_coords: {
|
|
344
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
345
|
-
readonly return: ffi.types.UINT_32;
|
|
346
|
-
};
|
|
347
|
-
readonly nil_get_player_ids: {
|
|
348
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
349
|
-
readonly return: ffi.types.UINT_32;
|
|
350
|
-
};
|
|
351
|
-
readonly nil_get_player_maintenance: {
|
|
352
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
353
|
-
readonly return: ffi.types.UINT_32;
|
|
354
|
-
};
|
|
355
|
-
readonly nil_get_player_military: {
|
|
356
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
357
|
-
readonly return: ffi.types.UINT_32;
|
|
358
|
-
};
|
|
359
|
-
readonly nil_get_player_status: {
|
|
360
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
361
|
-
readonly return: ffi.types.UINT_32;
|
|
362
|
-
};
|
|
363
|
-
readonly nil_get_player_storage_capacity: {
|
|
364
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
365
|
-
readonly return: ffi.types.UINT_32;
|
|
366
|
-
};
|
|
367
|
-
readonly nil_get_player_worlds: {
|
|
368
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
369
|
-
readonly return: ffi.types.UINT_32;
|
|
370
|
-
};
|
|
371
|
-
readonly nil_get_precursor_coords: {
|
|
372
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
373
|
-
readonly return: ffi.types.UINT_32;
|
|
374
|
-
};
|
|
375
|
-
readonly nil_get_prefecture_build_catalog: {
|
|
376
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
377
|
-
readonly return: ffi.types.UINT_32;
|
|
378
|
-
};
|
|
379
|
-
readonly nil_get_public_bot: {
|
|
380
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
381
|
-
readonly return: ffi.types.UINT_32;
|
|
382
|
-
};
|
|
383
|
-
readonly nil_get_public_bots: {
|
|
384
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
385
|
-
readonly return: ffi.types.UINT_32;
|
|
386
|
-
};
|
|
387
|
-
readonly nil_get_public_cities: {
|
|
388
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
389
|
-
readonly return: ffi.types.UINT_32;
|
|
390
|
-
};
|
|
391
|
-
readonly nil_get_public_city: {
|
|
392
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
393
|
-
readonly return: ffi.types.UINT_32;
|
|
394
|
-
};
|
|
395
|
-
readonly nil_get_public_field: {
|
|
396
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
397
|
-
readonly return: ffi.types.UINT_32;
|
|
398
|
-
};
|
|
399
|
-
readonly nil_get_public_fields: {
|
|
400
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
401
|
-
readonly return: ffi.types.UINT_32;
|
|
402
|
-
};
|
|
403
|
-
readonly nil_get_public_player: {
|
|
404
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
405
|
-
readonly return: ffi.types.UINT_32;
|
|
406
|
-
};
|
|
407
|
-
readonly nil_get_public_players: {
|
|
408
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
409
|
-
readonly return: ffi.types.UINT_32;
|
|
410
|
-
};
|
|
411
|
-
readonly nil_get_public_precursor: {
|
|
412
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
413
|
-
readonly return: ffi.types.UINT_32;
|
|
414
|
-
};
|
|
415
|
-
readonly nil_get_public_precursors: {
|
|
416
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
417
|
-
readonly return: ffi.types.UINT_32;
|
|
418
|
-
};
|
|
419
|
-
readonly nil_get_rank: {
|
|
420
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
421
|
-
readonly return: ffi.types.UINT_32;
|
|
422
|
-
};
|
|
423
|
-
readonly nil_get_ranking: {
|
|
424
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
425
|
-
readonly return: ffi.types.UINT_32;
|
|
426
|
-
};
|
|
427
|
-
readonly nil_get_remote_world: {
|
|
428
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
429
|
-
readonly return: ffi.types.UINT_32;
|
|
430
|
-
};
|
|
431
|
-
readonly nil_get_remote_world_limit: {
|
|
432
|
-
readonly arguments: readonly [];
|
|
433
|
-
readonly return: ffi.types.UINT_32;
|
|
434
|
-
};
|
|
435
|
-
readonly nil_get_remote_world_limit_per_user: {
|
|
436
|
-
readonly arguments: readonly [];
|
|
437
|
-
readonly return: ffi.types.UINT_32;
|
|
438
|
-
};
|
|
439
|
-
readonly nil_get_remote_worlds: {
|
|
440
|
-
readonly arguments: readonly [];
|
|
441
|
-
readonly return: ffi.types.UINT_32;
|
|
442
|
-
};
|
|
443
|
-
readonly nil_get_round: {
|
|
444
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
445
|
-
readonly return: ffi.types.UINT_32;
|
|
446
|
-
};
|
|
447
|
-
readonly nil_get_server_kind: {
|
|
448
|
-
readonly arguments: readonly [];
|
|
449
|
-
readonly return: ffi.types.UINT_32;
|
|
450
|
-
};
|
|
451
|
-
readonly nil_get_stable_recruit_catalog: {
|
|
452
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
453
|
-
readonly return: ffi.types.UINT_32;
|
|
454
|
-
};
|
|
455
|
-
readonly nil_get_workshop_recruit_catalog: {
|
|
456
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
457
|
-
readonly return: ffi.types.UINT_32;
|
|
458
|
-
};
|
|
459
|
-
readonly nil_get_world_bots: {
|
|
460
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
461
|
-
readonly return: ffi.types.UINT_32;
|
|
462
|
-
};
|
|
463
|
-
readonly nil_get_world_config: {
|
|
464
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
465
|
-
readonly return: ffi.types.UINT_32;
|
|
466
|
-
};
|
|
467
|
-
readonly nil_get_world_personnel: {
|
|
468
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
469
|
-
readonly return: ffi.types.UINT_32;
|
|
470
|
-
};
|
|
471
|
-
readonly nil_get_world_players: {
|
|
472
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
473
|
-
readonly return: ffi.types.UINT_32;
|
|
474
|
-
};
|
|
475
|
-
readonly nil_get_world_precursors: {
|
|
476
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
477
|
-
readonly return: ffi.types.UINT_32;
|
|
478
|
-
};
|
|
479
|
-
readonly nil_get_world_stats: {
|
|
480
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
481
|
-
readonly return: ffi.types.UINT_32;
|
|
482
|
-
};
|
|
483
|
-
readonly nil_player_exists: {
|
|
484
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
485
|
-
readonly return: ffi.types.UINT_32;
|
|
486
|
-
};
|
|
487
|
-
readonly nil_push_chat_message: {
|
|
488
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
489
|
-
readonly return: ffi.types.UINT_32;
|
|
490
|
-
};
|
|
491
|
-
readonly nil_rename_city: {
|
|
492
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
493
|
-
readonly return: ffi.types.UINT_32;
|
|
494
|
-
};
|
|
495
|
-
readonly nil_request_maneuver: {
|
|
496
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
497
|
-
readonly return: ffi.types.UINT_32;
|
|
498
|
-
};
|
|
499
|
-
readonly nil_save_local_world: {
|
|
500
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
501
|
-
readonly return: ffi.types.UINT_32;
|
|
502
|
-
};
|
|
503
|
-
readonly nil_search_city: {
|
|
504
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
505
|
-
readonly return: ffi.types.UINT_32;
|
|
506
|
-
};
|
|
507
|
-
readonly nil_search_public_city: {
|
|
508
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
509
|
-
readonly return: ffi.types.UINT_32;
|
|
510
|
-
};
|
|
511
|
-
readonly nil_server_version: {
|
|
512
|
-
readonly arguments: readonly [];
|
|
513
|
-
readonly return: ffi.types.UINT_32;
|
|
514
|
-
};
|
|
515
|
-
readonly nil_set_player_ready: {
|
|
516
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
517
|
-
readonly return: ffi.types.UINT_32;
|
|
518
|
-
};
|
|
519
|
-
readonly nil_set_player_status: {
|
|
520
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
521
|
-
readonly return: ffi.types.UINT_32;
|
|
522
|
-
};
|
|
523
|
-
readonly nil_simulate_battle: {
|
|
524
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
525
|
-
readonly return: ffi.types.UINT_32;
|
|
526
|
-
};
|
|
527
|
-
readonly nil_spawn_player: {
|
|
528
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
529
|
-
readonly return: ffi.types.UINT_32;
|
|
530
|
-
};
|
|
531
|
-
readonly nil_start_round: {
|
|
532
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
533
|
-
readonly return: ffi.types.UINT_32;
|
|
534
|
-
};
|
|
535
|
-
readonly nil_toggle_building: {
|
|
536
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
537
|
-
readonly return: ffi.types.UINT_32;
|
|
538
|
-
};
|
|
539
|
-
readonly nil_user_exists: {
|
|
540
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
541
|
-
readonly return: ffi.types.UINT_32;
|
|
542
|
-
};
|
|
543
|
-
readonly nil_validate_token: {
|
|
544
|
-
readonly arguments: readonly [ffi.types.POINTER];
|
|
545
|
-
readonly return: ffi.types.UINT_32;
|
|
546
|
-
};
|
|
547
|
-
};
|
package/dist/src/error.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Option } from '@tb-dev/utils';
|
|
2
|
-
import { ffi_Status } from '@tsukilabs/nil-bindings';
|
|
3
|
-
export interface FfiErrorOptions extends ErrorOptions {
|
|
4
|
-
readonly status?: Option<ffi_Status>;
|
|
5
|
-
}
|
|
6
|
-
export declare class FfiError extends Error {
|
|
7
|
-
readonly name = "FfiError";
|
|
8
|
-
readonly status: ffi_Status;
|
|
9
|
-
constructor(message: Option<string>, options?: FfiErrorOptions);
|
|
10
|
-
static fromStatus(status: ffi_Status): FfiError;
|
|
11
|
-
}
|
|
12
|
-
export declare class HandleClosedError extends Error {
|
|
13
|
-
readonly name = "HandleClosedError";
|
|
14
|
-
constructor(options?: ErrorOptions);
|
|
15
|
-
}
|
package/dist/src/queue.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Handle } from '.';
|
|
2
|
-
import { ffi_RequestId } from '@tsukilabs/nil-bindings';
|
|
3
|
-
export declare class Queue implements Disposable {
|
|
4
|
-
private static readonly POLL_INTERVAL;
|
|
5
|
-
private static readonly LIMIT_PER_TICK;
|
|
6
|
-
readonly functions: Handle["functions"];
|
|
7
|
-
private timer;
|
|
8
|
-
private readonly pending;
|
|
9
|
-
private disposed;
|
|
10
|
-
constructor(handle: Handle);
|
|
11
|
-
[Symbol.dispose](): void;
|
|
12
|
-
request<T = unknown>(start: () => ffi_RequestId): Promise<T>;
|
|
13
|
-
private startPolling;
|
|
14
|
-
private poll;
|
|
15
|
-
private pollOnce;
|
|
16
|
-
private rejectAll;
|
|
17
|
-
}
|
|
File without changes
|