Skip to content

Commit

Permalink
fixup API docs
Browse files Browse the repository at this point in the history
use consistent formatting
  • Loading branch information
andrewjl-mux committed Jun 5, 2024
1 parent 0794bc3 commit 1f3c60e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 29 deletions.
43 changes: 15 additions & 28 deletions Sources/MuxUploadSDK/PublicAPI/DirectUpload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,28 @@ public typealias DirectUploadResult = Result<DirectUpload.SuccessDetails, Direct
/// ```swift
/// let upload = DirectUpload(
/// uploadURL: myDirectUploadURL,
/// videoFileURL: myVideoFileURL,
/// inputFileURL: myInputFileURL,
/// )
///
/// upload.progressHandler = { state in
/// self.uploadScreenState = .uploading(state)
/// print("Upload Progress: \(state.progress.fractionCompleted ?? 0)")
/// }
///
/// upload.resultHandler = { result in
/// switch result {
/// case .success(let success):
/// self.uploadScreenState = .done(success)
/// self.upload = nil
/// NSLog("Upload Success!")
/// print("Upload Success!")
/// case .failure(let error):
/// self.uploadScreenState = .failure(error)
/// NSLog("!! Upload error: \(error.localizedDescription)")
/// print("Upload Error: \(error.localizedDescription)")
/// }
/// }
///
/// self.upload = upload
/// upload.start()
/// ```
///
/// Uploads created by this SDK are globally managed by default, and can be resumed after failures or even after process death. For more information on
/// this topic, see ``UploadManager``
///
/// Uploads created by this SDK are globally managed by default,
/// and can be resumed after failures or after an application
/// restart or termination. For more see ``UploadManager``.
public final class DirectUpload {

var input: UploadInput {
Expand Down Expand Up @@ -170,27 +166,18 @@ public final class DirectUpload {

internal var fileWorker: ChunkedFileUploader?

/**
Represents the state of an upload in progress.
*/
/// Represents the state of an upload when it is being
/// sent to Mux over the network
public struct TransportStatus : Sendable, Hashable {
/**
The percentage of file bytes received by the server
accepting the upload
*/
/// The percentage of file bytes received at the
/// upload destination
public let progress: Progress?
/**
A timestamp indicating when this status was generated
*/
/// Timestamp from when this update was generated
public let updatedTime: TimeInterval
/**
The start time of the upload, nil if the upload
has never been started
*/
/// The start time of the upload, nil if the upload
/// has never been started
public let startTime: TimeInterval?
/**
Indicates if the upload has been paused
*/
/// Indicates if the upload has been paused
public let isPaused: Bool
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/MuxUploadSDK/PublicAPI/DirectUploadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public final class DirectUploadManager {
}

/// Returns all uploads currently-managed uploads.
/// Uploads are managed while in-progress or compelted.
/// Uploads are managed while in-progress or completed.
/// Uploads become un-managed when canceled, or if the process dies after they complete
public func allManagedDirectUploads() -> [DirectUpload] {
// Sort upload list for consistent ordering
Expand Down

0 comments on commit 1f3c60e

Please sign in to comment.