feat: migrated packages to ts

This commit is contained in:
Haoyu Xu
2025-05-02 02:27:42 +08:00
parent 0af0c785d4
commit 8f6f537c81
111 changed files with 3166 additions and 1155 deletions

View File

@@ -0,0 +1,66 @@
export type Assets = {
backgrounds: string[]
voiceLangs: string[]
subtitleLangs: string[]
music: string[]
}
export interface Property {
text: string
type?: 'bool' | 'file' | 'slider' | 'combo' | 'textinput'
value?: boolean | string
condition?: string
fraction?: boolean
max?: number
min?: number
step?: number
precision?: number
options?: string[]
fileType?: 'video'
}
export interface ProjectJSONProperty extends Property {
index: number
order: number
}
interface Template {
description: string
localization: {
'en-us': Record<string, string>
'zh-chs': Record<string, string>
}
}
export interface TemplateYAML extends Template {
properties: {
key: string
value: Property
}[]
}
interface TemplateJSON extends Template {
properties: {
[key: string]: ProjectJSONProperty
}
}
export interface ProjectJSONBase {
contentrating: string
description: string
file: string
preview: string
ratingsex: string
ratingviolence: string
snapshotformat: number
snapshotoverlay: string
tags: string[]
title: string
type: string
version: number
workshopid: string
}
export interface ProjectJSON extends ProjectJSONBase {
general: TemplateJSON
}