Skip to main content

Table Interface

A table.

This API is provided as an alpha 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<TScope extends string | undefined, TCell extends ImplicitAllowedTypes, TColumn extends System_TableSchema.ColumnSchemaBase<TScope, TCell>, TRow extends System_TableSchema.RowSchemaBase<TScope, TCell>>

Type Parameters

ParameterConstraintDescription
TScopestring | undefinedThe schema factory scope.
TCellImplicitAllowedTypesThe type of the cells in the table.
TColumnSystem_TableSchema.ColumnSchemaBase<TScope, TCell>The type of the columns in the table.
TRowSystem_TableSchema.RowSchemaBase<TScope, TCell>The type of the rows in the table.

Properties

PropertyAlertsModifiersTypeDescription
columnsAlphareadonlyTreeArrayNode<TColumn>The table's columns.
rowsAlphareadonlyTreeArrayNode<TRow>The table's rows.

Methods

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

Property Details

columns

The table's columns.

This API is provided as an alpha preview and may change without notice.

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

Signature

readonly columns: TreeArrayNode<TColumn>;

Type: TreeArrayNode<TColumn>

rows

The table's rows.

This API is provided as an alpha preview and may change without notice.

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

Signature

readonly rows: TreeArrayNode<TRow>;

Type: TreeArrayNode<TRow>

Method Details

getCell

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

This API is provided as an alpha 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 an alpha 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 an alpha preview and may change without notice.

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

Signature

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

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 an alpha 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 an alpha preview and may change without notice.

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

Signature

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

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 an alpha 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 an alpha 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 an alpha 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 an alpha 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 an alpha 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 an alpha 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 an alpha 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 an alpha 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 an alpha 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 an alpha 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(key) instead.

Parameters

ParameterTypeDescription
paramsSetCellParameters<TCell, TColumn, TRow>