StubDocument.swift 736 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // StubDocument.swift
  3. // Todos
  4. //
  5. // Created by Sam Jaffe on 3/1/26.
  6. //
  7. import Foundation
  8. import SwiftUI
  9. import UniformTypeIdentifiers
  10. struct StubYamlDocument: FileDocument {
  11. static var readableContentTypes = [UTType.yaml]
  12. init() {}
  13. init(configuration: ReadConfiguration) throws {}
  14. func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper {
  15. return FileWrapper(regularFileWithContents: Data())
  16. }
  17. }
  18. struct StubJsonDocument: FileDocument {
  19. static var readableContentTypes = [UTType.json]
  20. init() {}
  21. init(configuration: ReadConfiguration) throws {}
  22. func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper {
  23. return FileWrapper(regularFileWithContents: Data())
  24. }
  25. }