LogoAntiRaid

@antiraid/typesext

API reference for @antiraid/typesext

@antiraid/typesext

Types

MultiOption

A multi option is either T (Some(Some(T)), a empty table (Some(None)), or nil (None)

Raw Type
--- A multi option is either T (Some(Some(T)), a empty table (Some(None)), or nil (None)
type MultiOption<T> = T | {} | nil

Union with variants:

Variant 1

T

Variant 2
PropTypeDescription
Variant 3

nil

U64Convertibles

Raw Type
type U64Convertibles = U64 | string | number

Union with variants:

Variant 1

U64

Variant 2

string

Variant 3

number

U64

A U64 is a 64 bit unsigned integer. A U64 can be implicitly created from a number or a string

Note: A U64

Raw Type
--- A U64 is a 64 bit unsigned integer. A U64 can be implicitly created from a number or a string
---
--- Note: A U64
type U64 = {
	to_ne_bytes: (self: U64) -> {number},

	from_ne_bytes: (self: U64, bytes: {number}) -> U64,

	to_le_bytes: (self: U64) -> {number},

	from_le_bytes: (self: U64, bytes: {number}) -> U64,

	to_be_bytes: (self: U64) -> {number},

	from_be_bytes: (self: U64, bytes: {number}) -> U64,

	to_i64: (self: U64) -> I64,

	-- Metatable
	__add: (self: U64, other: U64Convertibles) -> U64,
	__sub: (self: U64, other: U64Convertibles) -> U64,
	__mul: (self: U64, other: U64Convertibles) -> U64,
	__div: (self: U64, other: U64Convertibles) -> U64,
	-- This is the same as IDiv right now
	__mod: (self: U64, other: number) -> U64,
	__pow: (self: U64, other: U64Convertibles) -> U64,
	__idiv: (self: U64, other: U64Convertibles) -> U64,
	-- This is the same as Div right now
	__eq: (self: U64, other: U64Convertibles) -> boolean,
	__lt: (self: U64, other: U64Convertibles) -> boolean,
	__le: (self: U64, other: U64Convertibles) -> boolean,
	__tostring: (self: U64) -> string,
	__type: "U64"
}
PropTypeDescription
to_ne_bytes
(self) -> {number}
-
from_ne_bytes
(self, bytes: {number}) -> U64
-
to_le_bytes
(self) -> {number}
-
from_le_bytes
(self, bytes: {number}) -> U64
-
to_be_bytes
(self) -> {number}
-
from_be_bytes
(self, bytes: {number}) -> U64
-
to_i64
(self) -> I64
-
__add
(self, other: U64Convertibles) -> U64
-
__sub
(self, other: U64Convertibles) -> U64
-
__mul
(self, other: U64Convertibles) -> U64
-
__div
(self, other: U64Convertibles) -> U64
-
__mod
(self, other: number) -> U64
-
__pow
(self, other: U64Convertibles) -> U64
-
__idiv
(self, other: U64Convertibles) -> U64
-
__eq
(self, other: U64Convertibles) -> boolean
-
__lt
(self, other: U64Convertibles) -> boolean
-
__le
(self, other: U64Convertibles) -> boolean
-
__tostring
(self) -> string
-
__type
'U64'
-

I64Convertibles

Raw Type
type I64Convertibles = U64 | I64 | string | number

Union with variants:

Variant 1

U64

Variant 2

I64

Variant 3

string

Variant 4

number

I64

Raw Type
type I64 = {
	to_ne_bytes: (self: I64) -> {number},

	from_ne_bytes: (self: I64, bytes: {number}) -> I64,

	to_le_bytes: (self: I64) -> {number},

	from_le_bytes: (self: I64, bytes: {number}) -> I64,

	to_be_bytes: (self: I64) -> {number},

	from_be_bytes: (self: I64, bytes: {number}) -> I64,

	to_u64: (self: I64) -> U64,

	-- Metatable
	__add: (self: I64, other: I64 | string | number) -> I64,
	__sub: (self: I64, other: I64 | string | number) -> I64,
	__mul: (self: I64, other: I64 | string | number) -> I64,
	__div: (self: I64, other: I64 | string | number) -> I64,
	__mod: (self: I64, other: number) -> I64,
	__pow: (self: I64, other: I64 | string | number) -> I64,
	__idiv: (self: I64, other: I64 | string | number) -> I64,
	__eq: (self: I64, other: I64 | string | number) -> boolean,
	__lt: (self: I64, other: I64 | string | number) -> boolean,
	__le: (self: I64, other: I64 | string | number) -> boolean,
	__tostring: (self: I64) -> string,
	__type: "I64"
}
PropTypeDescription
to_ne_bytes
(self) -> {number}
-
from_ne_bytes
(self, bytes: {number}) -> I64
-
to_le_bytes
(self) -> {number}
-
from_le_bytes
(self, bytes: {number}) -> I64
-
to_be_bytes
(self) -> {number}
-
from_be_bytes
(self, bytes: {number}) -> I64
-
to_u64
(self) -> U64
-
__add
(self, other: (I64 | string | number)) -> I64
-
__sub
(self, other: (I64 | string | number)) -> I64
-
__mul
(self, other: (I64 | string | number)) -> I64
-
__div
(self, other: (I64 | string | number)) -> I64
-
__mod
(self, other: number) -> I64
-
__pow
(self, other: (I64 | string | number)) -> I64
-
__idiv
(self, other: (I64 | string | number)) -> I64
-
__eq
(self, other: (I64 | string | number)) -> boolean
-
__lt
(self, other: (I64 | string | number)) -> boolean
-
__le
(self, other: (I64 | string | number)) -> boolean
-
__tostring
(self) -> string
-
__type
'I64'
-

BitU64

[[ /// Aim is to implement as many functions from https://luau.org/library#bit32-library as possible but for 64 bit unsigned integers /// /// arshift, band, bnot, bor, bxor, btest, extract, lrotate, lshift, replace, rrotate, rshift, countlz /// countrz, byteswap /// /// Implemented: /// - band /// - bnot /// - bor /// - bxor /// - btest /// - extract /// - lrotate /// - lshift /// - replace /// - rrotate /// - rshift /// - countlz /// - countrz /// - byteswap /// /// Not yet implemented due to spec difficulties: /// - arshift ]]

Raw Type
--[[
/// Aim is to implement as many functions from https://luau.org/library#bit32-library as possible but for 64 bit unsigned integers
///
/// arshift, band, bnot, bor, bxor, btest, extract, lrotate, lshift, replace, rrotate, rshift, countlz
/// countrz, byteswap
///
/// Implemented:
/// - band
/// - bnot
/// - bor
/// - bxor
/// - btest
/// - extract
/// - lrotate
/// - lshift
/// - replace
/// - rrotate
/// - rshift
/// - countlz
/// - countrz
/// - byteswap
///
/// Not yet implemented due to spec difficulties:
/// - arshift
]]
type BitU64 = {
	band: (...: ...U64Convertibles) -> U64,

	bnot: (U64Convertibles) -> U64,

	bor: (...: ...U64Convertibles) -> U64,

	bxor: (...: ...U64Convertibles) -> U64,

	btest: (...: ...U64Convertibles) -> boolean,

	--- Untested and might not work yet. f must be less than 64
	extract: (n: U64Convertibles, f: number, w: number?) -> U64,

	lrotate: (n: U64Convertibles, i: number) -> U64,

	lshift: (n: U64Convertibles, i: number) -> U64,

	--- Untested and might not work yet. f must be less than 64
	replace: (n: U64Convertibles, r: number, f: number, w: number?) -> U64,

	rrotate: (n: U64Convertibles, i: number) -> U64,

	rshift: (n: U64Convertibles, i: number) -> U64,

	countlz: (n: U64Convertibles) -> number,

	countrz: (n: U64Convertibles) -> number,

	byteswap: (n: U64Convertibles) -> U64
}
PropTypeDescription
band
(...: ...U64Convertibles) -> U64
-
bnot
-
bor
(...: ...U64Convertibles) -> U64
-
bxor
(...: ...U64Convertibles) -> U64
-
btest
-
extract
(n: U64Convertibles, f: number, w: number?) -> U64
Untested and might not work yet. f must be less than 64
lrotate
-
lshift
-
replace
(n: U64Convertibles, r: number, f: number, w: number?) -> U64
Untested and might not work yet. f must be less than 64
rrotate
-
rshift
-
countlz
-
countrz
-
byteswap
-

Functions

U64

Creates a U64 from a number or string

If nil is passed, 0 is used as default

Function Signature
--- Creates a U64 from a number or string
---
--- If nil is passed, 0 is used as default
function U64(value: U64Convertibles | nil) -> U64 end

Arguments

value

Union with variants:

Variant 1

U64Convertibles

Variant 2

nil

Returns

ret1

U64

I64

Creates a I64 from a number or string

If nil is passed, 0 is used as default

Function Signature
--- Creates a I64 from a number or string
---
--- If nil is passed, 0 is used as default
function I64(value: I64 | string | number | nil) -> I64 end

Arguments

value

Union with variants:

Variant 1

I64

Variant 2

string

Variant 3

number

Variant 4

nil

Returns

ret1

I64

randstring

Generates a random string of length `length`

Function Signature
--- Generates a random string of length \`length\`
function randstring(length: number) -> string end

Arguments

length

number

Returns

ret1

string

Last updated on