Socket
Socket
Sign inDemoInstall

lua-types

Package Overview
Dependencies
0
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.1 to 2.5.0

12

core/global.d.ts
// Based on https://www.lua.org/manual/5.3/manual.html#6.1
/// <reference lib="es2015.iterable" />
/** @noSelfInFile */

@@ -7,2 +9,6 @@

type LuaUserdata = { readonly __internal__: unique symbol };
/** @luaIterator */
type LuaIterable<T> = Iterable<T> & { readonly __internal__: unique symbol };
/** @luaIterator @tupleReturn */
type LuaTupleIterable<T extends any[]> = Iterable<T> & { readonly __internal__: unique symbol };

@@ -92,5 +98,4 @@ /**

* will iterate over the key–value pairs (1,t[1]), (2,t[2]), ..., up to the first nil value.
* @tupleReturn
*/
declare function ipairs<T extends object>(t: T): [(t: T, index?: number) => [number, any], T, 0];
declare function ipairs<T>(t: Record<number, T>): LuaTupleIterable<[number, T]>;

@@ -116,5 +121,4 @@ /**

* See function next for the caveats of modifying the table during its traversal.
* @tupleReturn
*/
declare function pairs<T>(t: T): [(t: T, index?: any) => [any, any], T];
declare function pairs<T>(t: T): LuaTupleIterable<[keyof T, T[keyof T]]>;

@@ -121,0 +125,0 @@ /**

@@ -39,7 +39,8 @@ // Based on https://www.lua.org/manual/5.3/manual.html#6.8

*/
function lines(): () => string;
function lines<T extends FileReadFormat[]>(
filename: string,
filename?: string,
...formats: T
): /** @tupleReturn */ () => { [P in keyof T]?: T[P] extends 'n' ? number : string };
): LuaTupleIterable<
[] extends T ? [string] : { [P in keyof T]: T[P] extends 'n' ? number : string }
>;

@@ -124,3 +125,5 @@ /**

...formats: T
): /** @tupleReturn */ () => { [P in keyof T]?: T[P] extends 'n' ? number : string };
): LuaTupleIterable<
[] extends T ? [string] : { [P in keyof T]: T[P] extends 'n' ? number : string }
>;

@@ -127,0 +130,0 @@ /**

@@ -81,3 +81,3 @@ // Based on https://www.lua.org/manual/5.3/manual.html#6.4

*/
function gmatch(s: string, pattern: string): /** @tupleReturn */ () => string[];
function gmatch(s: string, pattern: string): LuaTupleIterable<string[]>;

@@ -84,0 +84,0 @@ /**

{
"name": "lua-types",
"version": "2.4.1",
"version": "2.5.0",
"description": "TypeScript definitions for Lua standard library",

@@ -26,4 +26,5 @@ "keywords": [

"devDependencies": {
"prettier": "^1.16.4"
"prettier": "^1.16.4",
"typescript-to-lua": "^0.22.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc