@napi-rs/cli 3.0.0-alpha.1 → 3.0.0-alpha.100

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.
Files changed (176) hide show
  1. package/cli.mjs +1 -1
  2. package/dist/api/__tests__/create-npm-dirs.spec.d.ts +1 -0
  3. package/dist/api/__tests__/new.spec.d.ts +1 -0
  4. package/dist/api/build.d.ts +2 -2
  5. package/dist/api/create-npm-dirs.d.ts +5 -0
  6. package/dist/api/templates/index.d.ts +0 -7
  7. package/dist/api/templates/js-binding.d.ts +2 -1
  8. package/dist/api/templates/load-wasi-template.d.ts +2 -0
  9. package/dist/api/templates/wasi-worker-template.d.ts +2 -0
  10. package/dist/cli.js +3961 -14
  11. package/dist/def/artifacts.d.ts +21 -1
  12. package/dist/def/build.d.ts +167 -4
  13. package/dist/def/create-npm-dirs.d.ts +10 -0
  14. package/dist/def/new.d.ts +25 -7
  15. package/dist/def/pre-publish.d.ts +21 -2
  16. package/dist/def/rename.d.ts +16 -6
  17. package/dist/def/universalize.d.ts +10 -0
  18. package/dist/def/version.d.ts +10 -0
  19. package/dist/index.cjs +10142 -20524
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +3711 -29
  22. package/dist/utils/__tests__/config.spec.d.ts +1 -0
  23. package/dist/utils/config.d.ts +70 -6
  24. package/dist/utils/index.d.ts +1 -1
  25. package/dist/utils/metadata.d.ts +13 -1
  26. package/dist/utils/misc.d.ts +3 -3
  27. package/dist/utils/read-config.d.ts +7 -0
  28. package/dist/utils/target.d.ts +9 -6
  29. package/dist/utils/typegen.d.ts +4 -1
  30. package/dist/utils/version.d.ts +2 -1
  31. package/package.json +60 -24
  32. package/src/api/__tests__/create-npm-dirs.spec.ts +210 -0
  33. package/src/api/__tests__/new.spec.ts +429 -0
  34. package/src/api/artifacts.ts +83 -8
  35. package/src/api/build.ts +682 -134
  36. package/src/api/create-npm-dirs.ts +64 -13
  37. package/src/api/new.ts +389 -125
  38. package/src/api/pre-publish.ts +27 -16
  39. package/src/api/rename.ts +103 -17
  40. package/src/api/templates/index.ts +0 -7
  41. package/src/api/templates/js-binding.ts +212 -107
  42. package/src/api/templates/load-wasi-template.ts +216 -0
  43. package/src/api/templates/wasi-worker-template.ts +122 -0
  44. package/src/api/universalize.ts +13 -8
  45. package/src/api/version.ts +5 -2
  46. package/src/commands/artifacts.ts +2 -2
  47. package/src/commands/build.ts +1 -1
  48. package/src/commands/new.ts +46 -49
  49. package/src/def/artifacts.ts +22 -3
  50. package/src/def/build.ts +83 -8
  51. package/src/def/create-npm-dirs.ts +9 -0
  52. package/src/def/new.ts +28 -3
  53. package/src/def/pre-publish.ts +24 -3
  54. package/src/def/rename.ts +11 -2
  55. package/src/def/universalize.ts +9 -0
  56. package/src/def/version.ts +9 -0
  57. package/src/index.ts +2 -0
  58. package/src/utils/__tests__/__fixtures__/napi_type_def +130 -130
  59. package/src/utils/__tests__/__snapshots__/config.spec.ts.md +97 -0
  60. package/src/utils/__tests__/__snapshots__/config.spec.ts.snap +0 -0
  61. package/src/utils/__tests__/__snapshots__/target.spec.ts.md +56 -0
  62. package/src/utils/__tests__/__snapshots__/target.spec.ts.snap +0 -0
  63. package/src/utils/__tests__/__snapshots__/typegen.spec.ts.md +703 -164
  64. package/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap +0 -0
  65. package/src/utils/__tests__/__snapshots__/version.spec.ts.md +9 -8
  66. package/src/utils/__tests__/__snapshots__/version.spec.ts.snap +0 -0
  67. package/src/utils/__tests__/config.spec.ts +81 -0
  68. package/src/utils/__tests__/typegen.spec.ts +19 -4
  69. package/src/utils/cargo.ts +2 -2
  70. package/src/utils/config.ts +147 -13
  71. package/src/utils/index.ts +1 -1
  72. package/src/utils/log.ts +1 -1
  73. package/src/utils/metadata.ts +52 -14
  74. package/src/utils/misc.ts +21 -7
  75. package/src/utils/read-config.ts +20 -0
  76. package/src/utils/target.ts +53 -9
  77. package/src/utils/typegen.ts +100 -40
  78. package/src/utils/version.ts +11 -9
  79. package/dist/api/artifacts.js +0 -50
  80. package/dist/api/build.js +0 -404
  81. package/dist/api/create-npm-dirs.js +0 -63
  82. package/dist/api/new.js +0 -154
  83. package/dist/api/pre-publish.js +0 -157
  84. package/dist/api/rename.js +0 -28
  85. package/dist/api/templates/.gitignore.d.ts +0 -1
  86. package/dist/api/templates/.gitignore.js +0 -198
  87. package/dist/api/templates/.npmignore.d.ts +0 -1
  88. package/dist/api/templates/.npmignore.js +0 -14
  89. package/dist/api/templates/build.rs.d.ts +0 -1
  90. package/dist/api/templates/build.rs.js +0 -4
  91. package/dist/api/templates/cargo.toml.d.ts +0 -6
  92. package/dist/api/templates/cargo.toml.js +0 -25
  93. package/dist/api/templates/ci-template.d.ts +0 -1
  94. package/dist/api/templates/ci-template.js +0 -566
  95. package/dist/api/templates/ci.yml.d.ts +0 -1
  96. package/dist/api/templates/ci.yml.js +0 -92
  97. package/dist/api/templates/index.js +0 -8
  98. package/dist/api/templates/js-binding.js +0 -124
  99. package/dist/api/templates/lib.rs.d.ts +0 -1
  100. package/dist/api/templates/lib.rs.js +0 -10
  101. package/dist/api/templates/package.json.d.ts +0 -8
  102. package/dist/api/templates/package.json.js +0 -30
  103. package/dist/api/universalize.js +0 -38
  104. package/dist/api/version.js +0 -16
  105. package/dist/commands/artifacts.js +0 -19
  106. package/dist/commands/build.js +0 -34
  107. package/dist/commands/create-npm-dirs.js +0 -7
  108. package/dist/commands/help.js +0 -12
  109. package/dist/commands/new.js +0 -112
  110. package/dist/commands/pre-publish.js +0 -8
  111. package/dist/commands/rename.js +0 -7
  112. package/dist/commands/universalize.js +0 -7
  113. package/dist/commands/version.js +0 -7
  114. package/dist/def/artifacts.js +0 -38
  115. package/dist/def/build.js +0 -105
  116. package/dist/def/commands/artifacts.d.ts +0 -15
  117. package/dist/def/commands/artifacts.js +0 -29
  118. package/dist/def/commands/build.d.ts +0 -53
  119. package/dist/def/commands/build.js +0 -105
  120. package/dist/def/commands/create-npm-dirs.d.ts +0 -15
  121. package/dist/def/commands/create-npm-dirs.js +0 -29
  122. package/dist/def/commands/new.d.ts +0 -27
  123. package/dist/def/commands/new.js +0 -53
  124. package/dist/def/commands/pre-publish.d.ts +0 -23
  125. package/dist/def/commands/pre-publish.js +0 -45
  126. package/dist/def/commands/rename.d.ts +0 -25
  127. package/dist/def/commands/rename.js +0 -49
  128. package/dist/def/commands/universalize.d.ts +0 -13
  129. package/dist/def/commands/universalize.js +0 -25
  130. package/dist/def/commands/version.d.ts +0 -13
  131. package/dist/def/commands/version.js +0 -25
  132. package/dist/def/create-npm-dirs.js +0 -38
  133. package/dist/def/new.js +0 -66
  134. package/dist/def/options/artifacts.d.ts +0 -35
  135. package/dist/def/options/artifacts.js +0 -11
  136. package/dist/def/options/build.d.ts +0 -97
  137. package/dist/def/options/build.js +0 -3
  138. package/dist/def/options/create-npm-dirs.d.ts +0 -35
  139. package/dist/def/options/create-npm-dirs.js +0 -11
  140. package/dist/def/options/new.d.ts +0 -79
  141. package/dist/def/options/new.js +0 -15
  142. package/dist/def/options/pre-publish.d.ts +0 -65
  143. package/dist/def/options/pre-publish.js +0 -13
  144. package/dist/def/options/rename.d.ts +0 -75
  145. package/dist/def/options/rename.js +0 -11
  146. package/dist/def/options/universalize.d.ts +0 -28
  147. package/dist/def/options/universalize.js +0 -10
  148. package/dist/def/options/version.d.ts +0 -28
  149. package/dist/def/options/version.js +0 -10
  150. package/dist/def/pre-publish.js +0 -56
  151. package/dist/def/rename.js +0 -58
  152. package/dist/def/universalize.js +0 -33
  153. package/dist/def/version.js +0 -33
  154. package/dist/utils/__tests__/target.spec.js +0 -10
  155. package/dist/utils/__tests__/typegen.spec.js +0 -37
  156. package/dist/utils/__tests__/version.spec.js +0 -5
  157. package/dist/utils/cargo.js +0 -33
  158. package/dist/utils/ci.d.ts +0 -11
  159. package/dist/utils/ci.js +0 -86
  160. package/dist/utils/config.js +0 -42
  161. package/dist/utils/index.js +0 -9
  162. package/dist/utils/log.js +0 -14
  163. package/dist/utils/metadata.js +0 -19
  164. package/dist/utils/misc.js +0 -35
  165. package/dist/utils/target.js +0 -109
  166. package/dist/utils/typegen.js +0 -158
  167. package/dist/utils/version.js +0 -59
  168. package/src/api/templates/.gitignore.ts +0 -198
  169. package/src/api/templates/.npmignore.ts +0 -14
  170. package/src/api/templates/build.rs.ts +0 -4
  171. package/src/api/templates/cargo.toml.ts +0 -35
  172. package/src/api/templates/ci-template.ts +0 -566
  173. package/src/api/templates/ci.yml.ts +0 -116
  174. package/src/api/templates/lib.rs.ts +0 -10
  175. package/src/api/templates/package.json.ts +0 -44
  176. package/src/utils/ci.ts +0 -102
