LogoAntiRaid

@antiraid/luau

API reference for @antiraid/luau

@antiraid/luau

Types

Chunk

Raw Type
type Chunk = {
	--- Sets the environment of the chunk (_G).
	environment: {
		[any]: any
	}?,

	--- Sets the optimization level of the chunk.
	optimization_level: number?,

	--- Text code to be evaluated. Bytecode evaluation is not allowed due to
	--- security reasons.
	code: string,

	---  The name of the chunk, used for debugging purposes.
	chunk_name: string?,

	--- Takes in args and returns the returned values from the \`\`code\`\` being evaluated. This will run the code in main thread / coroutine.running() == nil
	call: (self: Chunk, args: any) -> any,

	--- @yields
	---
	--- Takes in args and returns the returned values from the \`\`code\`\` being evaluated.
	---
	--- This runs the code asynchronously within a coroutine, allowing it to call
	--- yielding functions
	call_async: (self: Chunk, args: any) -> any
}
PropTypeDescription
call
(self, args: any) -> any
Takes in args and returns the returned values from the ``code`` being evaluated. This will run the code in main thread / coroutine.running() == nil
call_async
(self, args: any) -> any
@yields Takes in args and returns the returned values from the ``code`` being evaluated.This runs the code asynchronously within a coroutine, allowing it to callyielding functions
environment?
{[any]: any}?
Sets the environment of the chunk (_G).
optimization_level?
Sets the optimization level of the chunk.
code
Text code to be evaluated. Bytecode evaluation is not allowed due tosecurity reasons.
chunk_name?
The name of the chunk, used for debugging purposes.

Functions

load

Loads a Luau chunk.

Function Signature
--- Loads a Luau chunk.
function load(code: string) -> Chunk end

Arguments

code

string

Returns

ret1

Chunk

format

Formats a set of values to a string

Function Signature
--- Formats a set of values to a string
function format(...: any) -> string end

Arguments

...

any

Returns

ret1

string

Last updated on