LaiTool/src/model/translate.d.ts
2024-08-03 12:46:12 +08:00

56 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { TranslateAPIType, TranslateType } from "../define/enum/translate"
declare namespace TranslateModel {
type TranslateNowReturnParams = {
text: string // 需要翻译的文本
from: string // 源语言
to: string // 目标语言
isSplit: false // 是否需要分割
}
type TranslateNowIPCParams = {
text: string // 需要翻译的文本
from: string // 源语言
to: string // 目标语言
isSplit: false // 是否需要分割
bookTaskDetailId?: string // 小说分镜ID
reversePromptId?: string // 反推提示词ID
windowId?: number // 窗口ID
type: TranslateType // 翻译类型
}
type TranslateResponseMessageModel = {
bookTaskDetailId: string // 分镜ID
reversePromptId: string // 反推提示词ID
from: string // 源语言
to: string // 目标语言 to 是 zh 值重新保存到 promptCN 中to 是 en 需要重新覆盖prompt和prom
prompt: string // 英文数据
promptCN: string // 中文翻译数据(但是也可以存储英文)
progress: number // 索引(翻译到了哪,用于进度条)
total: number // 总数
}
type TranslateReturnDataModel = {
src: string // 字符串
dst: string // 翻译结果
}
type TranslateReturnModel = {
to: string // 目标语言
data: TranslateReturnDataModel[] // 翻译结果
}
type subTranslateModel = {
name: TranslateAPIType // 翻译API名称
translation_business: string // 翻译业务
translation_app_id: string // 翻译APP ID
translation_secret: string // 翻译密钥
}
type TranslateModel = {
selectModel: TranslateAPIType // 选择的模型
translation_auto: boolean // 是否自动翻译
translates: subTranslateModel[] // 可用的翻译API
}
}