@tilua-types/sunc 1.0.0
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/README.md +43 -0
- package/index.d.tilua +399 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @tilua-types/sunc
|
|
2
|
+
|
|
3
|
+
The script-executor environment as tilua types — the functions an executor
|
|
4
|
+
injects into a script's globals: `getgenv`, `writefile`, `hookfunction`,
|
|
5
|
+
`getconnections`, `Drawing`, `request` and the rest.
|
|
6
|
+
|
|
7
|
+
Names and shapes follow [sUNC](https://docs.sunc.io) (senS' Unified Naming
|
|
8
|
+
Convention) and the [UNC standard](https://github.com/unified-naming-convention/NamingStandard)
|
|
9
|
+
it grew out of. Where the two disagree, sUNC's shape is the one written down;
|
|
10
|
+
where only UNC has a name (`crypt`, the `rconsole` family, mouse input), it is
|
|
11
|
+
kept, since executors still expose it.
|
|
12
|
+
|
|
13
|
+
Depends on [`@tilua-types/roblox`](../roblox), which is loaded along with it:
|
|
14
|
+
nearly every one of these takes or returns an engine type.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm i -D @tilua-types/sunc
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{ "types": ["sunc"], "paths": {}, "sourceMap": null }
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## What you get
|
|
25
|
+
|
|
26
|
+
- **The globals, typed.** `readfile` gives a `string`, `listfiles` a
|
|
27
|
+
`string[]`, `getgenv()` a `{ [string]: unknown }` you can write to.
|
|
28
|
+
- **`Drawing.new` knows its shapes.** The argument picks the type:
|
|
29
|
+
`Drawing.new("Circle").Radius` is a number, `Drawing.new("Line").From` is a
|
|
30
|
+
`Vector2`, and asking a line for its radius is an error.
|
|
31
|
+
- **Hooks keep the type they replace.** `hookfunction(f, hook)` returns `f`'s
|
|
32
|
+
own type, so the saved original is still called the way `f` was.
|
|
33
|
+
- **`debug` adds to Lua's.** `debug.getconstants` and `debug.traceback` are
|
|
34
|
+
both there: a library that declares a name again extends it.
|
|
35
|
+
- **Signals.** `getconnections(part.Touched)` gives `Connection[]`, each with
|
|
36
|
+
`Function`, `Thread`, `Fire`, `Disconnect` and the rest.
|
|
37
|
+
|
|
38
|
+
## Caveats
|
|
39
|
+
|
|
40
|
+
No executor implements all of this, and several names mean slightly different
|
|
41
|
+
things between them — the types say what the standard says, not what any one
|
|
42
|
+
executor does. Nothing here exists in a normal Roblox game: a script using
|
|
43
|
+
these runs only under an executor.
|
package/index.d.tilua
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
-- The script-executor environment, as tilua types.
|
|
2
|
+
--
|
|
3
|
+
-- Names from sUNC (senS' Unified Naming Convention, https://docs.sunc.io) and
|
|
4
|
+
-- the UNC standard it grew out of
|
|
5
|
+
-- (https://github.com/unified-naming-convention/NamingStandard). These are the
|
|
6
|
+
-- functions an executor injects into a script's environment: they are not part
|
|
7
|
+
-- of Luau and not part of Roblox, so nothing here exists in a normal game.
|
|
8
|
+
--
|
|
9
|
+
-- Depends on `@tilua-types/roblox`, which is loaded along with it: almost every one
|
|
10
|
+
-- of these takes or returns an engine type (`Instance`, `BasePart`,
|
|
11
|
+
-- `RBXScriptSignal`), and `debug` here *adds* to the `debug` those libraries
|
|
12
|
+
-- declare rather than replacing it.
|
|
13
|
+
--
|
|
14
|
+
-- No executor implements all of this, and several names mean slightly
|
|
15
|
+
-- different things between them. Where sUNC and UNC disagree, sUNC's shape is
|
|
16
|
+
-- the one written down; where only UNC has a name (`crypt`, the `rconsole`
|
|
17
|
+
-- family, mouse input), it is kept, since executors still expose it.
|
|
18
|
+
|
|
19
|
+
-- ============================================================
|
|
20
|
+
-- Environment
|
|
21
|
+
-- ============================================================
|
|
22
|
+
|
|
23
|
+
-- The executor's own global table — shared by every script it runs.
|
|
24
|
+
declare function getgenv(): { [string]: unknown }
|
|
25
|
+
|
|
26
|
+
-- The game's global environment: the `_G` LocalScripts and ModuleScripts see.
|
|
27
|
+
declare function getrenv(): { [string]: unknown }
|
|
28
|
+
|
|
29
|
+
-- The Luau registry.
|
|
30
|
+
declare function getreg(): { [unknown]: unknown }
|
|
31
|
+
|
|
32
|
+
-- Everything the garbage collector is holding. Tables are left out unless
|
|
33
|
+
-- `includeTables` is true.
|
|
34
|
+
declare function getgc(includeTables?: boolean): (((...unknown) => ...unknown) | { [unknown]: unknown })[]
|
|
35
|
+
|
|
36
|
+
-- `filtergc` is `getgc` with the search done for you. The filter says what to
|
|
37
|
+
-- look for, and `returnOne` asks for the first match instead of every match —
|
|
38
|
+
-- which is what makes the return type two different things.
|
|
39
|
+
type FunctionFilter = {
|
|
40
|
+
Name?: string,
|
|
41
|
+
IgnoreExecutor?: boolean,
|
|
42
|
+
Hash?: string,
|
|
43
|
+
Constants?: unknown[],
|
|
44
|
+
Upvalues?: unknown[],
|
|
45
|
+
Proto?: number,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type TableFilter = {
|
|
49
|
+
Keys?: unknown[],
|
|
50
|
+
Values?: unknown[],
|
|
51
|
+
KeyValuePairs?: { [unknown]: unknown },
|
|
52
|
+
Metatable?: { [unknown]: unknown },
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare function filtergc(kind: "function", filter: FunctionFilter, returnOne: true): ((...unknown) => ...unknown) | nil
|
|
56
|
+
declare function filtergc(kind: "function", filter: FunctionFilter, returnOne?: false): ((...unknown) => ...unknown)[]
|
|
57
|
+
declare function filtergc(kind: "table", filter: TableFilter, returnOne: true): { [unknown]: unknown } | nil
|
|
58
|
+
declare function filtergc(kind: "table", filter: TableFilter, returnOne?: false): { [unknown]: unknown }[]
|
|
59
|
+
|
|
60
|
+
-- ============================================================
|
|
61
|
+
-- Closures
|
|
62
|
+
-- ============================================================
|
|
63
|
+
|
|
64
|
+
-- Replace what `func` does with `hook`, and give back a callable copy of the
|
|
65
|
+
-- original. The hook keeps the original's type, so a hooked function is still
|
|
66
|
+
-- called the way it was.
|
|
67
|
+
declare function hookfunction<T>(func: T, hook: (...unknown) => ...unknown): T
|
|
68
|
+
|
|
69
|
+
-- Replace one metamethod of `object`'s metatable, returning the original.
|
|
70
|
+
declare function hookmetamethod<T>(object: T, method: string, hook: (...unknown) => ...unknown): (...unknown) => ...unknown
|
|
71
|
+
|
|
72
|
+
-- Undo every hook on a function, back to the one it started as. Errors if the
|
|
73
|
+
-- function was never hooked.
|
|
74
|
+
declare function restorefunction(func: (...unknown) => ...unknown): ()
|
|
75
|
+
|
|
76
|
+
-- A copy of `func` that is a distinct function with the same behaviour.
|
|
77
|
+
declare function clonefunction<T>(func: T): T
|
|
78
|
+
|
|
79
|
+
-- Wrap a Luau function so it looks and behaves like a C closure.
|
|
80
|
+
declare function newcclosure<T>(func: T): T
|
|
81
|
+
|
|
82
|
+
-- Was the caller of the current function the executor, rather than the game?
|
|
83
|
+
declare function checkcaller(): boolean
|
|
84
|
+
|
|
85
|
+
declare function iscclosure(func: (...unknown) => ...unknown): boolean
|
|
86
|
+
declare function islclosure(func: (...unknown) => ...unknown): boolean
|
|
87
|
+
declare function isexecutorclosure(func: (...unknown) => ...unknown): boolean
|
|
88
|
+
|
|
89
|
+
-- A hash of a function's bytecode: two functions that do the same thing have
|
|
90
|
+
-- the same hash, which is how a hook finds its target across updates.
|
|
91
|
+
declare function getfunctionhash(func: (...unknown) => ...unknown): string
|
|
92
|
+
|
|
93
|
+
-- ============================================================
|
|
94
|
+
-- Metatables
|
|
95
|
+
-- ============================================================
|
|
96
|
+
|
|
97
|
+
declare function getrawmetatable<T>(object: T): { [unknown]: unknown } | nil
|
|
98
|
+
declare function setrawmetatable<T>(object: T, metatable: { [unknown]: unknown } | nil): T
|
|
99
|
+
declare function isreadonly(object: unknown): boolean
|
|
100
|
+
declare function setreadonly(object: unknown, readonly: boolean): ()
|
|
101
|
+
|
|
102
|
+
-- Inside a `__namecall` hook: which method was called.
|
|
103
|
+
declare function getnamecallmethod(): string
|
|
104
|
+
|
|
105
|
+
-- ============================================================
|
|
106
|
+
-- Scripts and threads
|
|
107
|
+
-- ============================================================
|
|
108
|
+
|
|
109
|
+
declare function getcallingscript(): BaseScript | nil
|
|
110
|
+
declare function getscripts(): (LocalScript | ModuleScript)[]
|
|
111
|
+
declare function getrunningscripts(): (LocalScript | ModuleScript)[]
|
|
112
|
+
declare function getloadedmodules(excludeCore?: boolean): ModuleScript[]
|
|
113
|
+
declare function getscriptfromthread(thread: thread): BaseScript | nil
|
|
114
|
+
|
|
115
|
+
-- A script's globals, the way the script itself sees them.
|
|
116
|
+
declare function getsenv(script: LocalScript | ModuleScript): { [string]: unknown }
|
|
117
|
+
|
|
118
|
+
declare function getscriptbytecode(script: LocalScript | ModuleScript): string
|
|
119
|
+
declare function getscriptclosure(script: LocalScript | ModuleScript): (...unknown) => ...unknown
|
|
120
|
+
declare function getscripthash(script: LocalScript | ModuleScript): string
|
|
121
|
+
|
|
122
|
+
-- The current thread's permission level, and a way to change it.
|
|
123
|
+
declare function getthreadidentity(): number
|
|
124
|
+
declare function setthreadidentity(identity: number): ()
|
|
125
|
+
|
|
126
|
+
-- ============================================================
|
|
127
|
+
-- Instances
|
|
128
|
+
-- ============================================================
|
|
129
|
+
|
|
130
|
+
-- A reference to the same instance that the game's own code cannot recognise
|
|
131
|
+
-- as yours — what keeps a detection hook from seeing the instance you hold.
|
|
132
|
+
declare function cloneref<T>(object: T): T
|
|
133
|
+
|
|
134
|
+
-- Two references, one instance?
|
|
135
|
+
declare function compareinstances(a: Instance, b: Instance): boolean
|
|
136
|
+
|
|
137
|
+
-- Every instance in the data model, and those parented to nil.
|
|
138
|
+
declare function getinstances(): Instance[]
|
|
139
|
+
declare function getnilinstances(): Instance[]
|
|
140
|
+
|
|
141
|
+
-- A hidden container for the executor's own UI, which the game cannot see.
|
|
142
|
+
declare function gethui(): Folder
|
|
143
|
+
|
|
144
|
+
-- Properties the engine hides from scripts: `Instance.Archivable`-style flags,
|
|
145
|
+
-- and anything marked not scriptable.
|
|
146
|
+
declare function gethiddenproperty(object: Instance, property: string): (unknown, boolean)
|
|
147
|
+
declare function sethiddenproperty(object: Instance, property: string, value: unknown): boolean
|
|
148
|
+
declare function isscriptable(object: Instance, property: string): boolean
|
|
149
|
+
declare function setscriptable(object: Instance, property: string, scriptable: boolean): boolean
|
|
150
|
+
|
|
151
|
+
-- The function assigned to a callback property (`OnServerInvoke`, ...).
|
|
152
|
+
declare function getcallbackvalue(object: Instance, property: string): ((...unknown) => ...unknown) | nil
|
|
153
|
+
|
|
154
|
+
declare function setrbxclipboard(data: string): boolean
|
|
155
|
+
|
|
156
|
+
declare cache: {
|
|
157
|
+
-- Forget an instance, so the next reference to it is a new one.
|
|
158
|
+
invalidate: (object: Instance) => (),
|
|
159
|
+
-- Point every future reference to `object` at `newObject` instead.
|
|
160
|
+
replace: (object: Instance, newObject: Instance) => (),
|
|
161
|
+
iscached: (object: Instance) => boolean,
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
-- ============================================================
|
|
165
|
+
-- Signals and events
|
|
166
|
+
-- ============================================================
|
|
167
|
+
|
|
168
|
+
-- One connection of a signal. `Function` and `Thread` are nil for connections
|
|
169
|
+
-- the engine made itself.
|
|
170
|
+
type Connection = {
|
|
171
|
+
Function: ((...unknown) => ...unknown) | nil,
|
|
172
|
+
Thread: thread | nil,
|
|
173
|
+
Enabled: boolean,
|
|
174
|
+
ForeignState: boolean,
|
|
175
|
+
LuaConnection: boolean,
|
|
176
|
+
Fire: (self: Connection, ...unknown) => (),
|
|
177
|
+
Defer: (self: Connection, ...unknown) => (),
|
|
178
|
+
Disconnect: (self: Connection) => (),
|
|
179
|
+
Disable: (self: Connection) => (),
|
|
180
|
+
Enable: (self: Connection) => (),
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
-- Any signal at all. Written as the shape every signal has rather than as
|
|
184
|
+
-- `RBXScriptSignal<T...>`, because a signal's type carries the argument pack
|
|
185
|
+
-- of its own event and these functions do not care which event it is.
|
|
186
|
+
type AnySignal = { Connect: (self: unknown, callback: (...unknown) => ()) => RBXScriptConnection }
|
|
187
|
+
|
|
188
|
+
declare function getconnections(signal: AnySignal): Connection[]
|
|
189
|
+
|
|
190
|
+
-- Run every Luau connection of a signal now.
|
|
191
|
+
declare function firesignal(signal: AnySignal, ...: unknown): ()
|
|
192
|
+
|
|
193
|
+
-- Send a signal to the server, for the signals that replicate.
|
|
194
|
+
declare function replicatesignal(signal: AnySignal, ...: unknown): ()
|
|
195
|
+
|
|
196
|
+
declare function fireclickdetector(object: ClickDetector, distance?: number, event?: string): ()
|
|
197
|
+
declare function fireproximityprompt(prompt: ProximityPrompt): ()
|
|
198
|
+
|
|
199
|
+
-- `toggle` is true (or 0) to begin the touch and false (or 1) to end it.
|
|
200
|
+
declare function firetouchinterest(part: BasePart, other: BasePart, toggle: boolean | number): ()
|
|
201
|
+
|
|
202
|
+
-- ============================================================
|
|
203
|
+
-- Filesystem
|
|
204
|
+
-- ============================================================
|
|
205
|
+
--
|
|
206
|
+
-- Paths are relative to the executor's own workspace folder.
|
|
207
|
+
|
|
208
|
+
declare function readfile(path: string): string
|
|
209
|
+
declare function writefile(path: string, data: string): ()
|
|
210
|
+
declare function appendfile(path: string, data: string): ()
|
|
211
|
+
declare function delfile(path: string): ()
|
|
212
|
+
declare function isfile(path: string): boolean
|
|
213
|
+
declare function listfiles(path: string): string[]
|
|
214
|
+
declare function makefolder(path: string): ()
|
|
215
|
+
declare function delfolder(path: string): ()
|
|
216
|
+
declare function isfolder(path: string): boolean
|
|
217
|
+
declare function dofile(path: string): ()
|
|
218
|
+
|
|
219
|
+
-- A `rbxasset://` id for a file on disk, usable wherever the engine takes a
|
|
220
|
+
-- content id (images, sounds, meshes).
|
|
221
|
+
declare function getcustomasset(path: string, noCache?: boolean): string
|
|
222
|
+
|
|
223
|
+
-- ============================================================
|
|
224
|
+
-- HTTP and encoding
|
|
225
|
+
-- ============================================================
|
|
226
|
+
|
|
227
|
+
type HttpRequest = {
|
|
228
|
+
Url: string,
|
|
229
|
+
Method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD" | "OPTIONS",
|
|
230
|
+
Body?: string,
|
|
231
|
+
Headers?: { [string]: string },
|
|
232
|
+
Cookies?: { [string]: string },
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
type HttpResponse = {
|
|
236
|
+
Body: string,
|
|
237
|
+
StatusCode: number,
|
|
238
|
+
StatusMessage: string,
|
|
239
|
+
Success: boolean,
|
|
240
|
+
Headers: { [string]: string },
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
-- Yields until the response arrives.
|
|
244
|
+
declare function request(options: HttpRequest): HttpResponse
|
|
245
|
+
|
|
246
|
+
declare function base64encode(data: string): string
|
|
247
|
+
declare function base64decode(data: string): string
|
|
248
|
+
declare function lz4compress(data: string): string
|
|
249
|
+
declare function lz4decompress(data: string, size: number): string
|
|
250
|
+
|
|
251
|
+
-- UNC put the encoding and cipher helpers in one table; executors still do.
|
|
252
|
+
declare crypt: {
|
|
253
|
+
base64encode: (data: string) => string,
|
|
254
|
+
base64decode: (data: string) => string,
|
|
255
|
+
encrypt: (data: string, key: string, iv?: string, mode?: string) => (string, string),
|
|
256
|
+
decrypt: (data: string, key: string, iv: string, mode: string) => string,
|
|
257
|
+
hash: (data: string, algorithm: string) => string,
|
|
258
|
+
generatebytes: (size: number) => string,
|
|
259
|
+
generatekey: () => string,
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
type WebSocketConnection = {
|
|
263
|
+
Send: (self: WebSocketConnection, message: string) => (),
|
|
264
|
+
Close: (self: WebSocketConnection) => (),
|
|
265
|
+
OnMessage: RBXScriptSignal<string>,
|
|
266
|
+
OnClose: RBXScriptSignal<()>,
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare WebSocket: {
|
|
270
|
+
connect: (url: string) => WebSocketConnection,
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
-- ============================================================
|
|
274
|
+
-- Drawing
|
|
275
|
+
-- ============================================================
|
|
276
|
+
--
|
|
277
|
+
-- Shapes drawn above the game window. `Drawing.new` gives back the type its
|
|
278
|
+
-- argument names, so `Drawing.new("Circle").Radius` is a number and
|
|
279
|
+
-- `Drawing.new("Line").Radius` is an error.
|
|
280
|
+
|
|
281
|
+
type BaseDrawing = {
|
|
282
|
+
Visible: boolean,
|
|
283
|
+
ZIndex: number,
|
|
284
|
+
Transparency: number,
|
|
285
|
+
Color: Color3,
|
|
286
|
+
Destroy: (self: BaseDrawing) => (),
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
type DrawingLine = BaseDrawing & { From: Vector2, To: Vector2, Thickness: number }
|
|
290
|
+
type DrawingText = BaseDrawing & {
|
|
291
|
+
Text: string,
|
|
292
|
+
TextBounds: Vector2,
|
|
293
|
+
Font: number,
|
|
294
|
+
Size: number,
|
|
295
|
+
Position: Vector2,
|
|
296
|
+
Center: boolean,
|
|
297
|
+
Outline: boolean,
|
|
298
|
+
OutlineColor: Color3,
|
|
299
|
+
}
|
|
300
|
+
type DrawingImage = BaseDrawing & { Data: string, Size: Vector2, Position: Vector2, Rounding: number }
|
|
301
|
+
type DrawingCircle = BaseDrawing & {
|
|
302
|
+
NumSides: number, Radius: number, Position: Vector2, Thickness: number, Filled: boolean,
|
|
303
|
+
}
|
|
304
|
+
type DrawingSquare = BaseDrawing & {
|
|
305
|
+
Size: Vector2, Position: Vector2, Thickness: number, Filled: boolean,
|
|
306
|
+
}
|
|
307
|
+
type DrawingQuad = BaseDrawing & {
|
|
308
|
+
PointA: Vector2, PointB: Vector2, PointC: Vector2, PointD: Vector2, Thickness: number, Filled: boolean,
|
|
309
|
+
}
|
|
310
|
+
type DrawingTriangle = BaseDrawing & {
|
|
311
|
+
PointA: Vector2, PointB: Vector2, PointC: Vector2, Thickness: number, Filled: boolean,
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
type Drawing = DrawingLine | DrawingText | DrawingImage | DrawingCircle
|
|
315
|
+
| DrawingSquare | DrawingQuad | DrawingTriangle
|
|
316
|
+
|
|
317
|
+
declare Drawing: {
|
|
318
|
+
new: ((kind: "Line") => DrawingLine)
|
|
319
|
+
& ((kind: "Text") => DrawingText)
|
|
320
|
+
& ((kind: "Image") => DrawingImage)
|
|
321
|
+
& ((kind: "Circle") => DrawingCircle)
|
|
322
|
+
& ((kind: "Square") => DrawingSquare)
|
|
323
|
+
& ((kind: "Quad") => DrawingQuad)
|
|
324
|
+
& ((kind: "Triangle") => DrawingTriangle),
|
|
325
|
+
Fonts: { UI: number, System: number, Plex: number, Monospace: number },
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
-- Destroy every drawing at once; references to them stop working.
|
|
329
|
+
declare function cleardrawcache(): ()
|
|
330
|
+
|
|
331
|
+
declare function getrenderproperty(drawing: Drawing, property: string): unknown
|
|
332
|
+
declare function setrenderproperty(drawing: Drawing, property: string, value: unknown): ()
|
|
333
|
+
declare function isrenderobj(object: unknown): boolean
|
|
334
|
+
|
|
335
|
+
-- ============================================================
|
|
336
|
+
-- Console
|
|
337
|
+
-- ============================================================
|
|
338
|
+
|
|
339
|
+
declare function rconsolecreate(): ()
|
|
340
|
+
declare function rconsoledestroy(): ()
|
|
341
|
+
declare function rconsoleclear(): ()
|
|
342
|
+
declare function rconsoleprint(text: string): ()
|
|
343
|
+
declare function rconsolesettitle(title: string): ()
|
|
344
|
+
declare function rconsoleinput(): string
|
|
345
|
+
|
|
346
|
+
-- ============================================================
|
|
347
|
+
-- Input
|
|
348
|
+
-- ============================================================
|
|
349
|
+
--
|
|
350
|
+
-- Real mouse and keyboard events, delivered to the window. They do nothing
|
|
351
|
+
-- while the Roblox window is not the active one — `isrbxactive` says whether
|
|
352
|
+
-- it is.
|
|
353
|
+
|
|
354
|
+
declare function isrbxactive(): boolean
|
|
355
|
+
declare function mouse1click(): ()
|
|
356
|
+
declare function mouse1press(): ()
|
|
357
|
+
declare function mouse1release(): ()
|
|
358
|
+
declare function mouse2click(): ()
|
|
359
|
+
declare function mouse2press(): ()
|
|
360
|
+
declare function mouse2release(): ()
|
|
361
|
+
declare function mousemoveabs(x: number, y: number): ()
|
|
362
|
+
declare function mousemoverel(x: number, y: number): ()
|
|
363
|
+
declare function mousescroll(pixels: number): ()
|
|
364
|
+
|
|
365
|
+
-- ============================================================
|
|
366
|
+
-- Debug
|
|
367
|
+
-- ============================================================
|
|
368
|
+
--
|
|
369
|
+
-- These add to the `debug` of `@tilua-types/lua` and `@tilua-types/roblox`: the executor
|
|
370
|
+
-- reaches into a function's own bytecode. Each takes a function, or a stack
|
|
371
|
+
-- level counted from the caller.
|
|
372
|
+
|
|
373
|
+
declare debug: {
|
|
374
|
+
getconstant: (func: ((...unknown) => ...unknown) | number, index: number) => unknown,
|
|
375
|
+
getconstants: (func: ((...unknown) => ...unknown) | number) => unknown[],
|
|
376
|
+
setconstant: (func: ((...unknown) => ...unknown) | number, index: number, value: unknown) => (),
|
|
377
|
+
getupvalue: (func: ((...unknown) => ...unknown) | number, index: number) => unknown,
|
|
378
|
+
getupvalues: (func: ((...unknown) => ...unknown) | number) => unknown[],
|
|
379
|
+
setupvalue: (func: ((...unknown) => ...unknown) | number, index: number, value: unknown) => (),
|
|
380
|
+
getproto: (func: ((...unknown) => ...unknown) | number, index: number, active?: boolean)
|
|
381
|
+
=> ((...unknown) => ...unknown) | ((...unknown) => ...unknown)[],
|
|
382
|
+
getprotos: (func: ((...unknown) => ...unknown) | number) => ((...unknown) => ...unknown)[],
|
|
383
|
+
getstack: (level: number, index?: number) => unknown,
|
|
384
|
+
setstack: (level: number, index: number, value: unknown) => (),
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
-- ============================================================
|
|
388
|
+
-- Miscellaneous
|
|
389
|
+
-- ============================================================
|
|
390
|
+
|
|
391
|
+
-- The executor's name and version.
|
|
392
|
+
declare function identifyexecutor(): (string, string)
|
|
393
|
+
|
|
394
|
+
declare function setclipboard(text: string): ()
|
|
395
|
+
declare function setfpscap(fps: number): ()
|
|
396
|
+
declare function messagebox(text: string, caption: string, flags: number): number
|
|
397
|
+
|
|
398
|
+
-- Source to run after the next teleport, in the new place.
|
|
399
|
+
declare function queue_on_teleport(code: string): ()
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tilua-types/sunc",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The script-executor environment as tilua types: sUNC and UNC names (getgenv, writefile, hookfunction, Drawing, ...)",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.d.tilua",
|
|
8
|
+
"README.md"
|
|
9
|
+
],
|
|
10
|
+
"tilua": {
|
|
11
|
+
"types": "index.d.tilua"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@tilua-types/roblox": "^1.0.0"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"tilua",
|
|
18
|
+
"luau",
|
|
19
|
+
"roblox",
|
|
20
|
+
"sunc",
|
|
21
|
+
"unc",
|
|
22
|
+
"types"
|
|
23
|
+
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/Uav3537/tilua-types.git",
|
|
27
|
+
"directory": "packages/sunc"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
32
|
+
}
|