Skip to main content

Table Interface

A table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature​

/** @sealed */
interface Table<TUserScope extends string, TCell extends ImplicitAllowedTypes, TColumn extends System_TableSchema.ColumnSchemaBase<TUserScope, TCell>, TRow extends System_TableSchema.RowSchemaBase<TUserScope, TCell>>

Type Parameters​

ParameterConstraintDescription
TUserScopestringThe schema factory scope.
TCellImplicitAllowedTypesThe type of the cells in the table.
TColumnSystem_TableSchema.ColumnSchemaBase<TUserScope, TCell>The type of the columns in the table.
TRowSystem_TableSchema.RowSchemaBase<TUserScope, TCell>The type of the rows in the table.

Remarks​

Table schema is created via the table(params) factory. Node instances of the schema type should be constructed via the static create method on the schema class. E.g. const table = MyTableSchema.create({ columns, rows});

Properties​

PropertyAlertsModifiersTypeDescription
columnsBetareadonlySystem_TableSchema.RearrangeableList<TColumn>The table's columns.
rowsBetareadonlySystem_TableSchema.RearrangeableList<TRow>The table's rows.

Methods​

MethodAlertsReturn TypeDescription
getCell(key)BetaTreeNodeFromImplicitAllowedTypes<TCell> | undefinedGets a cell in the table by corresponding column and row.
getColumn(id)BetaTreeNodeFromImplicitAllowedTypes<TColumn> | undefinedGets a table column by its id.
getColumn(index)BetaTreeNodeFromImplicitAllowedTypes<TColumn> | undefinedGets a table column by its index in the table.
getRow(id)BetaTreeNodeFromImplicitAllowedTypes<TRow> | undefinedGets a table row by its id.
getRow(index)BetaTreeNodeFromImplicitAllowedTypes<TRow> | undefinedGets a table row by its index in the table.
insertColumns(columns, index)BetaTreeNodeFromImplicitAllowedTypes<TColumn>[]Inserts 0 or more columns into the table.
insertColumns(params)Deprecated, BetaTreeNodeFromImplicitAllowedTypes<TColumn>[]Inserts 0 or more columns into the table.
insertRows(rows, index)BetaTreeNodeFromImplicitAllowedTypes<TRow>[]Inserts 0 or more rows into the table.
insertRows(params)Deprecated, BetaTreeNodeFromImplicitAllowedTypes<TRow>[]Inserts 0 or more rows into the table.
removeCell(row, column)BetaTreeNodeFromImplicitAllowedTypes<TCell> | undefinedRemoves the cell at the specified location in the table.
removeCell(key)Deprecated, BetaTreeNodeFromImplicitAllowedTypes<TCell> | undefinedRemoves the cell at the specified location in the table.
removeColumns(index, count)BetaTreeNodeFromImplicitAllowedTypes<TColumn>[]Removes a range of columns from the table.
removeColumns(columns)BetaTreeNodeFromImplicitAllowedTypes<TColumn>[]Removes 0 or more columns from the table.
removeColumns(columns)BetaTreeNodeFromImplicitAllowedTypes<TColumn>[]Removes 0 or more columns from the table.
removeRows(index, count)BetaTreeNodeFromImplicitAllowedTypes<TRow>[]Removes a range of rows from the table.
removeRows(rows)BetaTreeNodeFromImplicitAllowedTypes<TRow>[]Removes 0 or more rows from the table.
removeRows(rows)BetaTreeNodeFromImplicitAllowedTypes<TRow>[]Removes 0 or more rows from the table.
setCell(row, column, cell)BetavoidSets the cell at the specified location in the table.
setCell(params)Deprecated, BetavoidSets the cell at the specified location in the table.

Property Details​

columns​

The table's columns.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

readonly columns: System_TableSchema.RearrangeableList<TColumn>;

Type: System_TableSchema.RearrangeableList<TColumn>

rows​

The table's rows.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

readonly rows: System_TableSchema.RearrangeableList<TRow>;

