add `Document.applyDeltas` with test