SharedMatrix Class
Packages > @fluidframework/matrix > SharedMatrix
Signature:
export declare class SharedMatrix<T extends Serializable = Serializable> extends SharedObject implements IMatrixProducer<T | undefined | null>, IMatrixReader<T | undefined | null>, IMatrixWriter<T | undefined>, IMatrixIterator<T | undefined | null>
Extends: SharedObject
Implements: IMatrixProducer<T | undefined | null>, IMatrixReader<T | undefined | null>, IMatrixWriter<T | undefined>, IMatrixIterator<T | undefined | null>
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(runtime, id, attributes) | Constructs a new instance of the SharedMatrix class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
colCount | number | ||
id | string | ||
matrixProducer | IMatrixProducer |
||
rowCount | number |
Methods
Constructors
SharedMatrix.(constructor)
Constructs a new instance of the SharedMatrix
class
Signature:
constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
Parameters
Parameter | Type | Description |
---|---|---|
runtime | IFluidDataStoreRuntime | |
id | string | |
attributes | IChannelAttributes |
Properties
colCount
Signature:
get colCount(): number;
id
Signature:
id: string;
matrixProducer
Signature:
get matrixProducer(): IMatrixProducer<T | undefined | null>;
rowCount
Signature:
get rowCount(): number;
Methods
closeMatrix
Signature:
closeMatrix(consumer: IMatrixConsumer<T | undefined | null>): void;
Parameters
Parameter | Type | Description |
---|---|---|
consumer | IMatrixConsumer |
Returns:
void
create
Signature:
static create<T extends Serializable = Serializable>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;
Parameters
Parameter | Type | Description |
---|---|---|
runtime | IFluidDataStoreRuntime | |
id | string |
Returns:
SharedMatrix<T>
didAttach
Signature:
protected didAttach(): void;
Returns:
void
forEachCell
Signature:
forEachCell(callback: (value: T | undefined | null, row: number, column: number) => void, spec?: MatrixIteratorSpec): void;
Parameters
Parameter | Type | Description |
---|---|---|
callback | (value: T | undefined | null, row: number, column: number) => void | |
spec | MatrixIteratorSpec |
Returns:
void
getAnnotation
Signature:
getAnnotation(row: number, col: number): T | undefined | null;
Parameters
Parameter | Type | Description |
---|---|---|
row | number | |
col | number |
Returns:
T | undefined | null
getCell
Signature:
getCell(row: number, col: number): T | undefined | null;
Parameters
Parameter | Type | Description |
---|---|---|
row | number | |
col | number |
Returns:
T | undefined | null
getFactory
Signature:
static getFactory(): SharedMatrixFactory;
Returns:
insertCols
Signature:
insertCols(colStart: number, count: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
colStart | number | |
count | number |
Returns:
void
insertRows
Signature:
insertRows(rowStart: number, count: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
rowStart | number | |
count | number |
Returns:
void
loadCore
Signature:
protected loadCore(branchId: string | undefined, storage: IChannelStorageService): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
branchId | string | undefined | |
storage | IChannelStorageService |
Returns:
Promise<void>
onConnect
Signature:
protected onConnect(): void;
Returns:
void
onDisconnect
Signature:
protected onDisconnect(): void;
Returns:
void
openMatrix
Signature:
openMatrix(consumer: IMatrixConsumer<T | undefined | null>): IMatrixReader<T | undefined | null>;
Parameters
Parameter | Type | Description |
---|---|---|
consumer | IMatrixConsumer |
Returns:
IMatrixReader<T | undefined | null>
openUndo
Signature:
openUndo(consumer: IUndoConsumer): void;
Parameters
Parameter | Type | Description |
---|---|---|
consumer | IUndoConsumer |
Returns:
void
processCore
Signature:
protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
Parameters
Parameter | Type | Description |
---|---|---|
rawMessage | ISequencedDocumentMessage | |
local | boolean | |
localOpMetadata | unknown |
Returns:
void
registerCore
Signature:
protected registerCore(): void;
Returns:
void
removeCols
Signature:
removeCols(colStart: number, count: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
colStart | number | |
count | number |
Returns:
void
removeRows
Signature:
removeRows(rowStart: number, count: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
rowStart | number | |
count | number |
Returns:
void
reSubmitCore
Signature:
protected reSubmitCore(content: any, localOpMetadata: unknown): void;
Parameters
Parameter | Type | Description |
---|---|---|
content | any | |
localOpMetadata | unknown |
Returns:
void
setAnnotation
Signature:
setAnnotation(row: number, col: number, value: T): void;
Parameters
Parameter | Type | Description |
---|---|---|
row | number | |
col | number | |
value | T |
Returns:
void
setCell
Signature:
setCell(row: number, col: number, value: T): void;
Parameters
Parameter | Type | Description |
---|---|---|
row | number | |
col | number | |
value | T |
Returns:
void
setCells
Signature:
setCells(rowStart: number, colStart: number, colCount: number, values: readonly T[]): void;
Parameters
Parameter | Type | Description |
---|---|---|
rowStart | number | |
colStart | number | |
colCount | number | |
values | readonly T[] |
Returns:
void
snapshot
Signature:
snapshot(): ITree;
Returns:
submitLocalMessage
Signature:
protected submitLocalMessage(message: any, localOpMetadata?: any): void;
Parameters
Parameter | Type | Description |
---|---|---|
message | any | |
localOpMetadata | any |
Returns:
void
toString
Signature:
toString(): string;
Returns:
string