Skip to content

ArrayModel

Defined in: api/node/typescript/models.ts:180

ArrayModel wraps a JavaScript array for use in .slint views. The underlying array can be modified with the [[ArrayModel.push]] and [[ArrayModel.remove]] methods.

T

new ArrayModel<T>(arr): ArrayModel<T>

Defined in: api/node/typescript/models.ts:191

Creates a new ArrayModel.

T[]

ArrayModel<T>

Model<T>.constructor

get length(): number

Defined in: api/node/typescript/models.ts:199

Returns the number of entries in the array model.

number

[iterator](): Iterator<T>

Defined in: api/node/typescript/models.ts:138

Iterator<T>

Model.[iterator]


entries(): IterableIterator<[number, T]>

Defined in: api/node/typescript/models.ts:275

Returns an iterable of key, value pairs for every entry in the array.

IterableIterator<[number, T]>


pop(): T | undefined

Defined in: api/node/typescript/models.ts:245

Removes the last element from the array and returns it.

T | undefined

The removed element or undefined if the array is empty.


push(…values): void

Defined in: api/node/typescript/models.ts:234

Pushes new values to the array that’s backing the model and notifies the run-time about the added rows.

T[]

list of values that will be pushed to the array.

void


remove(index, size): void

Defined in: api/node/typescript/models.ts:260

Removes the specified number of element from the array that’s backing the model, starting at the specified index.

number

index of first row to remove.

number

number of rows to remove.

void


rowCount(): number

Defined in: api/node/typescript/models.ts:206

Returns the number of entries in the array model.

number

Model.rowCount


rowData(row): T

Defined in: api/node/typescript/models.ts:215

Returns the data at the specified row.

number

index in range 0..(rowCount() - 1).

T

undefined if row is out of range otherwise the data.

Model.rowData


setRowData(row, data): void

Defined in: api/node/typescript/models.ts:224

Stores the given data on the given row index and notifies run-time about the changed row.

number

index in range 0..(rowCount() - 1).

T

new data item to store on the given row index

void

Model.setRowData


values(): IterableIterator<T>

Defined in: api/node/typescript/models.ts:268

Returns an iterable of values in the array.

IterableIterator<T>


© 2026 SixtyFPS GmbH