LogoAntiRaid

@antiraid-ext/datatypes

API reference for @antiraid-ext/datatypes

@antiraid-ext/datatypes

Types

Queue

A simple queue implementation in Luau.

Raw Type
--- A simple queue implementation in Luau.
type Queue<T> = {
	_first: number,

	_last: number,

	_queue: {T},

	isEmpty: (self: Queue<T>) -> boolean,

	enqueue: (self: Queue<T>, value: T) -> (),

	dequeue: (self: Queue<T>) -> T
}
PropTypeDescription
_first
-
_last
-
_queue
{T}
-
isEmpty
(self) -> boolean
-
enqueue
(self, value: T) -> ()
-
dequeue
(self) -> T
-

Stack

A simple stack implementation in Luau.

Raw Type
--- A simple stack implementation in Luau.
type Stack<T> = {
	_stack: {T},

	isEmpty: (self: Stack<T>) -> boolean,

	push: (self: Stack<T>, value: T) -> (),

	pop: (self: Stack<T>) -> T
}
PropTypeDescription
isEmpty
(self) -> boolean
-
push
(self, value: T) -> ()
-
pop
(self) -> T
-
_stack
{T}
-

Functions

Queue.new

Create a new queue

Function Signature
--- Create a new queue
function Queue.new<T>() -> Queue<T> end

Generics

T

This generic is unconstrained and can be any type

Returns

ret1

Queue<T>

Queue.isEmpty

Check if the queue is empty

Function Signature
-- Check if the queue is empty
function Queue.isEmpty<T>(self: Queue<T>) end

Generics

T

This generic is unconstrained and can be any type

Queue.enqueue

Add a value to the queue

Function Signature
--- Add a value to the queue
function Queue.enqueue<T>(self: Queue<T>, value: T) end

Generics

T

This generic is unconstrained and can be any type

Arguments

value

T

Queue.dequeue

Remove a value from the queue

Function Signature
--- Remove a value from the queue
function Queue.dequeue<T>(self: Queue<T>) -> T end

Generics

T

This generic is unconstrained and can be any type

Returns

ret1

T

Stack.new

Create a new stack

Function Signature
--- Create a new stack
function Stack.new<T>() -> Stack<T> end

Generics

T

This generic is unconstrained and can be any type

Returns

ret1

Stack<T>

Stack.isEmpty

Check if the stack is empty

Function Signature
--- Check if the stack is empty
function Stack.isEmpty<T>(self: Stack<T>) end

Generics

T

This generic is unconstrained and can be any type

Stack.push

Put a new value onto the stack

Function Signature
--- Put a new value onto the stack
function Stack.push<T>(self: Stack<T>, value) end

Generics

T

This generic is unconstrained and can be any type

Arguments

value

No type specified!!!

Stack.pop

Take a value off the stack

Function Signature
--- Take a value off the stack
function Stack.pop<T>(self: Stack<T>) end

Generics

T

This generic is unconstrained and can be any type

Last updated on