Type: System_TableSchema.RearrangeableList<TRow>

Method Details​

getCell​

Gets a cell in the table by corresponding column and row.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

getCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;

Parameters​

ParameterTypeDescription
keyCellKey<TColumn, TRow>A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID.

Returns​

The cell, if it exists. Otherwise, undefined.

Return type: TreeNodeFromImplicitAllowedTypes<TCell> | undefined

getColumn​

Gets a table column by its id.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

getColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;

Parameters​

ParameterTypeDescription
idstring

Returns​

The column, if it exists. Otherwise, undefined.

Return type: TreeNodeFromImplicitAllowedTypes<TColumn> | undefined

getColumn​

Gets a table column by its index in the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

getColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;

Remarks​

Note that edits to the table structure (including edits by collaborators) can cause indexes to refer to different columns over time. Therefore, it is recommended to use IDs whenever possible to identify columns.

Parameters​

ParameterTypeDescription
indexnumber

Returns​

The column, if it exists. Otherwise, undefined.

Return type: TreeNodeFromImplicitAllowedTypes<TColumn> | undefined

getRow​

Gets a table row by its id.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;

Parameters​

ParameterTypeDescription
idstring

Returns​

The row, if it exists. Otherwise, undefined.

Return type: TreeNodeFromImplicitAllowedTypes<TRow> | undefined

getRow​

Gets a table row by its index in the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;

Remarks​

Note that edits to the table structure (including edits by collaborators) can cause indexes to refer to different rows over time. Therefore, it is recommended to use IDs whenever possible to identify rows.

Parameters​

ParameterTypeDescription
indexnumber

Returns​

The row, if it exists. Otherwise, undefined.

Return type: TreeNodeFromImplicitAllowedTypes<TRow> | undefined

insertColumns​

Inserts 0 or more columns into the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

insertColumns(columns: readonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[], index?: number): TreeNodeFromImplicitAllowedTypes<TColumn>[];

Parameters​

ParameterModifiersTypeDescription
columnsreadonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[]The columns to insert.
indexoptionalnumberThe index at which to insert the new columns. If omitted, the columns are appended to the end of the table.

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TColumn>[]

Error Handling​

Throws an error if the specified index is out of range. No columns are inserted in this case.

insertColumns​

Inserts 0 or more columns into the table.

This API is deprecated and will be removed in a future release.
This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];

Parameters​

ParameterTypeDescription
paramsInsertColumnsParameters<TColumn>

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TColumn>[]

Error Handling​

Throws an error if the specified index is out of range.

No columns are inserted in this case.

insertRows​

Inserts 0 or more rows into the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

insertRows(rows: readonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[], index?: number): TreeNodeFromImplicitAllowedTypes<TRow>[];

Parameters​

ParameterModifiersTypeDescription
rowsreadonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[]The rows to insert.
indexoptionalnumberThe index at which to insert the new rows. If omitted, the rows are appended to the end of the table.

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TRow>[]

Error Handling​

Throws an error in the following cases:

  • One or more of the rows contains cells for columns that do not exist in the table.
  • The specified index is out of range.

No rows are inserted in these cases.

insertRows​

Inserts 0 or more rows into the table.

This API is deprecated and will be removed in a future release.
This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];

Parameters​

ParameterTypeDescription
paramsInsertRowsParameters<TRow>

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TRow>[]

Error Handling​

Throws an error in the following cases:

  • The row contains cells, but the table does not contain matching columns for one or more of those cells.
  • The specified index is out of range.

No rows are inserted in these cases.

removeCell​

Removes the cell at the specified location in the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

removeCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;

Parameters​

ParameterTypeDescription
rowstring | number | TreeNodeFromImplicitAllowedTypes<TRow>The Row, id, or row index at which the cell is located.
columnstring | number | TreeNodeFromImplicitAllowedTypes<TColumn>The Column, id, or column index at which the cell is located.

Returns​

The cell if it exists, otherwise undefined.

Return type: TreeNodeFromImplicitAllowedTypes<TCell> | undefined

