You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/debug.d.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ declare namespace debug {
97
97
/**
98
98
* Returns the registry table (see §4.5).
99
99
*/
100
-
functiongetregistry(): __LUA_TODO__;
100
+
functiongetregistry(): Record<string,any>;
101
101
102
102
/**
103
103
* This function returns the name and the value of the upvalue with index up of the function f. The function returns nil if there is no upvalue with the given index.
@@ -174,10 +174,10 @@ declare namespace debug {
174
174
*
175
175
* These unique identifiers allow a program to check whether different closures share upvalues. Lua closures that share an upvalue (that is, that access a same external local variable) will return identical ids for those upvalue indices.
* A global variable (not a function) that holds the global environment (see §2.2). Lua itself does not use this variable; changing its value does not affect any environment, nor vice versa.
9
8
*/
10
-
declareconst_G: any;
9
+
declareconst_G: Record<string,any>;
11
10
12
11
/**
13
12
* Calls error if the value of its argument v is false (i.e., nil or false); otherwise, returns all its arguments. In case of error, message is the error object; when absent, it defaults to "assertion failed!"
): /** @tupleReturn */()=>{[PinkeyofT]?: T[P]extends'n' ? number : string};
115
122
116
123
/**
117
124
* Reads the file file, according to the given formats, which specify what to read. For each format, the function returns a string or a number with the characters read, or nil if it cannot read data with the specified format. (In this latter case, the function does not read subsequent formats.) When called without formats, it uses a default format that reads the next line (see below).
@@ -125,8 +132,11 @@ interface file {
125
132
* * number: reads a string with up to this number of bytes, returning nil on end of file. If number is zero, it reads nothing and returns an empty string, or nil on end of file.
126
133
*
127
134
* The formats "l" and "L" should be used only for text files.
135
+
* @tupleReturn
128
136
*/
129
-
read(...formats: FileReadFormat[]): __LUA_TODO__;
137
+
read<TextendsFileReadFormat[]>(
138
+
...formats: T
139
+
): {[PinkeyofT]?: T[P]extends'n' ? number : string};
130
140
131
141
/**
132
142
* Sets and geionts the file position, measured from the beginning of the file, to the posit given by offset plus a base specified by the string whence, as follows:
@@ -158,5 +168,5 @@ interface file {
158
168
* In case of success, this function returns file. Otherwise it returns nil plus a string describing the error.
Copy file name to clipboardExpand all lines: core/modules.d.ts
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -43,14 +43,17 @@ declare namespace package {
43
43
44
44
/**
45
45
* Dynamically links the host program with the C library libname.
46
-
46
+
*
47
47
* If funcname is "*", then it only links with the library, making the symbols exported by the library available to other dynamically linked libraries. Otherwise, it looks for a function funcname inside the library and returns this function as a C function. So, funcname must follow the lua_CFunction prototype (see lua_CFunction).
48
48
*
49
49
* This is a low-level function. It completely bypasses the package and module system. Unlike require, it does not perform any path searching and does not automatically adds extensions. libname must be the complete file name of the C library, including if necessary a path and an extension. funcname must be the exact name exported by the C library (which may depend on the C compiler and linker used).
50
50
*
51
51
* This function is not supported by Standard C. As such, it is only available on some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix systems that support the dlfcn standard).
* Returns a copy of s in which all (or the first n, if given) occurrences of the pattern (see §6.4.1) have been replaced by a replacement string specified by repl, which can be a string, a table, or a function. gsub also returns, as its second value, the total number of matches that occurred. The name gsub comes from Global SUBstitution.
@@ -106,7 +106,7 @@ declare namespace string {
106
106
/**
107
107
* Looks for the first match of pattern (see §6.4.1) in the string s. If it finds one, then match returns the captures from the pattern; otherwise it returns nil. If pattern specifies no captures, then the whole match is returned. A third, optional numeric argument init specifies where to start the search; its default value is 1 and can be negative.
* Returns a string that is the concatenation of n copies of the string s separated by the string sep. The default value for sep is the empty string (that is, no separator). Returns the empty string if n is not positive.
Copy file name to clipboardExpand all lines: special/5.3-plus.d.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ declare namespace utf8 {
84
84
*
85
85
* will iterate over all characters in string s, with p being the position (in bytes) and c the code point of each character. It raises an error if it meets any invalid byte sequence.
* Returns the codepoints (as integers) from all characters in s that start between byte position i and j (both included). The default for i is 1 and for j is i. It raises an error if it meets any invalid byte sequence.
0 commit comments