Skip to content 

IntervalCollectionView Class

Packages > @fluidframework/sequence > IntervalCollectionView

Signature:

export declare class IntervalCollectionView<TInterval extends ISerializableInterval> extends EventEmitter 

Extends: EventEmitter

Constructors

List of constructors for this class
Constructor Modifiers Description
(constructor)(client, savedSerializedIntervals, label, helpers, emitter) Constructs a new instance of the IntervalCollectionView class

Methods

List of methods on this class
Method Modifiers Description
add(start, end, intervalType, props)
addConflictResolver(conflictResolver)
addInternal(serializedInterval, local, op)
attachDeserializer(onDeserialize)
delete(start, end)
deleteInterval(serializedInterval, local, op)
findOverlappingIntervals(startPosition, endPosition)
map(fn)
nextInterval(pos)
on(event, listener)
previousInterval(pos)
serializeInternal()

Constructors

IntervalCollectionView.(constructor)

Constructs a new instance of the IntervalCollectionView class

Signature:

constructor(client: MergeTree.Client, savedSerializedIntervals: ISerializedInterval[], label: string, helpers: IIntervalHelpers<TInterval>, emitter: IValueOpEmitter);

Parameters

List of parameters
Parameter Type Description
client MergeTree.Client
savedSerializedIntervals ISerializedInterval[]
label string
helpers IIntervalHelpers
emitter IValueOpEmitter

Methods

add

Signature:

add(start: number, end: number, intervalType: MergeTree.IntervalType, props?: MergeTree.PropertySet): void;

Parameters

List of parameters
Parameter Type Description
start number
end number
intervalType MergeTree.IntervalType
props MergeTree.PropertySet

Returns:

void

addConflictResolver

Signature:

addConflictResolver(conflictResolver: MergeTree.IntervalConflictResolver<TInterval>): void;

Parameters

List of parameters
Parameter Type Description
conflictResolver MergeTree.IntervalConflictResolver

Returns:

void

addInternal

Signature:

addInternal(serializedInterval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage): this;

Parameters

List of parameters
Parameter Type Description
serializedInterval ISerializedInterval
local boolean
op ISequencedDocumentMessage

Returns:

this

attachDeserializer

Signature:

attachDeserializer(onDeserialize: DeserializeCallback): void;

Parameters

List of parameters
Parameter Type Description
onDeserialize DeserializeCallback

Returns:

void

delete

Signature:

delete(start: number, end: number): void;

Parameters

List of parameters
Parameter Type Description
start number
end number

Returns:

void

deleteInterval

Signature:

deleteInterval(serializedInterval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage): this;

Parameters

List of parameters
Parameter Type Description
serializedInterval ISerializedInterval
local boolean
op ISequencedDocumentMessage

Returns:

this

findOverlappingIntervals

Signature:

findOverlappingIntervals(startPosition: number, endPosition: number): TInterval[];

Parameters

List of parameters
Parameter Type Description
startPosition number
endPosition number

Returns:

TInterval[]

map

Signature:

map(fn: (interval: TInterval) => void): void;

Parameters

List of parameters
Parameter Type Description
fn (interval: TInterval) => void

Returns:

void

nextInterval

Signature:

nextInterval(pos: number): TInterval;

Parameters

List of parameters
Parameter Type Description
pos number

Returns:

TInterval

on

Signature:

on(event: "addInterval" | "deleteInterval", listener: (interval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage) => void): this;

Parameters

List of parameters
Parameter Type Description
event "addInterval" | "deleteInterval"
listener (interval: ISerializedInterval, local: boolean, op: ISequencedDocumentMessage) => void

Returns:

this

previousInterval

Signature:

previousInterval(pos: number): TInterval;

Parameters

List of parameters
Parameter Type Description
pos number

Returns:

TInterval

serializeInternal

Signature:

serializeInternal(): any[];

Returns:

any[]