Table Interface
A table.
For more information about our API support guarantees, see here.
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
Parameter | Constraint | Description |
---|---|---|
TScope | string | undefined | The schema factory scope. |
TCell | ImplicitAllowedTypes | The type of the cells in the table. |
TColumn | System_TableSchema.ColumnSchemaBase<TScope, TCell> | The type of the columns in the table. |
TRow | System_TableSchema.RowSchemaBase<TScope, TCell> | The type of the rows in the table. |
Properties
Property | Alerts | Modifiers | Type | Description |
---|---|---|---|---|
columns | Alpha |
readonly |
TreeArrayNode<TColumn> | The table's columns. |
rows | Alpha |
readonly |
TreeArrayNode<TRow> | The table's rows. |
Methods
Method | Alerts | Return Type | Description |
---|---|---|---|
getCell(key) | Alpha |
TreeNodeFromImplicitAllowedTypes<TCell> | undefined | Gets a cell in the table by column and row IDs. |
getColumn(id) | Alpha |
TreeNodeFromImplicitAllowedTypes<TColumn> | undefined | Gets a table column by its id. |
getRow(id) | Alpha |
TreeNodeFromImplicitAllowedTypes<TRow> | undefined | Gets a table row by its id. |
insertColumns(params) | Alpha |
TreeNodeFromImplicitAllowedTypes<TColumn>[] | Inserts 0 or more columns into the table. |
insertRows(params) | Alpha |
TreeNodeFromImplicitAllowedTypes<TRow>[] | Inserts 0 or more rows into the table. |
removeCell(key) | Alpha |
TreeNodeFromImplicitAllowedTypes<TCell> | undefined | Removes the cell at the specified location in the table. |
removeColumns(index, count) | Alpha |
TreeNodeFromImplicitAllowedTypes<TColumn>[] | Removes a range of columns from the table. |
removeColumns(columns) | Alpha |
TreeNodeFromImplicitAllowedTypes<TColumn>[] | Removes 0 or more columns from the table. |
removeColumns(columns) | Alpha |
TreeNodeFromImplicitAllowedTypes<TColumn>[] | Removes 0 or more columns from the table. |
removeRows(index, count) | Alpha |
TreeNodeFromImplicitAllowedTypes<TRow>[] | Removes a range of rows from the table. |
removeRows(rows) | Alpha |
TreeNodeFromImplicitAllowedTypes<TRow>[] | Removes 0 or more rows from the table. |
removeRows(rows) | Alpha |
TreeNodeFromImplicitAllowedTypes<TRow>[] | Removes 0 or more rows from the table. |
setCell(params) | Alpha |
void | Sets the cell at the specified location in the table. |
Property Details
columns
The table's columns.
For more information about our API support guarantees, see here.
Signature
readonly columns: TreeArrayNode<TColumn>;
Type: TreeArrayNode<TColumn>
rows
The table's rows.
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 column and row IDs.
For more information about our API support guarantees, see here.
Signature
getCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
key | CellKey<TColumn, TRow> | A key that uniquely distinguishes a cell in the table, represented as a combination of the column ID and row ID. |
Returns
Return type: TreeNodeFromImplicitAllowedTypes<TCell> | undefined
getColumn
Gets a table column by its id.
For more information about our API support guarantees, see here.
Signature
getColumn(id: string): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
id | string |
Returns
Return type: TreeNodeFromImplicitAllowedTypes<TColumn> | undefined
getRow
Gets a table row by its id.
For more information about our API support guarantees, see here.
Signature
getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
id | string |
Returns
Return type: TreeNodeFromImplicitAllowedTypes<TRow> | undefined
insertColumns
Inserts 0 or more columns into the table.
For more information about our API support guarantees, see here.
Signature
insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
Parameters
Parameter | Type | Description |
---|---|---|
params | InsertColumnsParameters<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.
For more information about our API support guarantees, see here.
Signature
insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
Parameters
Parameter | Type | Description |
---|---|---|
params | InsertRowsParameters<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.
For more information about our API support guarantees, see here.
Signature
removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
key | CellKey<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.
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
Parameter | Modifiers | Type | Description |
---|---|---|---|
index | optional | number | undefined | The starting index of the range to remove. Default: 0 . |
count | optional | number | undefined | The 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.
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
Parameter | Type | Description |
---|---|---|
columns | readonly 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.
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
Parameter | Type | Description |
---|---|---|
columns | readonly 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.