Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions Sources/Loro/Loro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,7 @@

import Foundation

public enum ExportMode {
case snapshot
case updates(from: VersionVector)
case updatesInRange(spans: [IdSpan])
case shallowSnapshot(Frontiers)
case stateOnly(Frontiers?)
case snapshotAt(version: Frontiers)
}

extension LoroDoc{
public func export(mode: ExportMode) throws -> Data{
switch mode {
case .snapshot:
return try self.exportSnapshot()
case .updates(let from):
return try self.exportUpdates(vv: from)
case .updatesInRange(let spans):
return try self.exportUpdatesInRange(spans: spans)
case .shallowSnapshot(let frontiers):
return try self.exportShallowSnapshot(frontiers: frontiers)
case .stateOnly(let frontiers):
return try self.exportStateOnly(frontiers: frontiers)
case .snapshotAt(let frontiers):
return try self.exportSnapshotAt(frontiers: frontiers)
}
}

public func travelChangeAncestors(ids: [Id], f: @escaping (ChangeMeta)->Bool) throws {
let closureSubscriber = ChangeAncestorsTravel(closure: f)
try self.travelChangeAncestors(ids: ids, f: closureSubscriber)
Expand Down Expand Up @@ -99,4 +73,3 @@ class ChangeAncestorsTravel: ChangeAncestorsTraveler{
closure(change)
}
}

Loading
Loading