@enjoys/context-engine 1.0.0 → 1.0.1
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/data/commands/adb.json +322 -0
- package/data/commands/alembic.json +301 -0
- package/data/commands/artisan.json +277 -0
- package/data/commands/atlas.json +426 -0
- package/data/commands/auth0.json +648 -0
- package/data/commands/bat.json +84 -0
- package/data/commands/bundle.json +321 -0
- package/data/commands/composer.json +507 -0
- package/data/commands/dart.json +216 -0
- package/data/commands/dbmate.json +257 -0
- package/data/commands/docker-compose.json +384 -0
- package/data/commands/drizzle-kit.json +217 -0
- package/data/commands/expo.json +65 -0
- package/data/commands/fastlane.json +243 -0
- package/data/commands/fd.json +86 -0
- package/data/commands/flutter.json +298 -0
- package/data/commands/flyway.json +261 -0
- package/data/commands/fzf.json +103 -0
- package/data/commands/gem.json +267 -0
- package/data/commands/jq.json +100 -0
- package/data/commands/k9s.json +62 -0
- package/data/commands/liquibase.json +399 -0
- package/data/commands/manifest.json +619 -0
- package/data/commands/minikube.json +60 -0
- package/data/commands/ng.json +64 -0
- package/data/commands/nuxt.json +60 -0
- package/data/commands/php.json +157 -0
- package/data/commands/pm2.json +259 -0
- package/data/commands/pod.json +175 -0
- package/data/commands/prisma.json +257 -0
- package/data/commands/rails.json +372 -0
- package/data/commands/rake.json +360 -0
- package/data/commands/react-native.json +57 -0
- package/data/commands/rg.json +103 -0
- package/data/commands/rspec.json +257 -0
- package/data/commands/ruby.json +108 -0
- package/data/commands/sequelize.json +342 -0
- package/data/commands/snyk.json +442 -0
- package/data/commands/sonar-scanner.json +219 -0
- package/data/commands/stripe.json +314 -0
- package/data/commands/symfony.json +449 -0
- package/data/commands/tmux.json +197 -0
- package/data/commands/trivy.json +367 -0
- package/data/commands/twilio.json +382 -0
- package/data/commands/typeorm.json +262 -0
- package/data/commands/vue.json +60 -0
- package/data/commands/wp.json +857 -0
- package/data/commands/xcodebuild.json +141 -0
- package/data/commands/yq.json +57 -0
- package/data/completion/bash.json +1184 -0
- package/data/completion/c.json +1067 -0
- package/data/completion/cpp.json +824 -0
- package/data/completion/csharp.json +860 -0
- package/data/completion/dockerfile.json +536 -0
- package/data/completion/go.json +1346 -0
- package/data/completion/html.json +806 -0
- package/data/completion/java.json +1112 -0
- package/data/completion/javascript.json +914 -0
- package/data/completion/lua.json +968 -0
- package/data/completion/php.json +1535 -0
- package/data/completion/python.json +1427 -0
- package/data/completion/ruby.json +1531 -0
- package/data/completion/rust.json +698 -0
- package/data/completion/sql.json +887 -0
- package/data/completion/toml.json +428 -0
- package/data/completion/typescript.json +338 -0
- package/data/completion/yaml.json +563 -0
- package/data/defination/bash.json +565 -0
- package/data/defination/c.json +865 -0
- package/data/defination/cpp.json +348 -0
- package/data/defination/csharp.json +144 -0
- package/data/defination/dockerfile.json +113 -0
- package/data/defination/go.json +561 -0
- package/data/defination/html.json +559 -0
- package/data/defination/java.json +184 -0
- package/data/defination/javascript.json +265 -0
- package/data/defination/lua.json +181 -0
- package/data/defination/php.json +726 -0
- package/data/defination/python.json +717 -0
- package/data/defination/ruby.json +670 -0
- package/data/defination/rust.json +207 -0
- package/data/defination/sql.json +473 -0
- package/data/defination/toml.json +251 -0
- package/data/defination/typescript.json +29 -0
- package/data/defination/yaml.json +197 -0
- package/data/hover/bash.json +245 -0
- package/data/hover/c.json +265 -0
- package/data/hover/cpp.json +210 -0
- package/data/hover/csharp.json +290 -0
- package/data/hover/dockerfile.json +145 -0
- package/data/hover/go.json +580 -0
- package/data/hover/html.json +250 -0
- package/data/hover/java.json +395 -0
- package/data/hover/javascript.json +330 -0
- package/data/hover/lua.json +265 -0
- package/data/hover/php.json +300 -0
- package/data/hover/python.json +380 -0
- package/data/hover/ruby.json +265 -0
- package/data/hover/rust.json +275 -0
- package/data/hover/sql.json +230 -0
- package/data/hover/toml.json +145 -0
- package/data/hover/typescript.json +120 -0
- package/data/hover/yaml.json +165 -0
- package/data/manifest.json +242 -0
- package/package.json +1 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "javascript",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"console": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{ "value": "```javascript\ninterface Console\n```\nThe `console` object provides access to the debugging console (e.g. the Web console in browsers or stdout/stderr in Node.js). It is accessible via the global `console` object." }
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"console.log": {
|
|
10
|
+
"contents": [
|
|
11
|
+
{ "value": "```javascript\nconsole.log(...data: any[]): void\n```\nOutputs a message to the console. Supports string substitution and additional arguments." }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"console.error": {
|
|
15
|
+
"contents": [
|
|
16
|
+
{ "value": "```javascript\nconsole.error(...data: any[]): void\n```\nOutputs an error message to the console. In browsers, the message is styled as an error." }
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"console.warn": {
|
|
20
|
+
"contents": [
|
|
21
|
+
{ "value": "```javascript\nconsole.warn(...data: any[]): void\n```\nOutputs a warning message to the console. In browsers, displayed with a yellow warning icon." }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"console.info": {
|
|
25
|
+
"contents": [
|
|
26
|
+
{ "value": "```javascript\nconsole.info(...data: any[]): void\n```\nOutputs an informational message to the console." }
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"console.table": {
|
|
30
|
+
"contents": [
|
|
31
|
+
{ "value": "```javascript\nconsole.table(tabularData: any, properties?: string[]): void\n```\nDisplays tabular data as a table. Takes an array or object and an optional array of column names to include." }
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"console.dir": {
|
|
35
|
+
"contents": [
|
|
36
|
+
{ "value": "```javascript\nconsole.dir(item: any, options?: object): void\n```\nDisplays an interactive list of the properties of the specified JavaScript object." }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"console.time": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{ "value": "```javascript\nconsole.time(label?: string): void\n```\nStarts a timer with a given label. Call `console.timeEnd()` with the same label to stop and print the elapsed time." }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"console.timeEnd": {
|
|
45
|
+
"contents": [
|
|
46
|
+
{ "value": "```javascript\nconsole.timeEnd(label?: string): void\n```\nStops a timer previously started by `console.time()` and prints the elapsed time." }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"console.assert": {
|
|
50
|
+
"contents": [
|
|
51
|
+
{ "value": "```javascript\nconsole.assert(condition: boolean, ...data: any[]): void\n```\nWrites an error message to the console if the assertion is false. If true, nothing happens." }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"JSON": {
|
|
55
|
+
"contents": [
|
|
56
|
+
{ "value": "```javascript\nnamespace JSON\n```\nThe `JSON` object contains methods for parsing JSON and converting values to JSON. It cannot be called or constructed." }
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"JSON.parse": {
|
|
60
|
+
"contents": [
|
|
61
|
+
{ "value": "```javascript\nJSON.parse(text: string, reviver?: (key: string, value: any) => any): any\n```\nParses a JSON string, constructing the JavaScript value or object described by the string.\n\n**Throws** `SyntaxError` if the string to parse is not valid JSON." }
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"JSON.stringify": {
|
|
65
|
+
"contents": [
|
|
66
|
+
{ "value": "```javascript\nJSON.stringify(\n value: any,\n replacer?: (key: string, value: any) => any | (string | number)[] | null,\n space?: string | number\n): string | undefined\n```\nConverts a JavaScript value to a JSON string. The `replacer` function or array controls which properties are included. The `space` parameter controls indentation." }
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"Array.from": {
|
|
70
|
+
"contents": [
|
|
71
|
+
{ "value": "```javascript\nArray.from<T>(arrayLike: ArrayLike<T> | Iterable<T>, mapFn?: (v: T, k: number) => U, thisArg?: any): U[]\n```\nCreates a new, shallow-copied Array instance from an iterable or array-like object. Optionally maps each element through `mapFn`." }
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"Array.isArray": {
|
|
75
|
+
"contents": [
|
|
76
|
+
{ "value": "```javascript\nArray.isArray(value: any): value is any[]\n```\nDetermines whether the passed value is an `Array`. Returns `true` for arrays, `false` otherwise." }
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"Array.prototype.map": {
|
|
80
|
+
"contents": [
|
|
81
|
+
{ "value": "```javascript\nArray<T>.map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]\n```\nCreates a new array populated with the results of calling the provided function on every element in the calling array." }
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"Array.prototype.filter": {
|
|
85
|
+
"contents": [
|
|
86
|
+
{ "value": "```javascript\nArray<T>.filter(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]\n```\nCreates a shallow copy of a portion of an array, filtered to only include elements where the predicate returns true." }
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"Array.prototype.reduce": {
|
|
90
|
+
"contents": [
|
|
91
|
+
{ "value": "```javascript\nArray<T>.reduce<U>(callbackfn: (accumulator: U, currentValue: T, index: number, array: T[]) => U, initialValue: U): U\n```\nExecutes a user-supplied reducer callback function on each element of the array, passing in the return value of the calculation on the preceding element." }
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"Array.prototype.forEach": {
|
|
95
|
+
"contents": [
|
|
96
|
+
{ "value": "```javascript\nArray<T>.forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void\n```\nExecutes a provided function once for each array element. Returns `undefined`. Cannot be stopped (use `for...of` or `for` instead)." }
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"Array.prototype.find": {
|
|
100
|
+
"contents": [
|
|
101
|
+
{ "value": "```javascript\nArray<T>.find(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T | undefined\n```\nReturns the first element that satisfies the testing function. Returns `undefined` if no element is found." }
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"Array.prototype.findIndex": {
|
|
105
|
+
"contents": [
|
|
106
|
+
{ "value": "```javascript\nArray<T>.findIndex(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): number\n```\nReturns the index of the first element that satisfies the testing function. Returns `-1` if none found." }
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"Array.prototype.some": {
|
|
110
|
+
"contents": [
|
|
111
|
+
{ "value": "```javascript\nArray<T>.some(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean\n```\nTests whether at least one element in the array passes the test implemented by the provided function." }
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"Array.prototype.every": {
|
|
115
|
+
"contents": [
|
|
116
|
+
{ "value": "```javascript\nArray<T>.every(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean\n```\nTests whether all elements in the array pass the test implemented by the provided function." }
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"Array.prototype.flat": {
|
|
120
|
+
"contents": [
|
|
121
|
+
{ "value": "```javascript\nArray<T>.flat(depth?: number): FlatArray<T, number>[]\n```\nCreates a new array with all sub-array elements concatenated into it recursively up to the specified depth (default: 1)." }
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"Array.prototype.flatMap": {
|
|
125
|
+
"contents": [
|
|
126
|
+
{ "value": "```javascript\nArray<T>.flatMap<U>(callback: (value: T, index: number, array: T[]) => U | U[], thisArg?: any): U[]\n```\nMaps each element using a mapping function, then flattens the result into a new array (equivalent to `map().flat(1)`)." }
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"Array.prototype.includes": {
|
|
130
|
+
"contents": [
|
|
131
|
+
{ "value": "```javascript\nArray<T>.includes(searchElement: T, fromIndex?: number): boolean\n```\nDetermines whether an array includes a certain value, returning `true` or `false`. Uses SameValueZero comparison." }
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"Array.prototype.at": {
|
|
135
|
+
"contents": [
|
|
136
|
+
{ "value": "```javascript\nArray<T>.at(index: number): T | undefined\n```\nReturns the element at the given index. Accepts negative integers which count back from the last item." }
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"Object.keys": {
|
|
140
|
+
"contents": [
|
|
141
|
+
{ "value": "```javascript\nObject.keys(obj: object): string[]\n```\nReturns an array of a given object's own enumerable string-keyed property names." }
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"Object.values": {
|
|
145
|
+
"contents": [
|
|
146
|
+
{ "value": "```javascript\nObject.values(obj: object): any[]\n```\nReturns an array of a given object's own enumerable string-keyed property values." }
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"Object.entries": {
|
|
150
|
+
"contents": [
|
|
151
|
+
{ "value": "```javascript\nObject.entries(obj: object): [string, any][]\n```\nReturns an array of a given object's own enumerable string-keyed property `[key, value]` pairs." }
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"Object.assign": {
|
|
155
|
+
"contents": [
|
|
156
|
+
{ "value": "```javascript\nObject.assign(target: object, ...sources: object[]): object\n```\nCopies all enumerable own properties from one or more source objects to a target object. Returns the modified target object." }
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"Object.freeze": {
|
|
160
|
+
"contents": [
|
|
161
|
+
{ "value": "```javascript\nObject.freeze<T>(obj: T): Readonly<T>\n```\nFreezes an object: other code cannot delete or change its properties. Note: this is shallow — nested objects are not frozen." }
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"Object.fromEntries": {
|
|
165
|
+
"contents": [
|
|
166
|
+
{ "value": "```javascript\nObject.fromEntries(iterable: Iterable<[string, any]>): object\n```\nTransforms a list of key-value pairs into an object." }
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"Object.groupBy": {
|
|
170
|
+
"contents": [
|
|
171
|
+
{ "value": "```javascript\nObject.groupBy<T>(items: Iterable<T>, callbackFn: (element: T, index: number) => string): Record<string, T[]>\n```\n*ES2024* — Groups elements of an iterable according to the string values returned by a callback function." }
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"Promise": {
|
|
175
|
+
"contents": [
|
|
176
|
+
{ "value": "```javascript\nclass Promise<T>\n```\nThe `Promise` object represents the eventual completion (or failure) of an asynchronous operation and its resulting value.\n\nStates: `pending` → `fulfilled` or `rejected`" }
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
"Promise.all": {
|
|
180
|
+
"contents": [
|
|
181
|
+
{ "value": "```javascript\nPromise.all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>\n```\nFulfills when all promises fulfill; rejects when any promise rejects. Short-circuits on first rejection." }
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"Promise.allSettled": {
|
|
185
|
+
"contents": [
|
|
186
|
+
{ "value": "```javascript\nPromise.allSettled<T>(values: Iterable<T | PromiseLike<T>>): Promise<PromiseSettledResult<Awaited<T>>[]>\n```\nFulfills when all promises have settled (fulfilled or rejected). Each result has a `status` property ('fulfilled' or 'rejected')." }
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
"Promise.race": {
|
|
190
|
+
"contents": [
|
|
191
|
+
{ "value": "```javascript\nPromise.race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>\n```\nSettles as soon as any of the promises settles (fulfills or rejects)." }
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"Promise.any": {
|
|
195
|
+
"contents": [
|
|
196
|
+
{ "value": "```javascript\nPromise.any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>\n```\nResolves as soon as any of the promises fulfills. If all reject, rejects with an `AggregateError`." }
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"fetch": {
|
|
200
|
+
"contents": [
|
|
201
|
+
{ "value": "```javascript\nfetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>\n```\nStarts the process of fetching a resource from the network, returning a promise that resolves with the `Response` object.\n\n**RequestInit options:** `method`, `headers`, `body`, `signal`, `mode`, `credentials`, `cache`, `redirect`" }
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"setTimeout": {
|
|
205
|
+
"contents": [
|
|
206
|
+
{ "value": "```javascript\nsetTimeout(callback: (...args: any[]) => void, delay?: number, ...args: any[]): number\n```\nSets a timer which executes a function after the specified delay in milliseconds. Returns a timeout ID for use with `clearTimeout()`." }
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"setInterval": {
|
|
210
|
+
"contents": [
|
|
211
|
+
{ "value": "```javascript\nsetInterval(callback: (...args: any[]) => void, delay?: number, ...args: any[]): number\n```\nRepeatedly calls a function with a fixed time delay between each call. Returns an interval ID for use with `clearInterval()`." }
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
"parseInt": {
|
|
215
|
+
"contents": [
|
|
216
|
+
{ "value": "```javascript\nparseInt(string: string, radix?: number): number\n```\nParses a string argument and returns an integer of the specified radix (base). Returns `NaN` if the first non-whitespace character cannot be converted." }
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
"parseFloat": {
|
|
220
|
+
"contents": [
|
|
221
|
+
{ "value": "```javascript\nparseFloat(string: string): number\n```\nParses a string and returns a floating-point number. Returns `NaN` if the string does not start with a number." }
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"Map": {
|
|
225
|
+
"contents": [
|
|
226
|
+
{ "value": "```javascript\nclass Map<K, V>\n```\nThe `Map` object holds key-value pairs and remembers the original insertion order of the keys. Any value (both objects and primitives) may be used as either a key or a value.\n\n**Methods:** `set(key, value)`, `get(key)`, `has(key)`, `delete(key)`, `clear()`, `forEach()`, `entries()`, `keys()`, `values()`\n\n**Property:** `size`" }
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
"Set": {
|
|
230
|
+
"contents": [
|
|
231
|
+
{ "value": "```javascript\nclass Set<T>\n```\nThe `Set` object lets you store unique values of any type, whether primitive values or object references.\n\n**Methods:** `add(value)`, `has(value)`, `delete(value)`, `clear()`, `forEach()`, `entries()`, `keys()`, `values()`\n\n**Property:** `size`" }
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"WeakMap": {
|
|
235
|
+
"contents": [
|
|
236
|
+
{ "value": "```javascript\nclass WeakMap<K extends object, V>\n```\nA collection of key/value pairs whose keys must be objects or non-registered symbols, held weakly (allow garbage collection).\n\n**Methods:** `set(key, value)`, `get(key)`, `has(key)`, `delete(key)`" }
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
"WeakSet": {
|
|
240
|
+
"contents": [
|
|
241
|
+
{ "value": "```javascript\nclass WeakSet<T extends object>\n```\nA collection of garbage-collectable values (objects and non-registered symbols).\n\n**Methods:** `add(value)`, `has(value)`, `delete(value)`" }
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"Symbol": {
|
|
245
|
+
"contents": [
|
|
246
|
+
{ "value": "```javascript\nfunction Symbol(description?: string): symbol\n```\nCreates a new unique Symbol value. Each symbol is immutable and unique.\n\n**Well-known symbols:** `Symbol.iterator`, `Symbol.asyncIterator`, `Symbol.hasInstance`, `Symbol.toPrimitive`, `Symbol.toStringTag`, `Symbol.dispose`, `Symbol.asyncDispose`" }
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
"Proxy": {
|
|
250
|
+
"contents": [
|
|
251
|
+
{ "value": "```javascript\nclass Proxy<T extends object>\n constructor(target: T, handler: ProxyHandler<T>)\n```\nEnables creation of a proxy for another object, which can intercept and redefine fundamental operations.\n\n**Handler traps:** `get`, `set`, `has`, `deleteProperty`, `apply`, `construct`, `ownKeys`, `getPrototypeOf`, etc." }
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
"Reflect": {
|
|
255
|
+
"contents": [
|
|
256
|
+
{ "value": "```javascript\nnamespace Reflect\n```\nProvides static methods for interceptable JavaScript operations. Methods are the same as those of `Proxy` handler traps.\n\n**Methods:** `Reflect.get()`, `Reflect.set()`, `Reflect.has()`, `Reflect.deleteProperty()`, `Reflect.apply()`, `Reflect.construct()`, `Reflect.ownKeys()`" }
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
"structuredClone": {
|
|
260
|
+
"contents": [
|
|
261
|
+
{ "value": "```javascript\nstructuredClone<T>(value: T, options?: { transfer: Transferable[] }): T\n```\nCreates a deep clone of a given value using the structured clone algorithm. Handles circular references, Maps, Sets, Dates, RegExps, ArrayBuffers, etc." }
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
"AbortController": {
|
|
265
|
+
"contents": [
|
|
266
|
+
{ "value": "```javascript\nclass AbortController\n```\nA controller that allows you to abort one or more Web requests.\n\n**Properties:** `signal: AbortSignal`\n**Methods:** `abort(reason?: any)`\n\n```js\nconst ctrl = new AbortController();\nfetch(url, { signal: ctrl.signal });\nctrl.abort();\n```" }
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
"URL": {
|
|
270
|
+
"contents": [
|
|
271
|
+
{ "value": "```javascript\nclass URL\n constructor(url: string, base?: string | URL)\n```\nCreates and returns a URL object representing an absolute or relative URL.\n\n**Properties:** `href`, `origin`, `protocol`, `hostname`, `port`, `pathname`, `search`, `searchParams`, `hash`, `username`, `password`" }
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
"URLSearchParams": {
|
|
275
|
+
"contents": [
|
|
276
|
+
{ "value": "```javascript\nclass URLSearchParams\n constructor(init?: string | Record<string, string> | [string, string][])\n```\nUtility for working with URL query strings.\n\n**Methods:** `get(name)`, `getAll(name)`, `set(name, value)`, `append(name, value)`, `delete(name)`, `has(name)`, `entries()`, `keys()`, `values()`, `toString()`, `sort()`" }
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
"RegExp": {
|
|
280
|
+
"contents": [
|
|
281
|
+
{ "value": "```javascript\nclass RegExp\n constructor(pattern: string | RegExp, flags?: string)\n```\nUsed for matching text with a pattern.\n\n**Flags:** `g` (global), `i` (ignoreCase), `m` (multiline), `s` (dotAll), `u` (unicode), `v` (unicodeSets), `d` (hasIndices), `y` (sticky)\n\n**Methods:** `test(string)`, `exec(string)`\n**String methods:** `match()`, `matchAll()`, `replace()`, `replaceAll()`, `search()`, `split()`" }
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
"Error": {
|
|
285
|
+
"contents": [
|
|
286
|
+
{ "value": "```javascript\nclass Error\n constructor(message?: string, options?: { cause?: any })\n```\nBase class for all error objects.\n\n**Properties:** `message`, `name`, `stack`, `cause`\n**Subclasses:** `TypeError`, `RangeError`, `SyntaxError`, `ReferenceError`, `URIError`, `EvalError`, `AggregateError`" }
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"Date": {
|
|
290
|
+
"contents": [
|
|
291
|
+
{ "value": "```javascript\nclass Date\n constructor()\n constructor(value: number | string)\n constructor(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number)\n```\nRepresents a single moment in time. Months are 0-indexed.\n\n**Key methods:** `getTime()`, `toISOString()`, `toLocaleDateString()`, `getFullYear()`, `getMonth()`, `getDate()`, `getHours()`, `getMinutes()`\n**Static:** `Date.now()`, `Date.parse()`" }
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
"crypto.randomUUID": {
|
|
295
|
+
"contents": [
|
|
296
|
+
{ "value": "```javascript\ncrypto.randomUUID(): string\n```\nGenerates a v4 UUID using a cryptographically secure random number generator.\n\nReturns a string like `'a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d'`." }
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
"queueMicrotask": {
|
|
300
|
+
"contents": [
|
|
301
|
+
{ "value": "```javascript\nqueueMicrotask(callback: VoidFunction): void\n```\nQueues a microtask to be executed before control is returned to the browser's event loop." }
|
|
302
|
+
]
|
|
303
|
+
},
|
|
304
|
+
"globalThis": {
|
|
305
|
+
"contents": [
|
|
306
|
+
{ "value": "```javascript\nvar globalThis: typeof globalThis\n```\nThe global `this` value. Works in all environments: browser (`window`), Node.js (`global`), Web Workers (`self`)." }
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
"TextEncoder": {
|
|
310
|
+
"contents": [
|
|
311
|
+
{ "value": "```javascript\nclass TextEncoder\n```\nAlways encodes to UTF-8.\n\n**Methods:** `encode(input: string): Uint8Array`, `encodeInto(src: string, dest: Uint8Array): { read: number, written: number }`" }
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
"TextDecoder": {
|
|
315
|
+
"contents": [
|
|
316
|
+
{ "value": "```javascript\nclass TextDecoder\n constructor(label?: string, options?: { fatal?: boolean, ignoreBOM?: boolean })\n```\nDecodes bytes (e.g., Uint8Array) to a string. Default encoding is UTF-8.\n\n**Methods:** `decode(input?: BufferSource, options?: { stream?: boolean }): string`" }
|
|
317
|
+
]
|
|
318
|
+
},
|
|
319
|
+
"typeof": {
|
|
320
|
+
"contents": [
|
|
321
|
+
{ "value": "```javascript\ntypeof operand\n```\nReturns a string indicating the type of the unevaluated operand.\n\n| Expression | Result |\n|---|---|\n| `typeof 42` | `'number'` |\n| `typeof 'str'` | `'string'` |\n| `typeof true` | `'boolean'` |\n| `typeof undefined` | `'undefined'` |\n| `typeof null` | `'object'` |\n| `typeof {}` | `'object'` |\n| `typeof []` | `'object'` |\n| `typeof fn` | `'function'` |\n| `typeof Symbol()` | `'symbol'` |\n| `typeof 1n` | `'bigint'` |" }
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
"instanceof": {
|
|
325
|
+
"contents": [
|
|
326
|
+
{ "value": "```javascript\nobject instanceof Constructor\n```\nTests whether `Constructor.prototype` appears anywhere in the prototype chain of `object`. Returns `boolean`." }
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "lua",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"print": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{ "value": "```lua\nprint(···)\n```\nReceives any number of arguments and prints their values to stdout, using `tostring` to convert each argument. A tab character separates each value, and a newline is written after the last value. Not intended for formatted output — use `string.format` and `io.write` for that." }
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"type": {
|
|
10
|
+
"contents": [
|
|
11
|
+
{ "value": "```lua\ntype(v) -> string\n```\nReturns the type of its only argument, coded as a string. The possible results are `\"nil\"`, `\"number\"`, `\"string\"`, `\"boolean\"`, `\"table\"`, `\"function\"`, `\"thread\"`, and `\"userdata\"`." }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"tostring": {
|
|
15
|
+
"contents": [
|
|
16
|
+
{ "value": "```lua\ntostring(v) -> string\n```\nReceives a value of any type and converts it to a string in a human-readable format. If the metatable of `v` has a `__tostring` metamethod, `tostring` calls it with `v` as the argument and uses the result as the return value." }
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"tonumber": {
|
|
20
|
+
"contents": [
|
|
21
|
+
{ "value": "```lua\ntonumber(e [, base]) -> number | nil\n```\nWhen called with no base, tries to convert its argument to a number. If the argument is already a number or a string convertible to a number, returns the number; otherwise returns `nil`. When called with `base`, the argument must be a string to be interpreted in that base (2–36)." }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"pairs": {
|
|
25
|
+
"contents": [
|
|
26
|
+
{ "value": "```lua\npairs(t) -> function, table, nil\n```\nIf `t` has a metamethod `__pairs`, calls it with `t` as argument and returns the first three results. Otherwise, returns the `next` function, the table `t`, and `nil`, so that `for k, v in pairs(t) do ... end` iterates over all key–value pairs of `t`." }
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"ipairs": {
|
|
30
|
+
"contents": [
|
|
31
|
+
{ "value": "```lua\nipairs(t) -> function, table, 0\n```\nReturns three values: an iterator function, the table `t`, and `0`. The iterator traverses integer keys `1, 2, ...` until a `nil` value is found. Suitable for arrays/sequences." }
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"require": {
|
|
35
|
+
"contents": [
|
|
36
|
+
{ "value": "```lua\nrequire(modname) -> any\n```\nLoads the given module. First checks `package.loaded[modname]`. If not loaded, searches for a loader using `package.searchers` (Lua 5.2+) or `package.loaders` (Lua 5.1). The module value is cached in `package.loaded`." }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"pcall": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{ "value": "```lua\npcall(f [, arg1, ···]) -> boolean, ...\n```\nCalls function `f` with the given arguments in *protected mode*. If there are no errors during the call, returns `true` plus all results from the call. In case of any error, returns `false` plus the error object. Does not produce a traceback." }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"xpcall": {
|
|
45
|
+
"contents": [
|
|
46
|
+
{ "value": "```lua\nxpcall(f, msgh [, arg1, ···]) -> boolean, ...\n```\nSimilar to `pcall`, but sets the message handler `msgh` to be called in case of errors. Any error inside `f` is not propagated; instead `xpcall` catches the error, calls `msgh` with the original error object, and returns the handler's results.\n\n**Note:** Extra arguments to `f` are supported in Lua 5.2+ and LuaJIT 2.1." }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"error": {
|
|
50
|
+
"contents": [
|
|
51
|
+
{ "value": "```lua\nerror(message [, level])\n```\nRaises an error. The `message` can be any value (string, table, etc.). `level` specifies how to get the error position: 1 (default) = where `error` was called, 2 = where the function that called `error` was called, 0 = no position information." }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"assert": {
|
|
55
|
+
"contents": [
|
|
56
|
+
{ "value": "```lua\nassert(v [, message]) -> v, message\n```\nCalls `error` if the value of `v` is false (i.e., `nil` or `false`); otherwise returns all its arguments. In case of error, `message` is the error object (default is `\"assertion failed!\"`)." }
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"select": {
|
|
60
|
+
"contents": [
|
|
61
|
+
{ "value": "```lua\nselect(index, ···) -> ...\n```\nIf `index` is a number, returns all arguments after argument number `index`; a negative number indexes from the end. If `index` is the string `\"#\"`, returns the total number of extra arguments it received." }
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"setmetatable": {
|
|
65
|
+
"contents": [
|
|
66
|
+
{ "value": "```lua\nsetmetatable(table, metatable) -> table\n```\nSets the metatable for the given table. If `metatable` is `nil`, removes the metatable. If the original metatable has a `__metatable` field, raises an error. Returns `table`." }
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"getmetatable": {
|
|
70
|
+
"contents": [
|
|
71
|
+
{ "value": "```lua\ngetmetatable(object) -> table | nil | any\n```\nIf `object` does not have a metatable, returns `nil`. Otherwise, if the object's metatable has a `__metatable` field, returns that value. Otherwise, returns the metatable of the given object." }
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"rawget": {
|
|
75
|
+
"contents": [
|
|
76
|
+
{ "value": "```lua\nrawget(table, index) -> any\n```\nGets the real value of `table[index]`, without invoking the `__index` metamethod." }
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"rawset": {
|
|
80
|
+
"contents": [
|
|
81
|
+
{ "value": "```lua\nrawset(table, index, value) -> table\n```\nSets the real value of `table[index]` to `value`, without invoking the `__newindex` metamethod. `table` must be a table, `index` any value different from `nil` and NaN." }
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"next": {
|
|
85
|
+
"contents": [
|
|
86
|
+
{ "value": "```lua\nnext(table [, index]) -> key, value | nil\n```\nAllows a program to traverse all fields of a table. Its first argument is a table and its second is an index. A call to `next` returns the next index of the table and its associated value. When called with `nil` as the second argument, returns an initial index. Returns `nil` when there are no more elements." }
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"load": {
|
|
90
|
+
"contents": [
|
|
91
|
+
{ "value": "```lua\nload(chunk [, chunkname [, mode [, env]]]) -> function | nil, string\n```\nLoads a chunk. If `chunk` is a string, loads that string. If it is a function, `load` calls it repeatedly to get the chunk pieces. Returns the compiled chunk as a function; otherwise returns `nil` plus the error message.\n\n**Lua 5.1:** Use `loadstring` for strings. Lua 5.2+ unified into `load`." }
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"collectgarbage": {
|
|
95
|
+
"contents": [
|
|
96
|
+
{ "value": "```lua\ncollectgarbage([opt [, arg]]) -> varies\n```\nGeneric interface to the garbage collector. Options: `\"collect\"` (full GC cycle), `\"stop\"`, `\"restart\"`, `\"count\"` (returns KB used), `\"step\"`, `\"isrunning\"`, `\"incremental\"` (Lua 5.4), `\"generational\"` (Lua 5.4)." }
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"string.format": {
|
|
100
|
+
"contents": [
|
|
101
|
+
{ "value": "```lua\nstring.format(formatstring, ···) -> string\n```\nReturns a formatted version of its variable number of arguments following the format description. Similar to C `sprintf`. Directives: `%d`, `%i`, `%u`, `%f`, `%e`, `%g`, `%x`, `%X`, `%o`, `%s`, `%q` (quoted), `%c` (char), `%%` (literal %)." }
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"string.find": {
|
|
105
|
+
"contents": [
|
|
106
|
+
{ "value": "```lua\nstring.find(s, pattern [, init [, plain]]) -> number, number, ... | nil\n```\nLooks for the first match of `pattern` in the string `s`. If found, returns the start and end indices of the match and any captures. Returns `nil` if no match. If `plain` is true, pattern matching facilities are turned off and the function does a plain \"find substring\" operation." }
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"string.match": {
|
|
110
|
+
"contents": [
|
|
111
|
+
{ "value": "```lua\nstring.match(s, pattern [, init]) -> string | ... | nil\n```\nLooks for the first match of `pattern` in `s`. If found, returns the captures from the pattern; otherwise returns `nil`. If `pattern` specifies no captures, the whole match is returned." }
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"string.gmatch": {
|
|
115
|
+
"contents": [
|
|
116
|
+
{ "value": "```lua\nstring.gmatch(s, pattern [, init]) -> iterator function\n```\nReturns an iterator function that, each time it is called, returns the next captures from `pattern` over the string `s`. If `pattern` specifies no captures, the whole match is produced in each call.\n\n**Lua 5.4:** Added optional `init` parameter." }
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"string.gsub": {
|
|
120
|
+
"contents": [
|
|
121
|
+
{ "value": "```lua\nstring.gsub(s, pattern, repl [, n]) -> string, number\n```\nReturns a copy of `s` in which all (or the first `n`, if given) occurrences of the pattern have been replaced by `repl`. `repl` can be a string, a table, or a function. Also returns, as its second value, the total number of matches that occurred." }
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"string.sub": {
|
|
125
|
+
"contents": [
|
|
126
|
+
{ "value": "```lua\nstring.sub(s, i [, j]) -> string\n```\nReturns the substring of `s` that starts at `i` and continues until `j` (both inclusive). `i` and `j` can be negative (counting from the end). Default `j` is `-1` (end of string)." }
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"table.insert": {
|
|
130
|
+
"contents": [
|
|
131
|
+
{ "value": "```lua\ntable.insert(list, [pos,] value)\n```\nInserts element `value` at position `pos` in `list`, shifting up the elements `list[pos], ..., list[#list]`. The default value for `pos` is `#list+1`, so that a call `table.insert(t, x)` appends `x` at the end of list `t`." }
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"table.remove": {
|
|
135
|
+
"contents": [
|
|
136
|
+
{ "value": "```lua\ntable.remove(list [, pos]) -> any\n```\nRemoves from `list` the element at position `pos`, returning the value of the removed element. When `pos` is between 1 and `#list`, shifts down elements `list[pos+1], ..., list[#list]`. The default value for `pos` is `#list` (removes last element)." }
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"table.sort": {
|
|
140
|
+
"contents": [
|
|
141
|
+
{ "value": "```lua\ntable.sort(list [, comp])\n```\nSorts list elements in a given order, *in-place*, from `list[1]` to `list[#list]`. If `comp` is given, it must be a function that receives two list elements and returns `true` when the first element must come before the second in the final order. The sort is not stable in Lua 5.1–5.3; Lua 5.4 does not guarantee stability either." }
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"table.concat": {
|
|
145
|
+
"contents": [
|
|
146
|
+
{ "value": "```lua\ntable.concat(list [, sep [, i [, j]]]) -> string\n```\nGiven a list where all elements are strings or numbers, returns the string `list[i]..sep..list[i+1] ··· sep..list[j]`. The default for `sep` is `\"\"`, for `i` is `1`, and for `j` is `#list`." }
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"math.random": {
|
|
150
|
+
"contents": [
|
|
151
|
+
{ "value": "```lua\nmath.random([m [, n]]) -> number\n```\nWhen called without arguments, returns a pseudo-random float with uniform distribution in the range [0,1). When called with an integer `m`, returns a pseudo-random integer in [1, m]. When called with `m` and `n`, returns a pseudo-random integer in [m, n].\n\n**Lua 5.4:** Uses the xoshiro256** algorithm with better statistical properties than earlier versions' `rand()`." }
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"math.floor": {
|
|
155
|
+
"contents": [
|
|
156
|
+
{ "value": "```lua\nmath.floor(x) -> integer\n```\nReturns the largest integral value less than or equal to `x`. In Lua 5.3+, returns an integer; in earlier versions returns a float." }
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"math.ceil": {
|
|
160
|
+
"contents": [
|
|
161
|
+
{ "value": "```lua\nmath.ceil(x) -> integer\n```\nReturns the smallest integral value greater than or equal to `x`. In Lua 5.3+, returns an integer; in earlier versions returns a float." }
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"io.open": {
|
|
165
|
+
"contents": [
|
|
166
|
+
{ "value": "```lua\nio.open(filename [, mode]) -> file | nil, string\n```\nOpens a file, in the mode specified by the string `mode`. Returns a new file handle, or, in case of errors, `nil` plus an error message. Modes: `\"r\"` (read, default), `\"w\"` (write), `\"a\"` (append), `\"r+\"` (update/read), `\"w+\"` (update/write), `\"a+\"` (update/append). Append `\"b\"` for binary mode." }
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"io.read": {
|
|
170
|
+
"contents": [
|
|
171
|
+
{ "value": "```lua\nio.read(···) -> string | number | nil\n```\nEquivalent to `io.input():read(···)`. Reads from the default input file. Formats: `\"*a\"`/`\"a\"` (whole file), `\"*l\"`/`\"l\"` (next line stripping newline, default), `\"*L\"`/`\"L\"` (next line keeping newline), `\"*n\"`/`\"n\"` (a number), or a number `n` (reads `n` bytes).\n\n**Lua 5.3+:** The `*` prefix is optional." }
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"os.time": {
|
|
175
|
+
"contents": [
|
|
176
|
+
{ "value": "```lua\nos.time([table]) -> integer\n```\nReturns the current time when called without arguments, or a time representing the local date and time specified by the given table. The table must have fields `year`, `month`, and `day`, and may optionally have `hour` (default 12), `min` (default 0), `sec` (default 0), and `isdst`." }
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
"os.date": {
|
|
180
|
+
"contents": [
|
|
181
|
+
{ "value": "```lua\nos.date([format [, time]]) -> string | table\n```\nReturns a string or a table containing date and time, formatted according to the given string `format`. If the format string starts with `!`, the date is formatted in Coordinated Universal Time (UTC). If `format` is `\"*t\"`, returns a table with fields: `year`, `month`, `day`, `hour`, `min`, `sec`, `wday`, `yday`, `isdst`." }
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"os.clock": {
|
|
185
|
+
"contents": [
|
|
186
|
+
{ "value": "```lua\nos.clock() -> number\n```\nReturns an approximation of the amount in seconds of CPU time used by the program, as returned by the underlying ISO C function `clock`." }
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
"os.execute": {
|
|
190
|
+
"contents": [
|
|
191
|
+
{ "value": "```lua\nos.execute([command]) -> boolean|nil, string, integer\n```\nPasses `command` to be executed by an operating system shell. Its first result is `true` if the command terminated successfully, or `nil` otherwise. After this first result the function returns a string plus a number: `\"exit\"` plus exit status, or `\"signal\"` plus signal number.\n\n**Lua 5.1:** Returns only the status code (a number)." }
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"coroutine.create": {
|
|
195
|
+
"contents": [
|
|
196
|
+
{ "value": "```lua\ncoroutine.create(f) -> thread\n```\nCreates a new coroutine, with body `f`. `f` must be a function. Returns the new coroutine (an object with type `\"thread\"`)." }
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"coroutine.resume": {
|
|
200
|
+
"contents": [
|
|
201
|
+
{ "value": "```lua\ncoroutine.resume(co [, val1, ···]) -> boolean, ...\n```\nStarts or continues the execution of coroutine `co`. The first time you resume a coroutine, it starts running its body. Values `val1, ...` are passed as the arguments to the body function (on first resume) or as the results of `yield` (on subsequent resumes). If the coroutine runs without any errors, `resume` returns `true` plus any values passed to `yield` or returned by the body function." }
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"coroutine.yield": {
|
|
205
|
+
"contents": [
|
|
206
|
+
{ "value": "```lua\ncoroutine.yield(···) -> ...\n```\nSuspends the execution of the calling coroutine. Any arguments to `yield` are passed as extra results to `resume`. When the coroutine is resumed again, `yield` returns any extra arguments passed to `resume`." }
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"coroutine.wrap": {
|
|
210
|
+
"contents": [
|
|
211
|
+
{ "value": "```lua\ncoroutine.wrap(f) -> function\n```\nCreates a new coroutine with body `f` and returns a function that resumes the coroutine each time it is called. Any arguments to the returned function go as extra arguments to `resume`. Returns the same values returned by `resume`, except the first boolean. In case of error, propagates the error." }
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
"coroutine.status": {
|
|
215
|
+
"contents": [
|
|
216
|
+
{ "value": "```lua\ncoroutine.status(co) -> string\n```\nReturns the status of coroutine `co`, as a string: `\"running\"` if the coroutine is running (i.e., it called `status`); `\"suspended\"` if the coroutine is suspended in a call to `yield`, or if it has not started running yet; `\"normal\"` if the coroutine is active but not running (it resumed another coroutine); `\"dead\"` if the coroutine has finished its body function or if it has stopped with an error." }
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
"function": {
|
|
220
|
+
"contents": [
|
|
221
|
+
{ "value": "```lua\nfunction name(params)\n body\nend\n```\nDefines a function. Functions are first-class values in Lua. The `function` keyword creates a closure — a function value with access to local variables from the enclosing scope (upvalues). Functions can return multiple values. Use `local function` for local scope." }
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"local": {
|
|
225
|
+
"contents": [
|
|
226
|
+
{ "value": "```lua\nlocal name [= expr]\nlocal function name(params) body end\n```\nDeclares a local variable or local function, restricting its scope to the current block. Local variables are faster to access than globals. In Lua 5.4, local variables can have attributes: `<const>` (compile-time constant) and `<close>` (to-be-closed)." }
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
"if": {
|
|
230
|
+
"contents": [
|
|
231
|
+
{ "value": "```lua\nif expr then block\n{elseif expr then block}\n[else block]\nend\n```\nConditional statement. Evaluates `expr`; if it is anything other than `false` or `nil`, executes the corresponding `then` block. Optional `elseif` and `else` branches. Note: in Lua, only `false` and `nil` are falsy — `0` and `\"\"` are truthy." }
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"for": {
|
|
235
|
+
"contents": [
|
|
236
|
+
{ "value": "```lua\n-- Numeric for:\nfor var = start, stop [, step] do block end\n\n-- Generic for:\nfor var_1, ···, var_n in explist do block end\n```\nThe numeric `for` loop iterates from `start` to `stop` by `step` (default 1). The generic `for` loop iterates via an iterator function (commonly `pairs`, `ipairs`, or custom iterators). Loop variables are local to the loop body." }
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
"while": {
|
|
240
|
+
"contents": [
|
|
241
|
+
{ "value": "```lua\nwhile expr do\n block\nend\n```\nRepeats `block` while `expr` is true (not `false` or `nil`). The condition is tested before each iteration. Use `break` to exit early." }
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"repeat": {
|
|
245
|
+
"contents": [
|
|
246
|
+
{ "value": "```lua\nrepeat\n block\nuntil expr\n```\nRepeats `block` until `expr` is true. The condition is tested after each iteration, so the body always executes at least once. Local variables declared inside `block` are visible in the `until` condition." }
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
"return": {
|
|
250
|
+
"contents": [
|
|
251
|
+
{ "value": "```lua\nreturn [explist]\n```\nReturns values from a function or chunk. Lua allows multiple return values: `return a, b, c`. Must be the last statement in a block. If you need to return in the middle of a block, use an explicit `do return end`." }
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
"nil": {
|
|
255
|
+
"contents": [
|
|
256
|
+
{ "value": "`nil`\n\nThe type `nil` has one single value, `nil`, whose main property is to be different from any other value. It represents the absence of a useful value. A global variable has a `nil` value by default (before assignment), and you can assign `nil` to a variable to delete it." }
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
"debug.traceback": {
|
|
260
|
+
"contents": [
|
|
261
|
+
{ "value": "```lua\ndebug.traceback([thread,] [message [, level]]) -> string\n```\nReturns a string with a traceback of the call stack. The optional `message` is prepended to the traceback. `level` specifies at which level to start (default 1, the function calling `traceback`). Commonly used as the message handler in `xpcall`." }
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|