Add export and import
This commit is contained in:
@ -1,12 +1,5 @@
|
||||
import Foundation
|
||||
|
||||
struct Titled<Content> {
|
||||
|
||||
let title: String
|
||||
|
||||
let items: [Content]
|
||||
}
|
||||
|
||||
struct CVInfo {
|
||||
|
||||
let language: String
|
||||
@ -47,3 +40,7 @@ extension CVInfo: Hashable {
|
||||
hasher.combine(language)
|
||||
}
|
||||
}
|
||||
|
||||
extension CVInfo: Codable {
|
||||
|
||||
}
|
||||
|
@ -16,3 +16,7 @@ struct CareerStation: Identifiable {
|
||||
title + time + location
|
||||
}
|
||||
}
|
||||
|
||||
extension CareerStation: Codable {
|
||||
|
||||
}
|
||||
|
@ -10,3 +10,7 @@ struct Publication: Identifiable {
|
||||
title + venue
|
||||
}
|
||||
}
|
||||
|
||||
extension Publication: Codable {
|
||||
|
||||
}
|
||||
|
@ -11,3 +11,26 @@ struct SkillsSet: Identifiable {
|
||||
entries.joined()
|
||||
}
|
||||
}
|
||||
|
||||
extension SkillsSet: Decodable {
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case systemSymbol
|
||||
case entries
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
let rawSymbol = try container.decode(String.self, forKey: .systemSymbol)
|
||||
self.systemSymbol = .init(rawValue: rawSymbol)
|
||||
self.entries = try container.decode([String].self, forKey: .entries)
|
||||
}
|
||||
}
|
||||
|
||||
extension SkillsSet: Encodable {
|
||||
func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(systemSymbol.rawValue, forKey: .systemSymbol)
|
||||
try container.encode(entries, forKey: .entries)
|
||||
}
|
||||
}
|
||||
|
12
ResumeBuilder/Data/Titled.swift
Normal file
12
ResumeBuilder/Data/Titled.swift
Normal file
@ -0,0 +1,12 @@
|
||||
import Foundation
|
||||
|
||||
struct Titled<Content> {
|
||||
|
||||
let title: String
|
||||
|
||||
let items: [Content]
|
||||
}
|
||||
|
||||
extension Titled: Codable where Content: Codable {
|
||||
|
||||
}
|
@ -20,3 +20,7 @@ struct TopInfo {
|
||||
|
||||
let github: String
|
||||
}
|
||||
|
||||
extension TopInfo: Codable {
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user