Skip to content 

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

List of constructors for this class
Constructor Modifiers Description
(constructor)(runtime, id, attributes) Constructs a new instance of the SharedMatrix class

Properties

List of properties for this class
Property Modifiers Type Description
colCount number
id string
matrixProducer IMatrixProducer
rowCount number

Methods

List of methods on this class
Method Modifiers Description
closeMatrix(consumer)
create(runtime, id) static
didAttach()
forEachCell(callback, spec)
getAnnotation(row, col)
getCell(row, col)
getFactory() static
insertCols(colStart, count)
insertRows(rowStart, count)
loadCore(branchId, storage)
onConnect()
onDisconnect()
openMatrix(consumer)
openUndo(consumer)
processCore(rawMessage, local, localOpMetadata)
registerCore()
removeCols(colStart, count)
removeRows(rowStart, count)
reSubmitCore(content, localOpMetadata)
setAnnotation(row, col, value)
setCell(row, col, value)
setCells(rowStart, colStart, colCount, values)
snapshot()
submitLocalMessage(message, localOpMetadata)
toString()

Constructors

SharedMatrix.(constructor)

Constructs a new instance of the SharedMatrix class

Signature:

constructor(runtime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);

Parameters

List of 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

List of parameters
Parameter Type Description
consumer IMatrixConsumer

Returns:

void

create

Signature:

static create<T extends Serializable = Serializable>(runtime: IFluidDataStoreRuntime, id?: string): SharedMatrix<T>;

Parameters

List of 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

List of 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

List of parameters
Parameter Type Description
row number
col number

Returns:

T | undefined | null

getCell

Signature:

getCell(row: number, col: number): T | undefined | null;

Parameters

List of parameters
Parameter Type Description
row number
col number

Returns:

T | undefined | null

getFactory

Signature:

static getFactory(): SharedMatrixFactory;

Returns:

SharedMatrixFactory

insertCols

Signature:

insertCols(colStart: number, count: number): void;

Parameters

List of parameters
Parameter Type Description
colStart number
count number

Returns:

void

insertRows

Signature:

insertRows(rowStart: number, count: number): void;

Parameters

List of parameters
Parameter Type Description
rowStart number
count number

Returns:

void

loadCore

Signature:

protected loadCore(branchId: string | undefined, storage: IChannelStorageService): Promise<void>;

Parameters

List of 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

List of parameters
Parameter Type Description
consumer IMatrixConsumer

Returns:

IMatrixReader<T | undefined | null>

openUndo

Signature:

openUndo(consumer: IUndoConsumer): void;

Parameters

List of parameters
Parameter Type Description
consumer IUndoConsumer

Returns:

void

processCore

Signature:

protected processCore(rawMessage: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;

Parameters

List of 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

List of parameters
Parameter Type Description
colStart number
count number

Returns:

void

removeRows

Signature:

removeRows(rowStart: number, count: number): void;

Parameters

List of parameters
Parameter Type Description
rowStart number
count number

Returns:

void

reSubmitCore

Signature:

protected reSubmitCore(content: any, localOpMetadata: unknown): void;

Parameters

List of parameters
Parameter Type Description
content any
localOpMetadata unknown

Returns:

void

setAnnotation

Signature:

setAnnotation(row: number, col: number, value: T): void;

Parameters

List of parameters
Parameter Type Description
row number
col number
value T

Returns:

void

setCell

Signature:

setCell(row: number, col: number, value: T): void;

Parameters

List of 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

List of parameters
Parameter Type Description
rowStart number
colStart number
colCount number
values readonly T[]

Returns:

void

snapshot

Signature:

snapshot(): ITree;

Returns:

ITree

submitLocalMessage

Signature:

protected submitLocalMessage(message: any, localOpMetadata?: any): void;

Parameters

List of parameters
Parameter Type Description
message any
localOpMetadata any

Returns:

void

toString

Signature:

toString(): string;

Returns:

string