@@ -66,19 +66,559 @@ Generated by [AVA](https://avajs.dev).
66
66
 
67
67
  > Snapshot 1
68
68
 
69
- `␊
70
- export class ExternalObject<T> {␊
71
- readonly '': {␊
72
- readonly '': unique symbol␊
73
- [K: symbol]: T␊
69
+ `/**␊
70
+ * \`constructor\` option for \`struct\` requires all fields to be public,␊
71
+ * otherwise tag impl fn as constructor␊
72
+ * #[napi(constructor)]␊
73
+ */␊
74
+ export declare class Animal {␊
75
+ /** Kind of animal */␊
76
+ readonly kind: Kind␊
77
+ /** This is the constructor */␊
78
+ constructor(kind: Kind, name: string)␊
79
+ /** This is a factory method */␊
80
+ static withKind(kind: Kind): Animal␊
81
+ get name(): string␊
82
+ set name(name: string)␊
83
+ get type(): Kind␊
84
+ set type(kind: Kind)␊
85
+ /**␊
86
+ * This is a␊
87
+ * multi-line comment␊
88
+ * with an emoji 🚀␊
89
+ */␊
90
+ whoami(): string␊
91
+ /** This is static... */␊
92
+ static getDogKind(): Kind␊
93
+ /**␊
94
+ * Here are some characters and character sequences␊
95
+ * that should be escaped correctly:␊
96
+ * \\[]{}/\\:""{␊
97
+ * }␊
98
+ */␊
99
+ returnOtherClass(): Dog␊
100
+ returnOtherClassWithCustomConstructor(): Bird␊
101
+ overrideIndividualArgOnMethod(normalTy: string, overriddenTy: {n: string}): Bird␊
102
+ }␊
103
+ ␊
104
+ export declare class AnimalWithDefaultConstructor {␊
105
+ name: string␊
106
+ kind: number␊
107
+ constructor(name: string, kind: number)␊
108
+ }␊
109
+ ␊
110
+ export declare class AnotherClassForEither {␊
111
+ constructor()␊
112
+ }␊
113
+ ␊
114
+ export declare class AnotherCssStyleSheet {␊
115
+ get rules(): CssRuleList␊
116
+ }␊
117
+ export type AnotherCSSStyleSheet = AnotherCssStyleSheet␊
118
+ ␊
119
+ export declare class Asset {␊
120
+ constructor()␊
121
+ get filePath(): number␊
122
+ }␊
123
+ export type JsAsset = Asset␊
124
+ ␊
125
+ export declare class Assets {␊
126
+ constructor()␊
127
+ get(id: number): JsAsset | null␊
128
+ }␊
129
+ export type JsAssets = Assets␊
130
+ ␊
131
+ export declare class Bird {␊
132
+ name: string␊
133
+ constructor(name: string)␊
134
+ getCount(): number␊
135
+ getNameAsync(): Promise<string>␊
136
+ }␊
137
+ ␊
138
+ /** Smoking test for type generation */␊
139
+ export declare class Blake2BHasher {␊
140
+ static withKey(key: Blake2bKey): Blake2BHasher␊
141
+ update(data: Buffer): void␊
142
+ }␊
143
+ export type Blake2bHasher = Blake2BHasher␊
144
+ ␊
145
+ export declare class Blake2BKey {␊
146
+ ␊
147
+ }␊
148
+ export type Blake2bKey = Blake2BKey␊
149
+ ␊
150
+ export declare class ClassWithFactory {␊
151
+ name: string␊
152
+ static withName(name: string): ClassWithFactory␊
153
+ setName(name: string): this␊
154
+ }␊
155
+ ␊
156
+ export declare class Context {␊
157
+ maybeNeed?: boolean␊
158
+ buffer: Uint8Array␊
159
+ constructor()␊
160
+ static withData(data: string): Context␊
161
+ static withBuffer(buf: Uint8Array): Context␊
162
+ method(): string␊
163
+ }␊
164
+ ␊
165
+ export declare class CssRuleList {␊
166
+ getRules(): Array<string>␊
167
+ get parentStyleSheet(): CSSStyleSheet␊
168
+ get name(): string | null␊
169
+ }␊
170
+ export type CSSRuleList = CssRuleList␊
171
+ ␊
172
+ export declare class CssStyleSheet {␊
173
+ constructor(name: string, rules: Array<string>)␊
174
+ get rules(): CssRuleList␊
175
+ anotherCssStyleSheet(): AnotherCssStyleSheet␊
176
+ }␊
177
+ export type CSSStyleSheet = CssStyleSheet␊
178
+ ␊
179
+ export declare class CustomFinalize {␊
180
+ constructor(width: number, height: number)␊
181
+ }␊
182
+ ␊
183
+ export declare class Dog {␊
184
+ name: string␊
185
+ constructor(name: string)␊
186
+ }␊
187
+ ␊
188
+ export declare class Fib {␊
189
+ [Symbol.iterator](): Iterator<number, void, number>␊
190
+ constructor()␊
191
+ }␊
192
+ ␊
193
+ export declare class Fib2 {␊
194
+ [Symbol.iterator](): Iterator<number, void, number>␊
195
+ static create(seed: number): Fib2␊
196
+ }␊
197
+ ␊
198
+ export declare class Fib3 {␊
199
+ current: number␊
200
+ next: number␊
201
+ constructor(current: number, next: number)␊
202
+ [Symbol.iterator](): Iterator<number, void, number>␊
203
+ }␊
204
+ ␊
205
+ export declare class JsClassForEither {␊
206
+ constructor()␊
207
+ }␊
208
+ ␊
209
+ export declare class JsRemote {␊
210
+ name(): string␊
211
+ }␊
212
+ ␊
213
+ export declare class JsRepo {␊
214
+ constructor(dir: string)␊
215
+ remote(): JsRemote␊
216
+ }␊
217
+ ␊
218
+ export declare class NinjaTurtle {␊
219
+ name: string␊
220
+ static isInstanceOf(value: unknown): boolean␊
221
+ /** Create your ninja turtle! 🐢 */␊
222
+ static newRaph(): NinjaTurtle␊
223
+ getMaskColor(): string␊
224
+ getName(): string␊
225
+ returnThis(this: this): this␊
226
+ }␊
227
+ ␊
228
+ export declare class NotWritableClass {␊
229
+ name: string␊
230
+ constructor(name: string)␊
231
+ setName(name: string): void␊
232
+ }␊
233
+ ␊
234
+ export declare class Optional {␊
235
+ static optionEnd(required: string, optional?: string | undefined | null): string␊
236
+ static optionStart(optional: string | undefined | null, required: string): string␊
237
+ static optionStartEnd(optional1: string | undefined | null, required: string, optional2?: string | undefined | null): string␊
238
+ static optionOnly(optional?: string | undefined | null): string␊
239
+ }␊
240
+ ␊
241
+ export declare class Width {␊
242
+ value: number␊
243
+ constructor(value: number)␊
244
+ }␊
245
+ ␊
246
+ export interface A {␊
247
+ foo: number␊
248
+ }␊
249
+ ␊
250
+ export declare function acceptThreadsafeFunction(func: (err: Error | null, value: number) => any): void␊
251
+ ␊
252
+ export declare function acceptThreadsafeFunctionFatal(func: (value: number) => any): void␊
253
+ ␊
254
+ export declare function acceptThreadsafeFunctionTupleArgs(func: (err: Error | null, arg0: number, arg1: boolean, arg2: string) => any): void␊
255
+ ␊
256
+ export declare function add(a: number, b: number): number␊
257
+ ␊
258
+ export declare const enum ALIAS {␊
259
+ A = 0,␊
260
+ B = 1␊
261
+ }␊
262
+ ␊
263
+ export interface AliasedStruct {␊
264
+ a: ALIAS␊
265
+ b: number␊
266
+ }␊
267
+ ␊
268
+ export interface AllOptionalObject {␊
269
+ name?: string␊
270
+ age?: number␊
271
+ }␊
272
+ ␊
273
+ export declare function appendBuffer(buf: Buffer): Buffer␊
274
+ ␊
275
+ export declare function arrayBufferPassThrough(buf: Uint8Array): Promise<Uint8Array>␊
276
+ ␊
277
+ export declare function asyncMultiTwo(arg: number): Promise<number>␊
278
+ ␊
279
+ export declare function asyncPlus100(p: Promise<number>): Promise<number>␊
280
+ ␊
281
+ export declare function asyncReduceBuffer(buf: Buffer): Promise<number>␊
282
+ ␊
283
+ export interface B {␊
284
+ bar: number␊
285
+ }␊
286
+ ␊
287
+ export declare function bigintAdd(a: bigint, b: bigint): bigint␊
288
+ ␊
289
+ export declare function bigintFromI128(): bigint␊
290
+ ␊
291
+ export declare function bigintFromI64(): bigint␊
292
+ ␊
293
+ export declare function bigintGetU64AsString(bi: bigint): string␊
294
+ ␊
295
+ export declare function bufferPassThrough(buf: Buffer): Promise<Buffer>␊
296
+ ␊
297
+ export interface C {␊
298
+ baz: number␊
299
+ }␊
300
+ ␊
301
+ export declare function callbackReturnPromise<T>(functionInput: () => T | Promise<T>, callback: (err: Error | null, result: T) => void): T | Promise<T>␊
302
+ ␊
303
+ export declare function callThreadsafeFunction(callback: (...args: any[]) => any): void␊
304
+ ␊
305
+ export declare function captureErrorInCallback(cb1: () => void, cb2: (arg0: Error) => void): void␊
306
+ ␊
307
+ export declare function chronoDateAdd1Minute(input: Date): Date␊
308
+ ␊
309
+ export declare function chronoDateToMillis(input: Date): number␊
310
+ ␊
311
+ export declare function concatLatin1(s: string): string␊
312
+ ␊
313
+ export declare function concatStr(s: string): string␊
314
+ ␊
315
+ export declare function concatUtf16(s: string): string␊
316
+ ␊
317
+ export declare function contains(source: string, target: string): boolean␊
318
+ ␊
319
+ export declare function convertU32Array(input: Uint32Array): Array<number>␊
320
+ ␊
321
+ export declare function createBigInt(): bigint␊
322
+ ␊
323
+ export declare function createBigIntI64(): bigint␊
324
+ ␊
325
+ export declare function createExternal(size: number): ExternalObject<number>␊
326
+ ␊
327
+ export declare function createExternalString(content: string): ExternalObject<string>␊
328
+ ␊
329
+ export declare function createExternalTypedArray(): Uint32Array␊
330
+ ␊
331
+ export declare function createObj(): object␊
332
+ ␊
333
+ export declare function createObjectWithClassField(): ObjectFieldClassInstance␊
334
+ ␊
335
+ export declare function createObjWithProperty(): { value: ArrayBuffer, get getter(): number }␊
336
+ ␊
337
+ export declare function createSymbol(): symbol␊
338
+ ␊
339
+ /** You could break the step and for an new continuous value. */␊
340
+ export declare const enum CustomNumEnum {␊
341
+ One = 1,␊
342
+ Two = 2,␊
343
+ Three = 3,␊
344
+ Four = 4,␊
345
+ Six = 6,␊
346
+ Eight = 8,␊
347
+ Nine = 9,␊
348
+ Ten = 10␊
349
+ }␊
350
+ ␊
351
+ export declare function customStatusCode(): void␊
352
+ ␊
353
+ export interface Dates {␊
354
+ start: Date␊
355
+ end?: Date␊
356
+ }␊
357
+ ␊
358
+ export declare function dateToNumber(input: Date): number␊
359
+ ␊
360
+ /** This is a const */␊
361
+ export const DEFAULT_COST: number␊
362
+ ␊
363
+ export declare function derefUint8Array(a: Uint8Array, b: Uint8ClampedArray): number␊
364
+ ␊
365
+ export declare function either3(input: string | number | boolean): number␊
366
+ ␊
367
+ export declare function either4(input: string | number | boolean | Obj): number␊
368
+ ␊
369
+ export declare function eitherBoolOrFunction(input: boolean | ((...args: any[]) => any)): void␊
370
+ ␊
371
+ export declare function eitherFromObjects(input: A | B | C): string␊
372
+ ␊
373
+ export declare function eitherFromOption(): JsClassForEither | undefined␊
374
+ ␊
375
+ export declare function eitherStringOrNumber(input: string | number): number␊
376
+ ␊
377
+ export declare const enum Empty {␊
378
+ ␊
379
+ }␊
380
+ ␊
381
+ export declare function enumToI32(e: CustomNumEnum): number␊
382
+ ␊
383
+ export declare function fibonacci(n: number): number␊
384
+ ␊
385
+ export declare function fnReceivedAliased(s: AliasedStruct, e: ALIAS): void␊
386
+ ␊
387
+ export declare function getBuffer(): Buffer␊
388
+ ␊
389
+ export declare function getCwd(callback: (arg0: string) => void): void␊
390
+ ␊
391
+ export declare function getEmptyBuffer(): Buffer␊
392
+ ␊
393
+ export declare function getExternal(external: ExternalObject<number>): number␊
394
+ ␊
395
+ export declare function getGlobal(): typeof global␊
396
+ ␊
397
+ export declare function getMapping(): Record<string, number>␊
398
+ ␊
399
+ export declare function getNestedNumArr(): number[][][]␊
400
+ ␊
401
+ export declare function getNull(): null␊
402
+ ␊
403
+ export declare function getNumArr(): number[]␊
404
+ ␊
405
+ /** Gets some numbers */␊
406
+ export declare function getNums(): Array<number>␊
407
+ ␊
408
+ export declare function getPackageJsonName(packageJson: PackageJson): string␊
409
+ ␊
410
+ export declare function getStrFromObject(): void␊
411
+ ␊
412
+ export declare function getterFromObj(): number␊
413
+ ␊
414
+ export declare function getUndefined(): void␊
415
+ ␊
416
+ export declare function getWords(): Array<string>␊
417
+ ␊
418
+ /** default enum values are continuos i32s start from 0 */␊
419
+ export declare const enum Kind {␊
420
+ /** Barks */␊
421
+ Dog = 0,␊
422
+ /** Kills birds */␊
423
+ Cat = 1,␊
424
+ /** Tasty */␊
425
+ Duck = 2␊
426
+ }␊
427
+ ␊
428
+ export declare function listObjKeys(obj: object): Array<string>␊
429
+ ␊
430
+ export declare function mapOption(val?: number | undefined | null): number | null␊
431
+ ␊
432
+ export declare function mutateExternal(external: ExternalObject<number>, newVal: number): void␊
433
+ ␊
434
+ export declare function mutateTypedArray(input: Float32Array): void␊
435
+ ␊
436
+ export interface Obj {␊
437
+ v: string | number␊
438
+ }␊
439
+ ␊
440
+ export interface ObjectFieldClassInstance {␊
441
+ bird: Bird␊
442
+ }␊
443
+ ␊
444
+ export interface ObjectOnlyFromJs {␊
445
+ count: number␊
446
+ callback: (err: Error | null, value: number) => any␊
447
+ }␊
448
+ ␊
449
+ export declare function optionEnd(callback: (arg0: string, arg1?: string | undefined | null) => void): void␊
450
+ ␊
451
+ export declare function optionOnly(callback: (arg0?: string | undefined | null) => void): void␊
452
+ ␊
453
+ export declare function optionStart(callback: (arg0: string | undefined | null, arg1: string) => void): void␊
454
+ ␊
455
+ export declare function optionStartEnd(callback: (arg0: string | undefined | null, arg1: string, arg2?: string | undefined | null) => void): void␊
456
+ ␊
457
+ export declare function overrideIndividualArgOnFunction(notOverridden: string, f: () => string, notOverridden2: number): string␊
458
+ ␊
459
+ export declare function overrideIndividualArgOnFunctionWithCbArg(callback: (town: string, name?: string | undefined | null) => string, notOverridden: number): object␊
460
+ ␊
461
+ /** This is an interface for package.json */␊
462
+ export interface PackageJson {␊
463
+ name: string␊
464
+ /** The version of the package */␊
465
+ version: string␊
466
+ dependencies?: Record<string, any>␊
467
+ devDependencies?: Record<string, any>␊
468
+ }␊
469
+ ␊
470
+ export declare function panic(): void␊
471
+ ␊
472
+ export declare function plusOne(this: Width): number␊
473
+ ␊
474
+ export declare function promiseInEither(input: number | Promise<number>): Promise<boolean>␊
475
+ ␊
476
+ /** napi = { version = 2, features = ["serde-json"] } */␊
477
+ export declare function readFile(callback: (arg0: Error | undefined, arg1?: string | undefined | null) => void): void␊
478
+ ␊
479
+ export declare function readFileAsync(path: string): Promise<Buffer>␊
480
+ ␊
481
+ export declare function readPackageJson(): PackageJson␊
482
+ ␊
483
+ export declare function receiveAllOptionalObject(obj?: AllOptionalObject | undefined | null): void␊
484
+ ␊
485
+ export declare function receiveClassOrNumber(either: number | JsClassForEither): number␊
486
+ ␊
487
+ export declare function receiveDifferentClass(either: JsClassForEither | AnotherClassForEither): number␊
488
+ ␊
489
+ export declare function receiveMutClassOrNumber(either: number | JsClassForEither): number␊
490
+ ␊
491
+ export declare function receiveObjectOnlyFromJs(obj: { count: number, callback: (err: Error | null, count: number) => void }): void␊
492
+ ␊
493
+ export declare function receiveObjectWithClassField(object: ObjectFieldClassInstance): Bird␊
494
+ ␊
495
+ export declare function receiveStrictObject(strictObject: StrictObject): void␊
496
+ ␊
497
+ export declare function receiveString(s: string): string␊
498
+ ␊
499
+ export declare function returnEither(input: number): string | number␊
500
+ ␊
501
+ export declare function returnEitherClass(input: number): number | JsClassForEither␊
502
+ ␊
503
+ export declare function returnJsFunction(): (...args: any[]) => any␊
504
+ ␊
505
+ export declare function returnNull(): null␊
506
+ ␊
507
+ export declare function returnUndefined(): void␊
508
+ ␊
509
+ export declare function returnUndefinedIfInvalid(input: boolean): boolean␊
510
+ ␊
511
+ export declare function returnUndefinedIfInvalidPromise(input: Promise<boolean>): Promise<boolean>␊
512
+ ␊
513
+ export declare function roundtripStr(s: string): string␊
514
+ ␊
515
+ export declare function runScript(script: string): unknown␊
516
+ ␊
517
+ export declare function setSymbolInObj(symbol: symbol): object␊
518
+ ␊
519
+ export interface StrictObject {␊
520
+ name: string␊
521
+ }␊
522
+ ␊
523
+ export declare function sumMapping(nums: Record<string, number>): number␊
524
+ ␊
525
+ export declare function sumNums(nums: Array<number>): number␊
526
+ ␊
527
+ export declare function testSerdeRoundtrip(data: any): any␊
528
+ ␊
529
+ export declare function threadsafeFunctionClosureCapture(func: (...args: any[]) => any): void␊
530
+ ␊
531
+ export declare function threadsafeFunctionFatalMode(cb: (...args: any[]) => any): void␊
532
+ ␊
533
+ export declare function threadsafeFunctionFatalModeError(cb: (...args: any[]) => any): void␊
534
+ ␊
535
+ export declare function threadsafeFunctionThrowError(cb: (...args: any[]) => any): void␊
536
+ ␊
537
+ export declare function throwError(): void␊
538
+ ␊
539
+ export declare function toJsObj(): object␊
540
+ ␊
541
+ export declare function tsfnAsyncCall(func: (...args: any[]) => any): Promise<void>␊
542
+ ␊
543
+ export declare function tsfnCallWithCallback(func: (...args: any[]) => any): void␊
544
+ ␊
545
+ export declare function tsRename(a: { foo: number }): string[]␊
546
+ ␊
547
+ export interface TsTypeChanged {␊
548
+ typeOverride: object␊
549
+ typeOverrideOptional?: object␊
550
+ }␊
551
+ ␊
552
+ export declare function validateArray(arr: Array<number>): number␊
553
+ ␊
554
+ export declare function validateBigint(input: bigint): bigint␊
555
+ ␊
556
+ export declare function validateBoolean(i: boolean): boolean␊
557
+ ␊
558
+ export declare function validateBuffer(b: Buffer): number␊
559
+ ␊
560
+ export declare function validateDate(d: Date): number␊
561
+ ␊
562
+ export declare function validateDateTime(d: Date): number␊
563
+ ␊
564
+ export declare function validateExternal(e: ExternalObject<number>): number␊
565
+ ␊
566
+ export declare function validateFunction(cb: () => number): number␊
567
+ ␊
568
+ export declare function validateHashMap(input: Record<string, number>): number␊
569
+ ␊
570
+ export declare function validateNull(i: null): boolean␊
571
+ ␊
572
+ export declare function validateNumber(i: number): number␊
573
+ ␊
574
+ export declare function validateOptional(input1?: string | undefined | null, input2?: boolean | undefined | null): boolean␊
575
+ ␊
576
+ export declare function validatePromise(p: Promise<number>): Promise<number>␊
577
+ ␊
578
+ export declare function validateString(s: string): string␊
579
+ ␊
580
+ export declare function validateSymbol(s: symbol): boolean␊
581
+ ␊
582
+ export declare function validateTypedArray(input: Uint8Array): number␊
583
+ ␊
584
+ export declare function validateUndefined(i: undefined): boolean␊
585
+ ␊
586
+ export declare function withAbortController(a: number, b: number, signal: AbortSignal): Promise<number>␊
587
+ ␊
588
+ export declare function withoutAbortController(a: number, b: number): Promise<number>␊
589
+ ␊
590
+ export declare function xxh64Alias(input: Buffer): bigint␊
591
+ ␊
592
+ export declare namespace xxh2 {␊
593
+ export function xxh2Plus(a: number, b: number): number␊
594
+ export function xxh3Xxh64Alias(input: Buffer): bigint␊
595
+ }␊
596
+ ␊
597
+ export declare namespace xxh3 {␊
598
+ /** Xxh3 class */␊
599
+ export class Xxh3 {␊
600
+ constructor()␊
601
+ /** update */␊
602
+ update(input: Buffer): void␊
603
+ digest(): bigint␊
74
604
  }␊
605
+ export const ALIGNMENT: number␊
606
+ /** xxh128 function */␊
607
+ export function xxh128(input: Buffer): bigint␊
608
+ export function xxh3_64(input: Buffer): bigint␊
75
609
  }␊
76
- /**␊
610
+ `
611
+
612
+ ## should process type def with noConstEnum correctly
613
+
614
+ > Snapshot 1
615
+
616
+ `/**␊
77
617
  * \`constructor\` option for \`struct\` requires all fields to be public,␊
78
618
  * otherwise tag impl fn as constructor␊
79
619
  * #[napi(constructor)]␊
80
620
  */␊
81
- export class Animal {␊
621
+ export declare class Animal {␊
82
622
  /** Kind of animal */␊
83
623
  readonly kind: Kind␊
84
624
  /** This is the constructor */␊
@@ -108,34 +648,34 @@ Generated by [AVA](https://avajs.dev).
108
648
  overrideIndividualArgOnMethod(normalTy: string, overriddenTy: {n: string}): Bird␊
109
649
  }␊
110
650
  ␊
111
- export class AnimalWithDefaultConstructor {␊
651
+ export declare class AnimalWithDefaultConstructor {␊
112
652
  name: string␊
113
653
  kind: number␊
114
654
  constructor(name: string, kind: number)␊
115
655
  }␊
116
656
  ␊
117
- export class AnotherClassForEither {␊
657
+ export declare class AnotherClassForEither {␊
118
658
  constructor()␊
119
659
  }␊
120
660
  ␊
121
- export class AnotherCssStyleSheet {␊
661
+ export declare class AnotherCssStyleSheet {␊
122
662
  get rules(): CssRuleList␊
123
663
  }␊
124
664
  export type AnotherCSSStyleSheet = AnotherCssStyleSheet␊
125
665
  ␊
126
- export class Asset {␊
666
+ export declare class Asset {␊
127
667
  constructor()␊
128
668
  get filePath(): number␊
129
669
  }␊
130
670
  export type JsAsset = Asset␊
131
671
  ␊
132
- export class Assets {␊
672
+ export declare class Assets {␊
133
673
  constructor()␊
134
674
  get(id: number): JsAsset | null␊
135
675
  }␊
136
676
  export type JsAssets = Assets␊
137
677
  ␊
138
- export class Bird {␊
678
+ export declare class Bird {␊
139
679
  name: string␊
140
680
  constructor(name: string)␊
141
681
  getCount(): number␊
@@ -143,24 +683,24 @@ Generated by [AVA](https://avajs.dev).
143
683
  }␊
144
684
  ␊
145
685
  /** Smoking test for type generation */␊
146
- export class Blake2BHasher {␊
686
+ export declare class Blake2BHasher {␊
147
687
  static withKey(key: Blake2bKey): Blake2BHasher␊
148
688
  update(data: Buffer): void␊
149
689
  }␊
150
690
  export type Blake2bHasher = Blake2BHasher␊
151
691
  ␊
152
- export class Blake2BKey {␊
692
+ export declare class Blake2BKey {␊
153
693
  ␊
154
694
  }␊
155
695
  export type Blake2bKey = Blake2BKey␊
156
696
  ␊
157
- export class ClassWithFactory {␊
697
+ export declare class ClassWithFactory {␊
158
698
  name: string␊
159
699
  static withName(name: string): ClassWithFactory␊
160
700
  setName(name: string): this␊
161
701
  }␊
162
702
  ␊
163
- export class Context {␊
703
+ export declare class Context {␊
164
704
  maybeNeed?: boolean␊
165
705
  buffer: Uint8Array␊
166
706
  constructor()␊
@@ -169,60 +709,60 @@ Generated by [AVA](https://avajs.dev).
169
709
  method(): string␊
170
710
  }␊
171
711
  ␊
172
- export class CssRuleList {␊
712
+ export declare class CssRuleList {␊
173
713
  getRules(): Array<string>␊
174
714
  get parentStyleSheet(): CSSStyleSheet␊
175
715
  get name(): string | null␊
176
716
  }␊
177
717
  export type CSSRuleList = CssRuleList␊
178
718
  ␊
179
- export class CssStyleSheet {␊
719
+ export declare class CssStyleSheet {␊
180
720
  constructor(name: string, rules: Array<string>)␊
181
721
  get rules(): CssRuleList␊
182
722
  anotherCssStyleSheet(): AnotherCssStyleSheet␊
183
723
  }␊
184
724
  export type CSSStyleSheet = CssStyleSheet␊
185
725
  ␊
186
- export class CustomFinalize {␊
726
+ export declare class CustomFinalize {␊
187
727
  constructor(width: number, height: number)␊
188
728
  }␊
189
729
  ␊
190
- export class Dog {␊
730
+ export declare class Dog {␊
191
731
  name: string␊
192
732
  constructor(name: string)␊
193
733
  }␊
194
734
  ␊
195
- export class Fib {␊
735
+ export declare class Fib {␊
196
736
  [Symbol.iterator](): Iterator<number, void, number>␊
197
737
  constructor()␊
198
738
  }␊
199
739
  ␊
200
- export class Fib2 {␊
740
+ export declare class Fib2 {␊
201
741
  [Symbol.iterator](): Iterator<number, void, number>␊
202
742
  static create(seed: number): Fib2␊
203
743
  }␊
204
744
  ␊
205
- export class Fib3 {␊
745
+ export declare class Fib3 {␊
206
746
  current: number␊
207
747
  next: number␊
208
748
  constructor(current: number, next: number)␊
209
749
  [Symbol.iterator](): Iterator<number, void, number>␊
210
750
  }␊
211
751
  ␊
212
- export class JsClassForEither {␊
752
+ export declare class JsClassForEither {␊
213
753
  constructor()␊
214
754
  }␊
215
755
  ␊
216
- export class JsRemote {␊
756
+ export declare class JsRemote {␊
217
757
  name(): string␊
218
758
  }␊
219
759
  ␊
220
- export class JsRepo {␊
760
+ export declare class JsRepo {␊
221
761
  constructor(dir: string)␊
222
762
  remote(): JsRemote␊
223
763
  }␊
224
764
  ␊
225
- export class NinjaTurtle {␊
765
+ export declare class NinjaTurtle {␊
226
766
  name: string␊
227
767
  static isInstanceOf(value: unknown): boolean␊
228
768
  /** Create your ninja turtle! 🐢 */␊
@@ -232,20 +772,20 @@ Generated by [AVA](https://avajs.dev).
232
772
  returnThis(this: this): this␊
233
773
  }␊
234
774
  ␊
235
- export class NotWritableClass {␊
775
+ export declare class NotWritableClass {␊
236
776
  name: string␊
237
777
  constructor(name: string)␊
238
778
  setName(name: string): void␊
239
779
  }␊
240
780
  ␊
241
- export class Optional {␊
781
+ export declare class Optional {␊
242
782
  static optionEnd(required: string, optional?: string | undefined | null): string␊
243
783
  static optionStart(optional: string | undefined | null, required: string): string␊
244
784
  static optionStartEnd(optional1: string | undefined | null, required: string, optional2?: string | undefined | null): string␊
245
785
  static optionOnly(optional?: string | undefined | null): string␊
246
786
  }␊
247
787
  ␊
248
- export class Width {␊
788
+ export declare class Width {␊
249
789
  value: number␊
250
790
  constructor(value: number)␊
251
791
  }␊
@@ -254,15 +794,15 @@ Generated by [AVA](https://avajs.dev).
254
794
  foo: number␊
255
795
  }␊
256
796
  ␊
257
- export function acceptThreadsafeFunction(func: (err: Error | null, value: number) => any): void␊
797
+ export declare function acceptThreadsafeFunction(func: (err: Error | null, value: number) => any): void␊
258
798
  ␊
259
- export function acceptThreadsafeFunctionFatal(func: (value: number) => any): void␊
799
+ export declare function acceptThreadsafeFunctionFatal(func: (value: number) => any): void␊
260
800
  ␊
261
- export function acceptThreadsafeFunctionTupleArgs(func: (err: Error | null, arg0: number, arg1: boolean, arg2: string) => any): void␊
801
+ export declare function acceptThreadsafeFunctionTupleArgs(func: (err: Error | null, arg0: number, arg1: boolean, arg2: string) => any): void␊
262
802
  ␊
263
- export function add(a: number, b: number): number␊
803
+ export declare function add(a: number, b: number): number␊
264
804
  ␊
265
- export const enum ALIAS {␊
805
+ export declare enum ALIAS {␊
266
806
  A = 0,␊
267
807
  B = 1␊
268
808
  }␊
@@ -277,74 +817,74 @@ Generated by [AVA](https://avajs.dev).
277
817
  age?: number␊
278
818
  }␊
279
819
  ␊
280
- export function appendBuffer(buf: Buffer): Buffer␊
820
+ export declare function appendBuffer(buf: Buffer): Buffer␊
281
821
  ␊
282
- export function arrayBufferPassThrough(buf: Uint8Array): Promise<Uint8Array>␊
822
+ export declare function arrayBufferPassThrough(buf: Uint8Array): Promise<Uint8Array>␊
283
823
  ␊
284
- export function asyncMultiTwo(arg: number): Promise<number>␊
824
+ export declare function asyncMultiTwo(arg: number): Promise<number>␊
285
825
  ␊
286
- export function asyncPlus100(p: Promise<number>): Promise<number>␊
826
+ export declare function asyncPlus100(p: Promise<number>): Promise<number>␊
287
827
  ␊
288
- export function asyncReduceBuffer(buf: Buffer): Promise<number>␊
828
+ export declare function asyncReduceBuffer(buf: Buffer): Promise<number>␊
289
829
  ␊
290
830
  export interface B {␊
291
831
  bar: number␊
292
832
  }␊
293
833
  ␊
294
- export function bigintAdd(a: bigint, b: bigint): bigint␊
834
+ export declare function bigintAdd(a: bigint, b: bigint): bigint␊
295
835
  ␊
296
- export function bigintFromI128(): bigint␊
836
+ export declare function bigintFromI128(): bigint␊
297
837
  ␊
298
- export function bigintFromI64(): bigint␊
838
+ export declare function bigintFromI64(): bigint␊
299
839
  ␊
300
- export function bigintGetU64AsString(bi: bigint): string␊
840
+ export declare function bigintGetU64AsString(bi: bigint): string␊
301
841
  ␊
302
- export function bufferPassThrough(buf: Buffer): Promise<Buffer>␊
842
+ export declare function bufferPassThrough(buf: Buffer): Promise<Buffer>␊
303
843
  ␊
304
844
  export interface C {␊
305
845
  baz: number␊
306
846
  }␊
307
847
  ␊
308
- export function callbackReturnPromise<T>(functionInput: () => T | Promise<T>, callback: (err: Error | null, result: T) => void): T | Promise<T>␊
848
+ export declare function callbackReturnPromise<T>(functionInput: () => T | Promise<T>, callback: (err: Error | null, result: T) => void): T | Promise<T>␊
309
849
  ␊
310
- export function callThreadsafeFunction(callback: (...args: any[]) => any): void␊
850
+ export declare function callThreadsafeFunction(callback: (...args: any[]) => any): void␊
311
851
  ␊
312
- export function captureErrorInCallback(cb1: () => void, cb2: (arg0: Error) => void): void␊
852
+ export declare function captureErrorInCallback(cb1: () => void, cb2: (arg0: Error) => void): void␊
313
853
  ␊
314
- export function chronoDateAdd1Minute(input: Date): Date␊
854
+ export declare function chronoDateAdd1Minute(input: Date): Date␊
315
855
  ␊
316
- export function chronoDateToMillis(input: Date): number␊
856
+ export declare function chronoDateToMillis(input: Date): number␊
317
857
  ␊
318
- export function concatLatin1(s: string): string␊
858
+ export declare function concatLatin1(s: string): string␊
319
859
  ␊
320
- export function concatStr(s: string): string␊
860
+ export declare function concatStr(s: string): string␊
321
861
  ␊
322
- export function concatUtf16(s: string): string␊
862
+ export declare function concatUtf16(s: string): string␊
323
863
  ␊
324
- export function contains(source: string, target: string): boolean␊
864
+ export declare function contains(source: string, target: string): boolean␊
325
865
  ␊
326
- export function convertU32Array(input: Uint32Array): Array<number>␊
866
+ export declare function convertU32Array(input: Uint32Array): Array<number>␊
327
867
  ␊
328
- export function createBigInt(): bigint␊
868
+ export declare function createBigInt(): bigint␊
329
869
  ␊
330
- export function createBigIntI64(): bigint␊
870
+ export declare function createBigIntI64(): bigint␊
331
871
  ␊
332
- export function createExternal(size: number): ExternalObject<number>␊
872
+ export declare function createExternal(size: number): ExternalObject<number>␊
333
873
  ␊
334
- export function createExternalString(content: string): ExternalObject<string>␊
874
+ export declare function createExternalString(content: string): ExternalObject<string>␊
335
875
  ␊
336
- export function createExternalTypedArray(): Uint32Array␊
876
+ export declare function createExternalTypedArray(): Uint32Array␊
337
877
  ␊
338
- export function createObj(): object␊
878
+ export declare function createObj(): object␊
339
879
  ␊
340
- export function createObjectWithClassField(): ObjectFieldClassInstance␊
880
+ export declare function createObjectWithClassField(): ObjectFieldClassInstance␊
341
881
  ␊
342
- export function createObjWithProperty(): { value: ArrayBuffer, get getter(): number }␊
882
+ export declare function createObjWithProperty(): { value: ArrayBuffer, get getter(): number }␊
343
883
  ␊
344
- export function createSymbol(): symbol␊
884
+ export declare function createSymbol(): symbol␊
345
885
  ␊
346
886
  /** You could break the step and for an new continuous value. */␊
347
- export const enum CustomNumEnum {␊
887
+ export declare enum CustomNumEnum {␊
348
888
  One = 1,␊
349
889
  Two = 2,␊
350
890
  Three = 3,␊
@@ -355,75 +895,75 @@ Generated by [AVA](https://avajs.dev).
355
895
  Ten = 10␊
356
896
  }␊
357
897
  ␊
358
- export function customStatusCode(): void␊
898
+ export declare function customStatusCode(): void␊
359
899
  ␊
360
900
  export interface Dates {␊
361
901
  start: Date␊
362
902
  end?: Date␊
363
903
  }␊
364
904
  ␊
365
- export function dateToNumber(input: Date): number␊
905
+ export declare function dateToNumber(input: Date): number␊
366
906
  ␊
367
907
  /** This is a const */␊
368
908
  export const DEFAULT_COST: number␊
369
909
  ␊
370
- export function derefUint8Array(a: Uint8Array, b: Uint8ClampedArray): number␊
910
+ export declare function derefUint8Array(a: Uint8Array, b: Uint8ClampedArray): number␊
371
911
  ␊
372
- export function either3(input: string | number | boolean): number␊
912
+ export declare function either3(input: string | number | boolean): number␊
373
913
  ␊
374
- export function either4(input: string | number | boolean | Obj): number␊
914
+ export declare function either4(input: string | number | boolean | Obj): number␊
375
915
  ␊
376
- export function eitherBoolOrFunction(input: boolean | ((...args: any[]) => any)): void␊
916
+ export declare function eitherBoolOrFunction(input: boolean | ((...args: any[]) => any)): void␊
377
917
  ␊
378
- export function eitherFromObjects(input: A | B | C): string␊
918
+ export declare function eitherFromObjects(input: A | B | C): string␊
379
919
  ␊
380
- export function eitherFromOption(): JsClassForEither | undefined␊
920
+ export declare function eitherFromOption(): JsClassForEither | undefined␊
381
921
  ␊
382
- export function eitherStringOrNumber(input: string | number): number␊
922
+ export declare function eitherStringOrNumber(input: string | number): number␊
383
923
  ␊
384
- export const enum Empty {␊
924
+ export declare enum Empty {␊
385
925
  ␊
386
926
  }␊
387
927
  ␊
388
- export function enumToI32(e: CustomNumEnum): number␊
928
+ export declare function enumToI32(e: CustomNumEnum): number␊
389
929
  ␊
390
- export function fibonacci(n: number): number␊
930
+ export declare function fibonacci(n: number): number␊
391
931
  ␊
392
- export function fnReceivedAliased(s: AliasedStruct, e: ALIAS): void␊
932
+ export declare function fnReceivedAliased(s: AliasedStruct, e: ALIAS): void␊
393
933
  ␊
394
- export function getBuffer(): Buffer␊
934
+ export declare function getBuffer(): Buffer␊
395
935
  ␊
396
- export function getCwd(callback: (arg0: string) => void): void␊
936
+ export declare function getCwd(callback: (arg0: string) => void): void␊
397
937
  ␊
398
- export function getEmptyBuffer(): Buffer␊
938
+ export declare function getEmptyBuffer(): Buffer␊
399
939
  ␊
400
- export function getExternal(external: ExternalObject<number>): number␊
940
+ export declare function getExternal(external: ExternalObject<number>): number␊
401
941
  ␊
402
- export function getGlobal(): typeof global␊
942
+ export declare function getGlobal(): typeof global␊
403
943
  ␊
404
- export function getMapping(): Record<string, number>␊
944
+ export declare function getMapping(): Record<string, number>␊
405
945
  ␊
406
- export function getNestedNumArr(): number[][][]␊
946
+ export declare function getNestedNumArr(): number[][][]␊
407
947
  ␊
408
- export function getNull(): null␊
948
+ export declare function getNull(): null␊
409
949
  ␊
410
- export function getNumArr(): number[]␊
950
+ export declare function getNumArr(): number[]␊
411
951
  ␊
412
952
  /** Gets some numbers */␊
413
- export function getNums(): Array<number>␊
953
+ export declare function getNums(): Array<number>␊
414
954
  ␊
415
- export function getPackageJsonName(packageJson: PackageJson): string␊
955
+ export declare function getPackageJsonName(packageJson: PackageJson): string␊
416
956
  ␊
417
- export function getStrFromObject(): void␊
957
+ export declare function getStrFromObject(): void␊
418
958
  ␊
419
- export function getterFromObj(): number␊
959
+ export declare function getterFromObj(): number␊
420
960
  ␊
421
- export function getUndefined(): void␊
961
+ export declare function getUndefined(): void␊
422
962
  ␊
423
- export function getWords(): Array<string>␊
963
+ export declare function getWords(): Array<string>␊
424
964
  ␊
425
965
  /** default enum values are continuos i32s start from 0 */␊
426
- export const enum Kind {␊
966
+ export declare enum Kind {␊
427
967
  /** Barks */␊
428
968
  Dog = 0,␊
429
969
  /** Kills birds */␊
@@ -432,13 +972,13 @@ Generated by [AVA](https://avajs.dev).
432
972
  Duck = 2␊
433
973
  }␊
434
974
  ␊
435
- export function listObjKeys(obj: object): Array<string>␊
975
+ export declare function listObjKeys(obj: object): Array<string>␊
436
976
  ␊
437
- export function mapOption(val?: number | undefined | null): number | null␊
977
+ export declare function mapOption(val?: number | undefined | null): number | null␊
438
978
  ␊
439
- export function mutateExternal(external: ExternalObject<number>, newVal: number): void␊
979
+ export declare function mutateExternal(external: ExternalObject<number>, newVal: number): void␊
440
980
  ␊
441
- export function mutateTypedArray(input: Float32Array): void␊
981
+ export declare function mutateTypedArray(input: Float32Array): void␊
442
982
  ␊
443
983
  export interface Obj {␊
444
984
  v: string | number␊
@@ -453,17 +993,17 @@ Generated by [AVA](https://avajs.dev).
453
993
  callback: (err: Error | null, value: number) => any␊
454
994
  }␊
455
995
  ␊
456
- export function optionEnd(callback: (arg0: string, arg1?: string | undefined | null) => void): void␊
996
+ export declare function optionEnd(callback: (arg0: string, arg1?: string | undefined | null) => void): void␊
457
997
  ␊
458
- export function optionOnly(callback: (arg0?: string | undefined | null) => void): void␊
998
+ export declare function optionOnly(callback: (arg0?: string | undefined | null) => void): void␊
459
999
  ␊
460
- export function optionStart(callback: (arg0: string | undefined | null, arg1: string) => void): void␊
1000
+ export declare function optionStart(callback: (arg0: string | undefined | null, arg1: string) => void): void␊
461
1001
  ␊
462
- export function optionStartEnd(callback: (arg0: string | undefined | null, arg1: string, arg2?: string | undefined | null) => void): void␊
1002
+ export declare function optionStartEnd(callback: (arg0: string | undefined | null, arg1: string, arg2?: string | undefined | null) => void): void␊
463
1003
  ␊
464
- export function overrideIndividualArgOnFunction(notOverridden: string, f: () => string, notOverridden2: number): string␊
1004
+ export declare function overrideIndividualArgOnFunction(notOverridden: string, f: () => string, notOverridden2: number): string␊
465
1005
  ␊
466
- export function overrideIndividualArgOnFunctionWithCbArg(callback: (town: string, name?: string | undefined | null) => string, notOverridden: number): object␊
1006
+ export declare function overrideIndividualArgOnFunctionWithCbArg(callback: (town: string, name?: string | undefined | null) => string, notOverridden: number): object␊
467
1007
  ␊
468
1008
  /** This is an interface for package.json */␊
469
1009
  export interface PackageJson {␊
@@ -474,134 +1014,134 @@ Generated by [AVA](https://avajs.dev).
474
1014
  devDependencies?: Record<string, any>␊
475
1015
  }␊
476
1016
  ␊
477
- export function panic(): void␊
1017
+ export declare function panic(): void␊
478
1018
  ␊
479
- export function plusOne(this: Width): number␊
1019
+ export declare function plusOne(this: Width): number␊
480
1020
  ␊
481
- export function promiseInEither(input: number | Promise<number>): Promise<boolean>␊
1021
+ export declare function promiseInEither(input: number | Promise<number>): Promise<boolean>␊
482
1022
  ␊
483
1023
  /** napi = { version = 2, features = ["serde-json"] } */␊
484
- export function readFile(callback: (arg0: Error | undefined, arg1?: string | undefined | null) => void): void␊
1024
+ export declare function readFile(callback: (arg0: Error | undefined, arg1?: string | undefined | null) => void): void␊
485
1025
  ␊
486
- export function readFileAsync(path: string): Promise<Buffer>␊
1026
+ export declare function readFileAsync(path: string): Promise<Buffer>␊
487
1027
  ␊
488
- export function readPackageJson(): PackageJson␊
1028
+ export declare function readPackageJson(): PackageJson␊
489
1029
  ␊
490
- export function receiveAllOptionalObject(obj?: AllOptionalObject | undefined | null): void␊
1030
+ export declare function receiveAllOptionalObject(obj?: AllOptionalObject | undefined | null): void␊
491
1031
  ␊
492
- export function receiveClassOrNumber(either: number | JsClassForEither): number␊
1032
+ export declare function receiveClassOrNumber(either: number | JsClassForEither): number␊
493
1033
  ␊
494
- export function receiveDifferentClass(either: JsClassForEither | AnotherClassForEither): number␊
1034
+ export declare function receiveDifferentClass(either: JsClassForEither | AnotherClassForEither): number␊
495
1035
  ␊
496
- export function receiveMutClassOrNumber(either: number | JsClassForEither): number␊
1036
+ export declare function receiveMutClassOrNumber(either: number | JsClassForEither): number␊
497
1037
  ␊
498
- export function receiveObjectOnlyFromJs(obj: { count: number, callback: (err: Error | null, count: number) => void }): void␊
1038
+ export declare function receiveObjectOnlyFromJs(obj: { count: number, callback: (err: Error | null, count: number) => void }): void␊
499
1039
  ␊
500
- export function receiveObjectWithClassField(object: ObjectFieldClassInstance): Bird␊
1040
+ export declare function receiveObjectWithClassField(object: ObjectFieldClassInstance): Bird␊
501
1041
  ␊
502
- export function receiveStrictObject(strictObject: StrictObject): void␊
1042
+ export declare function receiveStrictObject(strictObject: StrictObject): void␊
503
1043
  ␊
504
- export function receiveString(s: string): string␊
1044
+ export declare function receiveString(s: string): string␊
505
1045
  ␊
506
- export function returnEither(input: number): string | number␊
1046
+ export declare function returnEither(input: number): string | number␊
507
1047
  ␊
508
- export function returnEitherClass(input: number): number | JsClassForEither␊
1048
+ export declare function returnEitherClass(input: number): number | JsClassForEither␊
509
1049
  ␊
510
- export function returnJsFunction(): (...args: any[]) => any␊
1050
+ export declare function returnJsFunction(): (...args: any[]) => any␊
511
1051
  ␊
512
- export function returnNull(): null␊
1052
+ export declare function returnNull(): null␊
513
1053
  ␊
514
- export function returnUndefined(): void␊
1054
+ export declare function returnUndefined(): void␊
515
1055
  ␊
516
- export function returnUndefinedIfInvalid(input: boolean): boolean␊
1056
+ export declare function returnUndefinedIfInvalid(input: boolean): boolean␊
517
1057
  ␊
518
- export function returnUndefinedIfInvalidPromise(input: Promise<boolean>): Promise<boolean>␊
1058
+ export declare function returnUndefinedIfInvalidPromise(input: Promise<boolean>): Promise<boolean>␊
519
1059
  ␊
520
- export function roundtripStr(s: string): string␊
1060
+ export declare function roundtripStr(s: string): string␊
521
1061
  ␊
522
- export function runScript(script: string): unknown␊
1062
+ export declare function runScript(script: string): unknown␊
523
1063
  ␊
524
- export function setSymbolInObj(symbol: symbol): object␊
1064
+ export declare function setSymbolInObj(symbol: symbol): object␊
525
1065
  ␊
526
1066
  export interface StrictObject {␊
527
1067
  name: string␊
528
1068
  }␊
529
1069
  ␊
530
- export function sumMapping(nums: Record<string, number>): number␊
1070
+ export declare function sumMapping(nums: Record<string, number>): number␊
531
1071
  ␊
532
- export function sumNums(nums: Array<number>): number␊
1072
+ export declare function sumNums(nums: Array<number>): number␊
533
1073
  ␊
534
- export function testSerdeRoundtrip(data: any): any␊
1074
+ export declare function testSerdeRoundtrip(data: any): any␊
535
1075
  ␊
536
- export function threadsafeFunctionClosureCapture(func: (...args: any[]) => any): void␊
1076
+ export declare function threadsafeFunctionClosureCapture(func: (...args: any[]) => any): void␊
537
1077
  ␊
538
- export function threadsafeFunctionFatalMode(cb: (...args: any[]) => any): void␊
1078
+ export declare function threadsafeFunctionFatalMode(cb: (...args: any[]) => any): void␊
539
1079
  ␊
540
- export function threadsafeFunctionFatalModeError(cb: (...args: any[]) => any): void␊
1080
+ export declare function threadsafeFunctionFatalModeError(cb: (...args: any[]) => any): void␊
541
1081
  ␊
542
- export function threadsafeFunctionThrowError(cb: (...args: any[]) => any): void␊
1082
+ export declare function threadsafeFunctionThrowError(cb: (...args: any[]) => any): void␊
543
1083
  ␊
544
- export function throwError(): void␊
1084
+ export declare function throwError(): void␊
545
1085
  ␊
546
- export function toJsObj(): object␊
1086
+ export declare function toJsObj(): object␊
547
1087
  ␊
548
- export function tsfnAsyncCall(func: (...args: any[]) => any): Promise<void>␊
1088
+ export declare function tsfnAsyncCall(func: (...args: any[]) => any): Promise<void>␊
549
1089
  ␊
550
- export function tsfnCallWithCallback(func: (...args: any[]) => any): void␊
1090
+ export declare function tsfnCallWithCallback(func: (...args: any[]) => any): void␊
551
1091
  ␊
552
- export function tsRename(a: { foo: number }): string[]␊
1092
+ export declare function tsRename(a: { foo: number }): string[]␊
553
1093
  ␊
554
1094
  export interface TsTypeChanged {␊
555
1095
  typeOverride: object␊
556
1096
  typeOverrideOptional?: object␊
557
1097
  }␊
558
1098
  ␊
559
- export function validateArray(arr: Array<number>): number␊
1099
+ export declare function validateArray(arr: Array<number>): number␊
560
1100
  ␊
561
- export function validateBigint(input: bigint): bigint␊
1101
+ export declare function validateBigint(input: bigint): bigint␊
562
1102
  ␊
563
- export function validateBoolean(i: boolean): boolean␊
1103
+ export declare function validateBoolean(i: boolean): boolean␊
564
1104
  ␊
565
- export function validateBuffer(b: Buffer): number␊
1105
+ export declare function validateBuffer(b: Buffer): number␊
566
1106
  ␊
567
- export function validateDate(d: Date): number␊
1107
+ export declare function validateDate(d: Date): number␊
568
1108
  ␊
569
- export function validateDateTime(d: Date): number␊
1109
+ export declare function validateDateTime(d: Date): number␊
570
1110
  ␊
571
- export function validateExternal(e: ExternalObject<number>): number␊
1111
+ export declare function validateExternal(e: ExternalObject<number>): number␊
572
1112
  ␊
573
- export function validateFunction(cb: () => number): number␊
1113
+ export declare function validateFunction(cb: () => number): number␊
574
1114
  ␊
575
- export function validateHashMap(input: Record<string, number>): number␊
1115
+ export declare function validateHashMap(input: Record<string, number>): number␊
576
1116
  ␊
577
- export function validateNull(i: null): boolean␊
1117
+ export declare function validateNull(i: null): boolean␊
578
1118
  ␊
579
- export function validateNumber(i: number): number␊
1119
+ export declare function validateNumber(i: number): number␊
580
1120
  ␊
581
- export function validateOptional(input1?: string | undefined | null, input2?: boolean | undefined | null): boolean␊
1121
+ export declare function validateOptional(input1?: string | undefined | null, input2?: boolean | undefined | null): boolean␊
582
1122
  ␊
583
- export function validatePromise(p: Promise<number>): Promise<number>␊
1123
+ export declare function validatePromise(p: Promise<number>): Promise<number>␊
584
1124
  ␊
585
- export function validateString(s: string): string␊
1125
+ export declare function validateString(s: string): string␊
586
1126
  ␊
587
- export function validateSymbol(s: symbol): boolean␊
1127
+ export declare function validateSymbol(s: symbol): boolean␊
588
1128
  ␊
589
- export function validateTypedArray(input: Uint8Array): number␊
1129
+ export declare function validateTypedArray(input: Uint8Array): number␊
590
1130
  ␊
591
- export function validateUndefined(i: undefined): boolean␊
1131
+ export declare function validateUndefined(i: undefined): boolean␊
592
1132
  ␊
593
- export function withAbortController(a: number, b: number, signal: AbortSignal): Promise<number>␊
1133
+ export declare function withAbortController(a: number, b: number, signal: AbortSignal): Promise<number>␊
594
1134
  ␊
595
- export function withoutAbortController(a: number, b: number): Promise<number>␊
1135
+ export declare function withoutAbortController(a: number, b: number): Promise<number>␊
596
1136
  ␊
597
- export function xxh64Alias(input: Buffer): bigint␊
1137
+ export declare function xxh64Alias(input: Buffer): bigint␊
598
1138
  ␊
599
- export namespace xxh2 {␊
1139
+ export declare namespace xxh2 {␊
600
1140
  export function xxh2Plus(a: number, b: number): number␊
601
1141
  export function xxh3Xxh64Alias(input: Buffer): bigint␊
602
1142
  }␊
603
1143
  ␊
604
- export namespace xxh3 {␊
1144
+ export declare namespace xxh3 {␊
605
1145
  /** Xxh3 class */␊
606
1146
  export class Xxh3 {␊
607
1147
  constructor()␊
@@ -614,5 +1154,4 @@ Generated by [AVA](https://avajs.dev).
614
1154
  export function xxh128(input: Buffer): bigint␊
615
1155
  export function xxh3_64(input: Buffer): bigint␊
616
1156
  }␊
617
- ␊
618
1157
  `