When converting from typescript to a target language, how can I declare a class as public?
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- swift, typescript
- 领域
- tooling
调研方向
首先重现命令 quicktype ESLModels.ts -o CodeGenOutput.swift,并检查 issue 中显示的生成的 Swift 声明和辅助函数。确定 Swift 输出选项的处理方式,然后验证所请求的访问修饰符是否一致地出现在生成的文件中。
由索引模型根据 Issue 内容生成。
描述
When running this command quicktype ESLModels.ts -o CodeGenOutput.swift, I want the outputted file to contain public access modifiers. The output is technically correct, but if a project uses multiple packages, then we need these classes to have a public designation. In other words, enum ProcedureStateEnum needs to be public enum ProcedureStateEnum
ESLModels.ts
export enum ProcedureStateEnum {
draft = 'draft',
review = 'review',
pending_approval = 'pending_approval',
effective = 'effective',
inactive = 'inactive',
approved = 'approved',
retired = 'retired',
archived = 'archived',
}
outputs:
enum ProcedureStateEnum: String, Codable {
case approved = "approved"
case archived = "archived"
case draft = "draft"
case effective = "effective"
case inactive = "inactive"
case pendingApproval = "pending_approval"
case retired = "retired"
case review = "review"
}
// MARK: - Helper functions for creating encoders and decoders
func newJSONDecoder() -> JSONDecoder {
let decoder = JSONDecoder()
if #available(iOS 10.0, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
decoder.dateDecodingStrategy = .iso8601
}
return decoder
}
func newJSONEncoder() -> JSONEncoder {
let encoder = JSONEncoder()
if #available(iOS 10.0, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
encoder.dateEncodingStrategy = .iso8601
}
return encoder
}
- 主要语言
- TypeScript
- 星标
- 13.9k
- 派生
- 1.2k
- 平均合并
- 8 小时 14 分钟
- 30 天内合并 PR
- 368
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
glideapps/quicktype 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
CI
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 5/5 一周以上 新手友好度 45/100
-
[BUG]: 未关闭bug
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 58/100
查看 glideapps/quicktype 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·