Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change docupdates #130

Merged
merged 2 commits into from
Mar 15, 2024
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
1 change: 1 addition & 0 deletions Sources/Automerge/Automerge.docc/Automerge.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Read <doc:FiveMinuteQuickstart> to get a quick taste of how to use Automerge, or

- <doc:ChangesAndHistory>
- ``Automerge/ChangeHash``
- ``Automerge/Change``
- ``Automerge/Patch``
- ``Automerge/PatchAction``
- ``Automerge/PathElement``
Expand Down
17 changes: 17 additions & 0 deletions Sources/Automerge/Automerge.docc/Curation/Change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ``Automerge/Change``

## Topics

### Inspecting a Change

- ``Change/hash``
- ``Change/actorId``
- ``Change/deps``
- ``Change/bytes``
- ``ChangeHash/debugDescription``

### Inspecting Change Metadata

- ``Change/message``
- ``Change/timestamp``

2 changes: 2 additions & 0 deletions Sources/Automerge/Automerge.docc/Curation/Document.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@

- ``heads()``
- ``getHistory()``
- ``change(hash:)``

### Reading historical map values

Expand All @@ -100,6 +101,7 @@
### Saving, forking, and merging documents

- ``save()``
- ``commitWith(message:timestamp:)``
- ``encodeNewChanges()``
- ``encodeChangesSince(heads:)``
- ``applyEncodedChanges(encoded:)``
Expand Down
7 changes: 7 additions & 0 deletions Sources/Automerge/Change.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ import Foundation

typealias FfiChange = AutomergeUniffi.Change

/// A type that encapsulates a change, and any associated metadata, to an Automerge document.
public struct Change: Equatable {
/// The identity of the actor that made the change.
public let actorId: ActorId
/// An optional message associated with the change.
public let message: String?
/// The list of changes that this change depends upon.
public let deps: [ChangeHash]
/// The timestamp of the change.
public let timestamp: Date
/// The encoded bytes of the change operation.
public let bytes: Data
/// The identity of the change, its hash.
public let hash: ChangeHash

init(_ ffi: FfiChange) {
Expand Down
2 changes: 1 addition & 1 deletion rust/src/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::actor_id::ActorId;
use crate::mark::{ExpandMark, Mark};
use crate::patches::Patch;
use crate::{
Change, ChangeHash, Cursor, ObjId, ObjType, PathElement, ScalarValue, SyncState, Value
Change, ChangeHash, Cursor, ObjId, ObjType, PathElement, ScalarValue, SyncState, Value,
};

#[derive(Debug, thiserror::Error)]
Expand Down
Loading