ReverseModel
Defined in: api/node/typescript/models.ts:674 ↗
ReverseModel acts as an adapter model for a given source model by reversing all its rows. This means that the first row in the source model is the last row of this model, the second row is the second last, and so on.
Example
Section titled “Example”const source = new ArrayModel([1, 2, 3, 4, 5]);const reversed = new ReverseModel(source);
// prints 5, 4, 3, 2, 1for (const x of reversed) { console.log(x);}Extends
Section titled “Extends”NativeAdapterModel<T>
Type Parameters
Section titled “Type Parameters”T
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ReverseModel<
T>(sourceModel):ReverseModel<T>
Defined in: api/node/typescript/models.ts:685 ↗
Constructs a new ReverseModel that provides a reversed view on the given
sourceModel.
Parameters
Section titled “Parameters”sourceModel
Section titled “sourceModel”Model<T>
the wrapped model.
Returns
Section titled “Returns”ReverseModel<T>
Overrides
Section titled “Overrides”NativeAdapterModel<T>.constructor
Properties
Section titled “Properties”sourceModel
Section titled “sourceModel”
readonlysourceModel:Model<T>
Defined in: api/node/typescript/models.ts:678 ↗
The source model that this ReverseModel reverses rows from.
Accessors
Section titled “Accessors”[nativeModelKey]
Section titled “[nativeModelKey]”Get Signature
Section titled “Get Signature”get [nativeModelKey]():
NativeModel|undefined
Defined in: api/node/typescript/models.ts:424 ↗
Returns
Section titled “Returns”NativeModel | undefined
Inherited from
Section titled “Inherited from”NativeAdapterModel.[nativeModelKey]
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
Iterator<T>
Defined in: api/node/typescript/models.ts:195 ↗
Returns
Section titled “Returns”Iterator<T>
Inherited from
Section titled “Inherited from”NativeAdapterModel.[iterator]
filter()
Section titled “filter()”filter(
filterFunction):FilterModel<T>
Defined in: api/node/typescript/models.ts:118 ↗
Returns a new Model that only contains the rows of this model for which
filterFunction returns true.
Parameters
Section titled “Parameters”filterFunction
Section titled “filterFunction”(data) => boolean
returns true if a row should be visible.
Returns
Section titled “Returns”FilterModel<T>
a new FilterModel that wraps the current model.
Inherited from
Section titled “Inherited from”NativeAdapterModel.filter
insertRow()
Section titled “insertRow()”insertRow(
_index,_data):void
Defined in: api/node/typescript/models.ts:191 ↗
Implementations of this function must add a row at the specified index, pushing all next rows to the right. Throws when the model rejects the modification; the default implementation always throws.
Parameters
Section titled “Parameters”_index
Section titled “_index”number
index of the row to insert.
T
new data item to store in a new row.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”NativeAdapterModel.insertRow
map<
U>(mapFunction):MapModel<T,U>
Defined in: api/node/typescript/models.ts:108 ↗
Returns a new Model where all elements are mapped by the function mapFunction.
Type Parameters
Section titled “Type Parameters”U
Parameters
Section titled “Parameters”mapFunction
Section titled “mapFunction”(data) => U
maps the data from T to U.
Returns
Section titled “Returns”MapModel<T, U>
a new MapModel that wraps the current model.
Inherited from
Section titled “Inherited from”NativeAdapterModel.map
pushRow()
Section titled “pushRow()”pushRow(
data):void
Defined in: api/node/typescript/models.ts:169 ↗
Adds a line to the model with the provided data. Throws when the model rejects the modification. The default implementation calls Model.insertRow with the row count.
Parameters
Section titled “Parameters”T
new data item to store in a new row.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”NativeAdapterModel.pushRow
removeRow()
Section titled “removeRow()”removeRow(
_index):void
Defined in: api/node/typescript/models.ts:179 ↗
Implementations of this function must remove the row at the specified index. Throws when the model rejects the modification; the default implementation always throws.
Parameters
Section titled “Parameters”_index
Section titled “_index”number
index of the row to remove.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”NativeAdapterModel.removeRow
reverse()
Section titled “reverse()”reverse():
ReverseModel<T>
Defined in: api/node/typescript/models.ts:137 ↗
Returns a new Model with the same rows as this model, in reverse order.
Returns
Section titled “Returns”ReverseModel<T>
a new ReverseModel that wraps the current model.
Inherited from
Section titled “Inherited from”NativeAdapterModel.reverse
rowCount()
Section titled “rowCount()”rowCount():
number
Defined in: api/node/typescript/models.ts:436 ↗
Returns the number of entries in the model.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”NativeAdapterModel.rowCount
rowData()
Section titled “rowData()”rowData(
row):T|undefined
Defined in: api/node/typescript/models.ts:445 ↗
Returns the data at the specified row.
Parameters
Section titled “Parameters”number
index in range 0..(rowCount() - 1).
Returns
Section titled “Returns”T | undefined
undefined if row is out of range otherwise the data.
Inherited from
Section titled “Inherited from”NativeAdapterModel.rowData
setRowData()
Section titled “setRowData()”setRowData(
row,data):void
Defined in: api/node/typescript/models.ts:455 ↗
Stores the given data in the source model at the row that corresponds to the given row index.
Parameters
Section titled “Parameters”number
index in range 0..(rowCount() - 1).
T
new data item to store on the given row index.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”NativeAdapterModel.setRowData
sort()
Section titled “sort()”sort(
compareFunction):SortModel<T>
Defined in: api/node/typescript/models.ts:129 ↗
Returns a new Model with the same rows as this model, ordered according to
compareFunction.
Parameters
Section titled “Parameters”compareFunction
Section titled “compareFunction”(a, b) => number
compares two rows the same way the callback passed to Array.prototype.sort does.
Returns
Section titled “Returns”SortModel<T>
a new SortModel that wraps the current model.
Inherited from
Section titled “Inherited from”NativeAdapterModel.sort
© 2026 SixtyFPS GmbH