feat: add shared infiplot workspace packages
Signed-off-by: baizhi958216 <1475289190@qq.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "@infiplot/types",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.ts",
|
||||
"default": "./src/index.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^6.0.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
export type Locale = "en" | "ja" | "zh-CN";
|
||||
|
||||
export type ApiResult<TData, TError = ApiError> =
|
||||
| { ok: true; data: TData }
|
||||
| { ok: false; error: TError };
|
||||
|
||||
export interface ApiError {
|
||||
code: string;
|
||||
message: string;
|
||||
details?: unknown;
|
||||
}
|
||||
|
||||
export interface StorySummary {
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
locale: Locale;
|
||||
coverImageUrl?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface SceneRequest {
|
||||
storyId?: string;
|
||||
prompt: string;
|
||||
locale?: Locale;
|
||||
}
|
||||
|
||||
export interface SceneResponse {
|
||||
sceneId: string;
|
||||
text: string;
|
||||
imageUrl?: string;
|
||||
audioUrl?: string;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user