RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
 * Add a new snapshot to the given snapshots data structure
 * @param snapshots The snapshots data structure to add new snapshot into
 * @param snapshot The snapshot to add
 */
Add a new snapshot to the given snapshots data structure
@param snapshots The snapshots data structure to add new snapshot into
@param snapshot The snapshot to add
Add a new snapshot to the given snapshots data structure @param snapshots The snapshots data structure to add new snapshot into @param snapshot The snapshot to add
function addSnapshot(snapshots, snapshot) {
    if (snapshots.currentIndex < 0 || snapshot != snapshots.snapshots[snapshots.currentIndex]) {
        clearProceedingSnapshots_1.default(snapshots);
        snapshots.snapshots.push(snapshot);
        snapshots.currentIndex++;
        snapshots.totalSize += snapshot.length;
        var removeCount = 0;
        while (removeCount < snapshots.snapshots.length &&
            snapshots.totalSize > snapshots.maxSize) {
            snapshots.totalSize -= snapshots.snapshots[removeCount].length;
            removeCount++;
        }
        if (removeCount > 0) {
            snapshots.snapshots.splice(0, removeCount);
            snapshots.currentIndex -= removeCount;
        }
    }
}
function addSnapshot ( snapshots , snapshot ) { if ( snapshots . currentIndex < 0 || snapshot != snapshots . snapshots [ snapshots . currentIndex ] ) { clearProceedingSnapshots_1 . default ( snapshots ) ; snapshots . snapshots . push ( snapshot ) ; snapshots . currentIndex ++ ; snapshots . totalSize += snapshot . length ; var removeCount = 0 ; while ( removeCount < snapshots . snapshots . length && snapshots . totalSize > snapshots . maxSize ) { snapshots . totalSize -= snapshots . snapshots [ removeCount ] . length ; removeCount ++ ; } if ( removeCount > 0 ) { snapshots . snapshots . splice ( 0 , removeCount ) ; snapshots . currentIndex -= removeCount ; } } }
Add a new snapshot to the given snapshots data structure
 @param snapshots The snapshots data structure to add new snapshot into
 @param snapshot The snapshot to add
Add a new snapshot to the given snapshots data structure @param snapshots The snapshots data structure to add new snapshot into @param snapshot The snapshot to add