跳转到内容

前端 SDK 导出:UPLOAD_ACCEPT – buildUploadedAsset

本页由当前 SDK 声明自动生成。 导入入口:@woohaa3/frontend/extension-api。

返回接口索引

UPLOAD_ACCEPT · UiIconProps · UiPortalScope · UiProvider · UiProviderProps · UnavailableIcon · UndoIcon · UnlinkIcon · UploadFile · UploadIcon · UploadedMedia · VideoIcon · VolumeIcon · WandSparklesIcon · WarningIcon · ZoomInIcon · ZoomOutIcon · agentDirectory · agentDirectoryModels · agentModelSelection · appBuildVersion · assistantInputController · assistantInputKey · buildUploadedAsset

UPLOAD_ACCEPT

上传菜单接受的文件类型(与 Media Service 白名单一致)。

export const UPLOAD_ACCEPT: "image/png,image/jpeg,image/webp,image/gif,image/avif,video/mp4,video/webm,audio/mpeg,audio/wav,audio/ogg,audio/mp4,text/plain,text/markdown,application/json,.glb,model/gltf-binary";

UiIconProps

统一图标契约:默认 stroke/size/currentColor,consumer 只需传 className。

export type UiIconProps = Omit<SVGProps<SVGSVGElement>, "ref"> & {
size?: number | string;
strokeWidth?: number | string;
absoluteStrokeWidth?: boolean;
};

UiPortalScope

在弹窗所属层内承载下拉等浮层,避免落到应用级容器后被弹窗遮住。

export function UiPortalScope({ children }: { children: ReactNode; }): React.JSX.Element;

UiProvider

生产 UI Provider。MUST 位于 ThemeProvider 的 .app-theme-root 子树内 (App Host 与 Showcase preview root 均按此顺序挂载)。

export function UiProvider({ children, tooltipDelayDuration, tooltipSkipDelayDuration, }: UiProviderProps): React.JSX.Element;

关联类型:UiProviderProps

UiProviderProps

export type UiProviderProps = {
children: ReactNode;
tooltipDelayDuration?: number;
tooltipSkipDelayDuration?: number;
};

成员说明:

  • tooltipDelayDuration:Tooltip 首次显示延迟(ms)。
  • tooltipSkipDelayDuration:同一 Provider 内跳过下一段 delay 的窗口(ms)。

UnavailableIcon

export const UnavailableIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

UndoIcon

export const UndoIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

UnlinkIcon

export const UnlinkIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

UploadFile

浏览器文件的三要素(File 的结构子集,便于单测传字面量)。

export type UploadFile = {
name: string;
type: string;
size: number;
};

UploadIcon

上传(空白画布右键菜单「上传…」)。

export const UploadIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

UploadedMedia

export type UploadedMedia = {
storageKey: string;
checksum: string;
contentType: string;
size: number;
url: string;
deduplicated: boolean;
};

成员说明:

  • storageKey:服务端返回的稳定 storageKey(sha256-... 或 generation-outputs/...)。
  • url:同源读取地址。

VideoIcon

export const VideoIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

VolumeIcon

export const VolumeIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

WandSparklesIcon

快捷改写 / AI 润色入口(魔法棒 + 星芒)。

export const WandSparklesIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

WarningIcon

export const WarningIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

ZoomInIcon

export const ZoomInIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

ZoomOutIcon

export const ZoomOutIcon: { ({ size, strokeWidth, absoluteStrokeWidth, ...rest }: UiIconProps): React.JSX.Element; displayName: string; };

关联类型:UiIconProps

agentDirectory

export function agentDirectory(service: DirectoryService, dataScopeId: string): AgentDirectoryStore;

关联类型:DirectoryService

agentDirectoryModels

Preserve connection-specific catalogs; only fall back to the selected adapter.

export function agentDirectoryModels(connectionModels: readonly AgentModelView[] | undefined, catalogModels: readonly AgentModelView[] | undefined): readonly AgentModelView[];

关联类型:AgentModelView

agentModelSelection

Shared by node authoring and blank-canvas creation. Never substitutes a model.

export function agentModelSelection(models: readonly AgentModelView[], model: string, effort: AgentReasoningEffort | "", explicit: boolean): { supportedEfforts: readonly ("max" | "high" | "low" | "none" | "minimal" | "medium" | "xhigh" | "ultra")[]; invalidModel: boolean; missingRequiredModel: boolean; invalidEffort: boolean; };

关联类型:AgentModelView · AgentReasoningEffort

appBuildVersion

上报/展示用的构建标识:优先短提交号(可与服务端 commit 对照),否则退回版本串。

typeof 守卫是必需的:define 只在 vite 打包/调试时做文本替换,单测里这两个名字并不存在, 裸引用会让模块求值直接抛 ReferenceError。

export function appBuildVersion(): string;

assistantInputController

export function assistantInputController<Input, Accepted>(page: object, scope: AssistantInputScope, initial?: Partial<AssistantDraftValue>): ReturnType<typeof createAssistantInputController<Input, Accepted>>;

关联类型:AssistantInputScope · AssistantDraftValue

assistantInputKey

export function assistantInputKey(scope: AssistantInputScope): string;

关联类型:AssistantInputScope

buildUploadedAsset

已成功的媒体上传 → 稳定资产(内容寻址)。

export function buildUploadedAsset(input: { media: UploadedMedia; mediaKind: "image" | "video" | "audio" | "file"; file: UploadFile; modelFormat?: "glb"; now?: string; }): StoredAsset;

关联类型:UploadedMedia · UploadFile · StoredAsset