ISharedMatrix Interface
To use, import via @fluidframework/matrix/legacy.
For more information about our API support guarantees, see here.
Signature
export interface ISharedMatrix<T = any> extends IEventProvider<ISharedMatrixEvents<T>>, IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>>, IChannel
Extends: IEventProvider<ISharedMatrixEvents<T>>, IMatrixProducer<MatrixItem<T>>, IMatrixReader<MatrixItem<T>>, IMatrixWriter<MatrixItem<T>>, IChannel
Type Parameters
| Parameter | Default | Description |
|---|---|---|
| T | any |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| insertCols(colStart, count) | Beta | void | Inserts columns into the matrix. |
| insertRows(rowStart, count) | Beta | void | Inserts rows into the matrix. |
| isSetCellConflictResolutionPolicyFWW() | Beta | boolean | Whether the current conflict resolution policy is first-write win (FWW). See switchSetCellPolicy() for more details. |
| openUndo(consumer) | Beta | void | Attach an IUndoConsumer to the matrix. |
| removeCols(colStart, count) | Beta | void | Removes columns from the matrix. |
| removeRows(rowStart, count) | Beta | void | Removes rows from the matrix. |
| setCells(rowStart, colStart, colCount, values) | Beta | void | Sets a range of cells in the matrix. Cells are set in consecutive columns between colStart and colStart + colCount - 1. When values has larger size than colCount, the extra values are inserted in subsequent rows a la text-wrapping. |
| switchSetCellPolicy() | Beta | void | Change the conflict resolution policy for setCell operations to first-write win (FWW). This API only switches from LWW to FWW and not from FWW to LWW. |
Method Details
insertCols
Inserts columns into the matrix.
For more information about our API support guarantees, see here.
Signature
insertCols(colStart: number, count: number): void;
Remarks
Inserting 0 columns is a noop.
Parameters
| Parameter | Type | Description |
|---|---|---|
| colStart | number | Index of the first column to insert. |
| count | number | Number of columns to insert. |
insertRows
Inserts rows into the matrix.
For more information about our API support guarantees, see here.
Signature
insertRows(rowStart: number, count: number): void;
Remarks
Inserting 0 rows is a noop.
Parameters
| Parameter | Type | Description |
|---|---|---|
| rowStart | number | Index of the first row to insert. |
| count | number | Number of rows to insert. |
isSetCellConflictResolutionPolicyFWW
Whether the current conflict resolution policy is first-write win (FWW). See switchSetCellPolicy() for more details.
For more information about our API support guarantees, see here.
Signature
isSetCellConflictResolutionPolicyFWW(): boolean;
Returns
Return type: boolean
openUndo
Attach an IUndoConsumer to the matrix.
For more information about our API support guarantees, see here.
Signature
openUndo(consumer: IUndoConsumer): void;
Parameters
| Parameter | Type | Description |
|---|---|---|
| consumer | IUndoConsumer | Undo consumer which will receive revertibles from the matrix. |
removeCols
Removes columns from the matrix.
For more information about our API support guarantees, see here.
Signature
removeCols(colStart: number, count: number): void;
Remarks
Removing 0 columns is a noop.
Parameters
| Parameter | Type | Description |
|---|---|---|
| colStart | number | Index of the first column to remove. |
| count | number | Number of columns to remove. |
removeRows
Removes rows from the matrix.
For more information about our API support guarantees, see here.
Signature
removeRows(rowStart: number, count: number): void;
Remarks
Removing 0 rows is a noop.