Files
Genarrative/packages/shared/src/contracts/squareHoleWorks.ts
kdletters d06107f2c6
Some checks failed
CI / verify (push) Has been cancelled
落地方洞挑战图片与运行态交互
2026-05-06 12:52:47 +08:00

81 lines
2.0 KiB
TypeScript

/**
* 方洞挑战作品读写共享契约。
* 作品字段只表达结果页可编辑信息;运行规则真相由后端 runtime 快照负责。
*/
export type SquareHoleWorkPublicationStatus = 'draft' | 'published' | string;
export interface SquareHoleShapeOption {
optionId: string;
shapeKind: string;
label: string;
targetHoleId: string;
imagePrompt: string;
imageSrc?: string | null;
}
export interface SquareHoleHoleOption {
holeId: string;
holeKind: string;
label: string;
imagePrompt: string;
imageSrc?: string | null;
}
export interface PutSquareHoleWorkRequest {
gameName: string;
themeText?: string;
twistRule: string;
summary: string;
tags: string[];
coverImageSrc?: string | null;
backgroundPrompt?: string;
backgroundImageSrc?: string | null;
shapeOptions?: SquareHoleShapeOption[];
holeOptions?: SquareHoleHoleOption[];
shapeCount: number;
difficulty: number;
}
export interface RegenerateSquareHoleWorkImageRequest {
visualAssetSlot: 'cover' | 'background' | 'shape' | 'hole' | string;
visualAssetOptionId?: string | null;
}
export interface SquareHoleWorkSummary {
workId: string;
profileId: string;
ownerUserId: string;
sourceSessionId?: string | null;
gameName: string;
themeText: string;
twistRule: string;
summary: string;
tags: string[];
coverImageSrc?: string | null;
backgroundPrompt: string;
backgroundImageSrc?: string | null;
shapeOptions: SquareHoleShapeOption[];
holeOptions: SquareHoleHoleOption[];
shapeCount: number;
difficulty: number;
publicationStatus: SquareHoleWorkPublicationStatus;
playCount: number;
updatedAt: string;
publishedAt?: string | null;
publishReady: boolean;
}
export interface SquareHoleWorkProfile extends SquareHoleWorkSummary {}
export interface SquareHoleWorksResponse {
items: SquareHoleWorkSummary[];
}
export interface SquareHoleWorkDetailResponse {
item: SquareHoleWorkProfile;
}
export interface SquareHoleWorkMutationResponse {
item: SquareHoleWorkProfile;
}