@tlua/tlua-darwin-x64 0.0.13 → 0.0.14

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.
@@ -1,10 +1,6 @@
1
1
 
2
2
  // LuaJIT 2.x runtime declarations for tlua.
3
3
 
4
- interface Object {}
5
- interface Function {}
6
- interface CallableFunction extends Function {}
7
- interface NewableFunction extends Function {}
8
4
  interface IArguments {
9
5
  readonly length: number;
10
6
  [index: number]: any;
@@ -21,7 +17,6 @@ interface ReadonlyArray<T> {
21
17
  readonly [index: number]: T;
22
18
  }
23
19
 
24
- type LuaFunction = (...: any) => (any?, ...any);
25
20
 
26
21
  // A Lua table: an open map from any non-nil key to a value. K is invariant -- it is an
27
22
  // input when the table is indexed and an output when it is iterated with `pairs` -- so
@@ -120,7 +115,7 @@ type InstanceType<T extends new (...: any) => any> = T extends new (...: any) =>
120
115
 
121
116
  /** Recursively unwrap the value type of a thenable */
122
117
  type Awaited<T> = T extends null | undefined ? T :
123
- T extends object & { then(onfulfilled: infer F, ...: infer _): any; } ?
118
+ T extends table & { then(onfulfilled: infer F, ...: infer _): any; } ?
124
119
  F extends ((value: infer V, ...: infer _) => any) ?
125
120
  Awaited<V> :
126
121
  never :
@@ -138,7 +133,7 @@ type Capitalize<S extends string> = intrinsic;
138
133
  /** Convert first character of string literal type to lowercase */
139
134
  type Uncapitalize<S extends string> = intrinsic;
140
135
 
141
- interface LuaMetatable<T extends object> {
136
+ interface LuaMetatable<T extends table> {
142
137
  __index?: Table<any, any> | ((value: T, key: any) => any);
143
138
  __newindex?: Table<any, any> | ((value: T, key: any, newValue: any) => void);
144
139
  __call?: (value: T, ...: any) => (any?, ...any);
@@ -173,13 +168,13 @@ declare function dofile(filename?: string): (any?, ...any);
173
168
  // is optional. This matters now that forwarding a possibly-empty `...` into a
174
169
  // required parameter is an error: `error(...)` has to keep working.
175
170
  declare function error(message?: any, level?: number): never;
176
- declare function getfenv(target?: number | LuaFunction): object;
177
- declare function getmetatable<T extends object>(value: T): LuaMetatable<T> | any | nil;
171
+ declare function getfenv(target?: number | function): table;
172
+ declare function getmetatable<T extends table>(value: T): LuaMetatable<T> | any | nil;
178
173
  declare function ipairs<T>(value: Table<number, T>): (LuaIPairsIterator<T>, Table<number, T>, number);
179
- declare function load(reader: () => string | nil, chunkname?: string): (LuaFunction?, string?);
180
- declare function loadfile(filename?: string): (LuaFunction?, string?);
181
- declare function loadstring(source: string, chunkname?: string): (LuaFunction?, string?);
182
- declare function module(name: string, ...: LuaFunction): void;
174
+ declare function load(reader: () => string | nil, chunkname?: string): (function?, string?);
175
+ declare function loadfile(filename?: string): (function?, string?);
176
+ declare function loadstring(source: string, chunkname?: string): (function?, string?);
177
+ declare function module(name: string, ...: function): void;
183
178
  declare function newproxy(prototype?: boolean | LuaUserdata): LuaUserdata;
184
179
  // next is the pairs iteration protocol, so its value is non-optional for the same
185
180
  // reason LuaPairsIterator's is: a key it yields always has one.
@@ -194,7 +189,7 @@ declare function pairs<K, V>(value: Table<K, V>): (LuaPairsIterator<K, V>, Table
194
189
  // one signature (inference reads a single signature), so `pcall(select, "#", 1, 2)`
195
190
  // falls through to it instead of mis-checking against the wrong overload.
196
191
  declare function pcall<...A, ...R>(fn: (...: A) => (...R), ...: A): (boolean, ...R);
197
- declare function pcall(fn: LuaFunction, ...: any): (boolean, ...any);
192
+ declare function pcall(fn: function, ...: any): (boolean, ...any);
198
193
  declare function print(...: any): void;
199
194
  declare function rawequal(left: any, right: any): boolean;
200
195
  declare function rawget<K, V>(value: Table<K, V>, index: K): V | nil;
@@ -205,8 +200,8 @@ declare function select(index: "#", ...: any): number;
205
200
  // spell -- see internal/checker/luaselect.go). This declared type is the safe
206
201
  // fallback for a shadowed or aliased select the refinement does not reach.
207
202
  declare function select(index: number, ...: any): (any?, ...any);
208
- declare function setfenv(target: number | LuaFunction, environment: object): LuaFunction;
209
- declare function setmetatable<T extends object>(value: T, metatable: LuaMetatable<T> | nil): T;
203
+ declare function setfenv(target: number | function, environment: table): function;
204
+ declare function setmetatable<T extends table>(value: T, metatable: LuaMetatable<T> | nil): T;
210
205
  declare function tonumber(value: any, base?: number): number | nil;
211
206
  declare function tostring(value: any): string;
212
207
  declare function type(value: any): "nil" | "number" | "string" | "boolean" | "table" | "function" | "thread" | "userdata" | "cdata";
@@ -216,7 +211,7 @@ declare function unpack<T>(values: Table<number, T>, i?: number, j?: number): (T
216
211
  // the success pack, so the result is approximated as `(boolean, ...R)`.
217
212
  // The erased second overload catches overloaded callees, as pcall's does.
218
213
  declare function xpcall<...A, ...R>(fn: (...: A) => (...R), handler: (message: any) => any, ...: A): (boolean, ...R);
219
- declare function xpcall(fn: LuaFunction, handler: (message: any) => any, ...: any): (boolean, ...any);
214
+ declare function xpcall(fn: function, handler: (message: any) => any, ...: any): (boolean, ...any);
220
215
 
221
216
  /*
222
217
  * Generic pack parameters (`<...A>`) now correlate arguments and results for
@@ -247,7 +242,7 @@ declare function xpcall(fn: LuaFunction, handler: (message: any) => any, ...: an
247
242
  */
248
243
 
249
244
  interface CoroutineLib {
250
- create(fn: LuaFunction): LuaThread;
245
+ create(fn: function): LuaThread;
251
246
  resume(thread: LuaThread, ...: any): (boolean, ...any);
252
247
  running(): LuaThread | nil;
253
248
  status(thread: LuaThread): "running" | "suspended" | "normal" | "dead";
@@ -256,7 +251,7 @@ interface CoroutineLib {
256
251
  // arguments, later calls feed yield's results -- so correlating them with fn's
257
252
  // parameter/return packs would assert types that are wrong for every coroutine
258
253
  // that yields, which is what wrap is for.
259
- wrap(fn: LuaFunction): LuaFunction;
254
+ wrap(fn: function): function;
260
255
  yield(...: any): (any?, ...any);
261
256
  }
262
257
 
@@ -268,7 +263,7 @@ interface String {
268
263
  find(pattern: string, init?: number, plain?: boolean): (number?, number?, ...string);
269
264
  format(...: any): string;
270
265
  gmatch(pattern: string): () => string;
271
- gsub(pattern: string, replacement: string | object | LuaFunction, n?: number): (string, number);
266
+ gsub(pattern: string, replacement: string | table | function, n?: number): (string, number);
272
267
  len(): number;
273
268
  lower(): string;
274
269
  match(pattern: string, init?: number): (string?, ...string);
@@ -281,11 +276,11 @@ interface String {
281
276
  interface StringLib {
282
277
  byte(value: string, i?: number, j?: number): (number?, ...number);
283
278
  char(...: number): string;
284
- dump(fn: LuaFunction): string;
279
+ dump(fn: function): string;
285
280
  find(value: string, pattern: string, init?: number, plain?: boolean): (number?, number?, ...string);
286
281
  format(format: string, ...: any): string;
287
282
  gmatch(value: string, pattern: string): () => string;
288
- gsub(value: string, pattern: string, replacement: string | object | LuaFunction, n?: number): (string, number);
283
+ gsub(value: string, pattern: string, replacement: string | table | function, n?: number): (string, number);
289
284
  len(value: string): number;
290
285
  lower(value: string): string;
291
286
  match(value: string, pattern: string, init?: number): (string?, ...string);
@@ -354,7 +349,7 @@ type LuaReadFormat = "*n" | "*a" | "*l" | number;
354
349
  interface LuaFile extends LuaUserdata {
355
350
  close(): (boolean | nil, string?);
356
351
  flush(): (boolean | nil, string?);
357
- lines(...: LuaReadFormat): LuaFunction;
352
+ lines(...: LuaReadFormat): function;
358
353
  read(...: LuaReadFormat): (any, ...any);
359
354
  seek(whence?: "set" | "cur" | "end", offset?: number): (number | nil, string?);
360
355
  setvbuf(mode: "no" | "full" | "line", size?: number): (boolean | nil, string?);
@@ -368,7 +363,7 @@ interface IOLib {
368
363
  close(file?: LuaFile): (boolean | nil, string?);
369
364
  flush(): (boolean | nil, string?);
370
365
  input(file?: string | LuaFile): LuaFile;
371
- lines(filename?: string, ...: LuaReadFormat): LuaFunction;
366
+ lines(filename?: string, ...: LuaReadFormat): function;
372
367
  open(filename: string, mode?: string): (LuaFile?, string?);
373
368
  output(file?: string | LuaFile): LuaFile;
374
369
  popen(command: string, mode?: "r" | "w"): (LuaFile?, string?);
@@ -423,13 +418,13 @@ interface PackageLib {
423
418
  readonly config: string;
424
419
  readonly cpath: string;
425
420
  readonly loaded: {[name: string]: any};
426
- readonly loaders: ((name: string) => LuaFunction | string)[];
421
+ readonly loaders: ((name: string) => function | string)[];
427
422
  readonly path: string;
428
- readonly preload: {[name: string]: LuaFunction};
429
- readonly searchers: ((name: string) => LuaFunction | string)[];
430
- loadlib(library: string, functionName: string): (LuaFunction | nil, string?);
423
+ readonly preload: {[name: string]: function};
424
+ readonly searchers: ((name: string) => function | string)[];
425
+ loadlib(library: string, functionName: string): (function | nil, string?);
431
426
  searchpath(name: string, path: string, separator?: string, replacement?: string): (string?, string?);
432
- seeall(module: object): void;
427
+ seeall(module: table): void;
433
428
  }
434
429
 
435
430
  declare package: PackageLib;
@@ -444,29 +439,29 @@ interface LuaDebugInfo {
444
439
  name?: string;
445
440
  namewhat?: string;
446
441
  nups?: number;
447
- func?: LuaFunction;
442
+ func?: function;
448
443
  activelines?: {[line: number]: boolean};
449
444
  }
450
445
 
451
446
  interface DebugLib {
452
447
  debug(): void;
453
- getfenv(value: any): object;
454
- gethook(): (LuaFunction?, string?, number?);
455
- gethook(thread: LuaThread): (LuaFunction?, string?, number?);
456
- getinfo(fn: number | LuaFunction, what?: string): LuaDebugInfo | nil;
457
- getinfo(thread: LuaThread, fn: number | LuaFunction, what?: string): LuaDebugInfo | nil;
448
+ getfenv(value: any): table;
449
+ gethook(): (function?, string?, number?);
450
+ gethook(thread: LuaThread): (function?, string?, number?);
451
+ getinfo(fn: number | function, what?: string): LuaDebugInfo | nil;
452
+ getinfo(thread: LuaThread, fn: number | function, what?: string): LuaDebugInfo | nil;
458
453
  getlocal(level: number, localIndex: number): (string?, any);
459
454
  getlocal(thread: LuaThread, level: number, localIndex: number): (string?, any);
460
- getmetatable(value: any): object | nil;
461
- getregistry(): object;
462
- getupvalue(fn: LuaFunction, index: number): (string?, any);
463
- setfenv(value: any, environment: object): any;
464
- sethook(hook?: LuaFunction, mask?: string, count?: number): void;
465
- sethook(thread: LuaThread, hook?: LuaFunction, mask?: string, count?: number): void;
455
+ getmetatable(value: any): table | nil;
456
+ getregistry(): table;
457
+ getupvalue(fn: function, index: number): (string?, any);
458
+ setfenv(value: any, environment: table): any;
459
+ sethook(hook?: function, mask?: string, count?: number): void;
460
+ sethook(thread: LuaThread, hook?: function, mask?: string, count?: number): void;
466
461
  setlocal(level: number, localIndex: number, value: any): string | nil;
467
462
  setlocal(thread: LuaThread, level: number, localIndex: number, value: any): string | nil;
468
- setmetatable<T>(value: T, metatable: object | nil): T;
469
- setupvalue(fn: LuaFunction, index: number, value: any): string | nil;
463
+ setmetatable<T>(value: T, metatable: table | nil): T;
464
+ setupvalue(fn: function, index: number, value: any): string | nil;
470
465
  traceback(message?: any, level?: number): string;
471
466
  traceback(thread: LuaThread, message?: any, level?: number): string;
472
467
  }
@@ -499,9 +494,9 @@ interface JITLib {
499
494
  readonly version_num: number;
500
495
  readonly os: "Windows" | "Linux" | "OSX" | "BSD" | "POSIX" | "Other";
501
496
  readonly arch: string;
502
- on(fn?: LuaFunction | boolean, recursive?: boolean): void;
503
- off(fn?: LuaFunction | boolean, recursive?: boolean): void;
504
- flush(fn?: LuaFunction | boolean, recursive?: boolean): void;
497
+ on(fn?: function | boolean, recursive?: boolean): void;
498
+ off(fn?: function | boolean, recursive?: boolean): void;
499
+ flush(fn?: function | boolean, recursive?: boolean): void;
505
500
  flush(trace: number): void;
506
501
  status(): (boolean, ...string);
507
502
  readonly opt: JITOptLib;
@@ -523,7 +518,7 @@ interface LuaCType {
523
518
  interface LuaCallback extends LuaCData {
524
519
  readonly __ffiCallbackBrand: unique symbol;
525
520
  free(): void;
526
- set(fn: LuaFunction): void;
521
+ set(fn: function): void;
527
522
  }
528
523
 
529
524
  interface LuaCNamespace {
@@ -541,8 +536,8 @@ interface FFILib {
541
536
  "new": (type: LuaCTypeSpec, ...: any) => LuaCData;
542
537
  "typeof": (type: LuaCTypeSpec, ...: any) => LuaCType;
543
538
  cast(type: LuaCTypeSpec, initializer: any): LuaCData;
544
- metatype(type: LuaCTypeSpec, metatable: object): LuaCType;
545
- gc(value: LuaCData, finalizer?: LuaFunction): LuaCData;
539
+ metatype(type: LuaCTypeSpec, metatable: table): LuaCType;
540
+ gc(value: LuaCData, finalizer?: function): LuaCData;
546
541
  sizeof(type: LuaCTypeSpec, count?: number): number | nil;
547
542
  alignof(type: LuaCTypeSpec): number;
548
543
  offsetof(type: LuaCTypeSpec, field: string): (number, number?, number?);
@@ -591,10 +586,10 @@ interface JITTraceInfo {
591
586
  }
592
587
 
593
588
  interface JITUtilLib {
594
- funcinfo(fn: LuaFunction, pc?: number): JITFunctionInfo;
595
- funcbc(fn: LuaFunction, pc: number): (number?, number?);
596
- funck(fn: LuaFunction, index: number): any;
597
- funcuvname(fn: LuaFunction, index: number): string | nil;
589
+ funcinfo(fn: function, pc?: number): JITFunctionInfo;
590
+ funcbc(fn: function, pc: number): (number?, number?);
591
+ funck(fn: function, index: number): any;
592
+ funcuvname(fn: function, index: number): string | nil;
598
593
  traceinfo(trace: number): JITTraceInfo | nil;
599
594
  traceir(trace: number, reference: number): (number?, number?, number?, number?, number?);
600
595
  tracek(trace: number, index: number): (any?, number?, number?);
@@ -606,8 +601,8 @@ interface JITUtilLib {
606
601
  }
607
602
 
608
603
  interface LuaStringBuffer {
609
- put(value: string | number | object, ...: string | number | object): LuaStringBuffer;
610
- putf(format: string, ...: string | number | object): LuaStringBuffer;
604
+ put(value: string | number | table, ...: string | number | table): LuaStringBuffer;
605
+ putf(format: string, ...: string | number | table): LuaStringBuffer;
611
606
  putcdata(value: LuaCData, length: number): LuaStringBuffer;
612
607
  set(value: string | LuaCData, length?: number): LuaStringBuffer;
613
608
  reset(): LuaStringBuffer;
@@ -624,7 +619,7 @@ interface LuaStringBuffer {
624
619
 
625
620
  interface StringBufferOptions {
626
621
  dict?: string[];
627
- metatable?: object[];
622
+ metatable?: table[];
628
623
  }
629
624
 
630
625
  interface StringBufferLib {
@@ -634,9 +629,9 @@ interface StringBufferLib {
634
629
  decode(value: string): any;
635
630
  }
636
631
 
637
- type TableClear = (value: object) => void;
632
+ type TableClear = (value: table) => void;
638
633
 
639
- type TableNew = (arraySize: number, hashSize: number) => object;
634
+ type TableNew = (arraySize: number, hashSize: number) => table;
640
635
 
641
636
  declare function require(module: "bit"): BitLib;
642
637
  declare function require(module: "jit"): JITLib;
package/lib/tlua CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tlua/tlua-darwin-x64",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "license": "Apache-2.0",
5
5
  "author": "tlua",
6
6
  "homepage": "https://github.com/apyrr/tlua",
@@ -32,7 +32,7 @@
32
32
  "exports": {
33
33
  "./package.json": "./package.json"
34
34
  },
35
- "gitHead": "b2b48dcd7efe342084bfdc93c93ff371a9e48d3c",
35
+ "gitHead": "33ca336d9d59d6a33a71fba67d684d66cea519d9",
36
36
  "publishConfig": {
37
37
  "access": "public",
38
38
  "tag": "latest"