Error Handling​

Throws an error if the location does not exist in the table.

removeCell​

Removes the cell at the specified location in the table.

This API is deprecated and will be removed in a future release.
This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;

Parameters​

ParameterTypeDescription
keyCellKey<TColumn, TRow>

Returns​

The cell if it exists, otherwise undefined.

Return type: TreeNodeFromImplicitAllowedTypes<TCell> | undefined

Error Handling​

Throws an error if the location does not exist in the table.

removeColumns​

Removes a range of columns from the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];

Remarks​

Also removes any corresponding cells from the table's rows.

Note: this operation can be slow for tables with many rows. We are actively working on improving the performance of this operation, but for now it may have a negative impact on performance.

Parameters​

ParameterModifiersTypeDescription
indexoptionalnumber | undefinedThe starting index of the range to remove. Default: 0.
countoptionalnumber | undefinedThe number of columns to remove. Default: all remaining columns starting from index.

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TColumn>[]

Error Handling​

Throws an error if the specified range is invalid. In this case, no columns are removed.

removeColumns​

Removes 0 or more columns from the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];

Remarks​

Also removes any corresponding cells from the table's rows.

Note: this operation can be slow for tables with many rows. We are actively working on improving the performance of this operation, but for now it may have a negative impact on performance.

Parameters​

ParameterTypeDescription
columnsreadonly TreeNodeFromImplicitAllowedTypes<TColumn>[]The columns to remove.

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TColumn>[]

Error Handling​

Throws an error if any of the columns are not in the table. In this case, no columns are removed.

removeColumns​

Removes 0 or more columns from the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

removeColumns(columns: readonly string[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];

Remarks​

Also removes any corresponding cells from the table's rows.

Note: this operation can be slow for tables with many rows. We are actively working on improving the performance of this operation, but for now it may have a negative impact on performance.

Parameters​

ParameterTypeDescription
columnsreadonly string[]The columns to remove, specified by their id.

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TColumn>[]

Error Handling​

Throws an error if any of the columns are not in the table. In this case, no columns are removed.

removeRows​

Removes a range of rows from the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

removeRows(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TRow>[];

Parameters​

ParameterModifiersTypeDescription
indexoptionalnumber | undefinedThe starting index of the range to remove. Default: 0.
countoptionalnumber | undefinedThe number of rows to remove. Default: all remaining rows starting from index.

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TRow>[]

Error Handling​

Throws an error if the specified range is invalid. In this case, no rows are removed.

removeRows​

Removes 0 or more rows from the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];

Parameters​

ParameterTypeDescription
rowsreadonly TreeNodeFromImplicitAllowedTypes<TRow>[]The rows to remove.

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TRow>[]

Error Handling​

Throws an error if any of the rows are not in the table. In this case, no rows are removed.

removeRows​

Removes 0 or more rows from the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];

Parameters​

ParameterTypeDescription
rowsreadonly string[]The rows to remove, specified by their id.

Returns​

Return type: TreeNodeFromImplicitAllowedTypes<TRow>[]

Error Handling​

Throws an error if any of the rows are not in the table. In this case, no rows are removed.

setCell​

Sets the cell at the specified location in the table.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

setCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>, cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;

Remarks​

To remove a cell, call removeCell(row, column) instead.

Parameters​

ParameterTypeDescription
rowstring | number | TreeNodeFromImplicitAllowedTypes<TRow>The Row, id, or row index at which the cell is located.
columnstring | number | TreeNodeFromImplicitAllowedTypes<TColumn>The Column, id, or column index at which the cell is located.
cellInsertableTreeNodeFromImplicitAllowedTypes<TCell>The cell to set.

setCell​

Sets the cell at the specified location in the table.

This API is deprecated and will be removed in a future release.
This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

Signature​

setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;

Remarks​

To remove a cell, call removeCell(row, column) instead.

Parameters​

ParameterTypeDescription
paramsSetCellParameters<TCell, TColumn, TRow>