Skip to main content

Class: List<T>

A type that represents a list of items of a specific type. Similar to an array in JavaScript.

Type Parameters​

Type ParameterDescription

T

The type of the items in the list.

Implements​

Accessors​

of​

Get Signature​

get of(): Schema<T>

Gets the base type of the items in the list.

Returns​

Schema<T>

Defined in​

types/list.ts:28

Constructors​

new List()​

new List<T>(of: Schema<T>): List<T>

Creates a new list type.

Parameters​

ParameterTypeDescription

of

Schema<T>

The type of the items in the list.

Returns​

List<T>

Defined in​

types/list.ts:21

Methods​

write()​

write(writer: ByteStreamWriter, value: T[]): void

Writes the list to the buffer.

Parameters​

ParameterTypeDescription

writer

ByteStreamWriter

The buffer writer.

value

T[]

An array of items to write.

Returns​

void

Implementation of​

Schema.write

Defined in​

types/list.ts:37


read()​

read(reader: ByteStreamReader): T[]

Reads the list from the buffer.

Parameters​

ParameterTypeDescription

reader

ByteStreamReader

The buffer reader.

Returns​

T[]

An array of items read from the buffer.

Implementation of​

Schema.read

Defined in​

types/list.ts:50