跳转到内容

签名关联类型:TextureUploadSource – Woohaa3CanvasJsonObject

本页由当前 SDK 声明自动生成。

返回接口索引

TextureUploadSource · TextureUploader · Transform · UiContextValue · UpdatePromptSnippetInput · UploadMediaResult · UrlSettingDefinition · UserDataScope · Vec3 · VideoEditAnnotationPoint · VideoEditAnnotationPreview · VideoEditAnnotationShape · VideoEditAnnotationTool · VideoEditIntent · VideoFocusVersion · VideoFrameSessions · VideoLease · VideoLeaseState · VideoQuality · VideoSourceIdentity · ViewportTransitionRequest · Woohaa3CanvasDocument · Woohaa3CanvasEdge · Woohaa3CanvasJsonObject

TextureUploadSource

export type TextureUploadSource = {
sourceKey: string;
nodeId?: string;
preserveFailure?: boolean;
};

TextureUploader

export type TextureUploader = {
sync(): void;
textureNodeIds(): ReadonlySet<string>;
isLoading?(nodeId: string): boolean;
resourceStateChanges?(): readonly import("@woohaa3/contracts").CanvasNodeResourceState[];
acknowledgeResourceStates?(): void;
dispose(): void;
};

关联类型:CanvasNodeResourceState

成员说明:

  • sync:按当前画布同步纹理(幂等:已上传的不重复)。
  • textureNodeIds:上传完成的节点 id 集合(用于 mapper 的 texture 标记,可选)。

Transform

已求值的变换(旋转为四元数),用于层级组合与包围盒计算。

export type Transform = {
translation: Vec3;
rotation: Quat;
scale: Vec3;
};

关联类型:Vec3 · Quat

UiContextValue

type UiContextValue = {
portalContainer: HTMLElement | null;
};

成员说明:

  • portalContainer:当前主题根内的 portal 容器;在容器挂载后可用(否则为 null)。

UpdatePromptSnippetInput

export type UpdatePromptSnippetInput = {
snippetId: string;
expectedRevision: number;
name: string;
body: string;
materials: PromptSnippetMaterial[];
tagIds: string[];
};

关联类型:PromptSnippetMaterial

UploadMediaResult

export type UploadMediaResult = {
ok: true;
media: UploadedMedia;
} | {
ok: false;
error: string;
};

关联类型:UploadedMedia

UrlSettingDefinition

export type UrlSettingDefinition = SettingBase & {
kind: "url";
protocols: readonly string[];
default?: string;
};

关联类型:SettingBase

成员说明:

  • label:设置页上的名称。
  • reload:hot:运行中生效;restart:写入后需要重启进程。
  • legacyEnv:过渡期兼容的旧环境变量名;新配置项不要再声明。
  • group:设置页上的分组(插件配置项按插件分组)。
  • ownerExtensionId:声明这段配置的扩展 id(宿主装载器按插件名填入)。设置面据此把「这个配置段的启停」 放到配置旁边,而不是留在插件清单里。

UserDataScope

export type UserDataScope = DataScopeFields & Readonly<{
kind: "user";
}>;

关联类型:DataScopeFields

成员说明:

  • ownerId:会话仓库中的兼容定位键。
  • credentialOwnerId:加密凭据的兼容定位键,不改变加密 AAD。

Vec3

V2 模型局部变换数学。

与 Bevy Transform 组合语义 逐位对齐,使 executor、extent 计算、Bevy 运行时 与原生 renderer 用同一套局部层级规则:

  • local transform = T(position) * R(euler) * S(scale);
  • world = parentWorld * local,其中 a * b 的平移为 a.t + a.r * (a.s * b.t),旋转为 a.r * b.r,缩放为 a.s * b.s;
  • rotation: [x, y, z] 为角度制,固定按 intrinsic Y-X-Z 组合(R = Ry * Rx * Rz), 与 Bevy Quat::from_euler(EulerRot::YXZ, x, y, z) 一致。

本模块无副作用、纯函数,浏览器 / Canvas Service / 测试共用。Scene IR 仍是运行时 DTO。

export type Vec3 = [
number,
number,
number
];

VideoEditAnnotationPoint

视频内容区域内归一化坐标(不含 object-fit letterbox),分量位于 [0, 1]。

export type VideoEditAnnotationPoint = {
x: number;
y: number;
};

VideoEditAnnotationPreview

稳定的 annotation preview 身份(design D6)。

只允许稳定媒体引用;storageKey 必须是内容寻址键。临时 URL / data URL / Blob 一律不是合法 preview。

export type VideoEditAnnotationPreview = {
assetId: string;
storageKey: string;
mediaType: string;
};

成员说明:

  • assetId:稳定资产身份(可为空字符串表示仅由 storageKey 标识)。

VideoEditAnnotationShape

一条标注 shape;坐标相对实际视频内容区域归一化(design D5)。

export type VideoEditAnnotationShape = {
id: string;
tool: VideoEditAnnotationTool;
color: string;
strokeWidth: number;
points: VideoEditAnnotationPoint[];
};

关联类型:VideoEditAnnotationTool · VideoEditAnnotationPoint

成员说明:

  • points:pen:≥2 个点;rect:恰好 2 个点(起点、终点)。

VideoEditAnnotationTool

一个视频编辑 intent 中允许的标注工具。

export type VideoEditAnnotationTool = "pen" | "rect";

VideoEditIntent

单个视频编辑 intent。

export type VideoEditIntent = {
id: string;
startSeconds: number;
endSeconds?: number;
prompt: string;
annotationShapes: VideoEditAnnotationShape[];
annotationPreview?: VideoEditAnnotationPreview;
frameWidth: number;
frameHeight: number;
};

关联类型:VideoEditAnnotationShape · VideoEditAnnotationPreview

成员说明:

  • id:稳定且唯一的 intent id。
  • startSeconds:有限、位于 [0, duration] 的起始时间(秒)。
  • endSeconds:区间终点的可选时间;缺省表示点 intent。
  • prompt:非空受限提示词。
  • annotationPreview:可选稳定标记图身份;不含则仅保存 shapes。

VideoFocusVersion

export type VideoFocusVersion = typeof VIDEO_FOCUS_VERSION;

VideoFrameSessions

export type VideoFrameSessions = {
sync(): void;
setHovered(nodeId: string | null): void;
playingNodeId(): string | null;
pauseAll(): void;
hasRealFrame(nodeId: string): boolean;
isLoading?(nodeId: string): boolean;
activeNodeIds(): string[];
diagnostics?(): {
sessions: number;
staticActive: number;
staticPending: number;
created: number;
disposed: number;
};
dispose(): void;
};

成员说明:

  • sync:按当前 canonical 画布同步会话(幂等)。
  • setHovered:设置当前 hovered 的视频节点;传 null 暂停全部。
  • playingNodeId:当前正在播放的节点 id(最多一个)。
  • pauseAll:暂停所有会话但保留最后帧。
  • hasRealFrame:该节点是否已有可用的真实帧纹理。
  • isLoading:首帧解码或播放缓冲中;只存在于浏览器呈现状态。
  • activeNodeIds:当前活动会话的节点 id(供 E2E / 排障观察)。
  • diagnostics:诊断:首帧名额的真实占用(含 draining)。

VideoLease

独占 lease:接管期间唯一可对元素执行播放/seek/读取的句柄。

export type VideoLease = {
readonly nodeId: string;
readonly owner: "direct" | "history";
state(): VideoLeaseState;
frame(): {
drawable: unknown;
width: number;
height: number;
} | null;
play(): Promise<void>;
pause(): void;
seek(time: number): Promise<void>;
setQuality(quality: VideoQuality): void;
quality(): VideoQuality;
isCurrent(): boolean;
release(): void;
};

关联类型:VideoLeaseState · VideoQuality

成员说明:

  • state:当前状态快照(读取真实元素,不缓存)。
  • frame:可呈现帧快照(不暴露原始 DOM 元素给任意 feature;只给可绘制对象与尺寸)。 未就绪/非当前来源返回 null。
  • play:播放(自动播放策略拒绝时保持最后帧)。
  • pause:暂停但保留当前帧。
  • seek:seek 到指定秒并等待可呈现。
  • setQuality:请求上传质量(只影响采样上限)。
  • quality:当前质量。
  • isCurrent:关闭本轮渲染元数据(供 rVFC 帧上传;返回是否仍是当前来源)。
  • release:释放句柄;退出动画结束后调用(归还后仅新 hover 可播放)。

VideoLeaseState

export type VideoLeaseState = {
url: string;
currentTime: number;
duration: number;
playing: boolean;
muted: boolean;
ready: boolean;
seeking: boolean;
width: number;
height: number;
};

成员说明:

  • seeking:元素是否仍在 seek(未就绪时不应上传)。

VideoQuality

上传质量命名空间:卡片 / 聚焦(只作为消费方的采样意图,registry 不决定上传尺寸)。

export type VideoQuality = "card" | "focus";

VideoSourceIdentity

来源 identity:direct 与 history 分离(design D10)。

export type VideoSourceIdentity = {
nodeId: string;
owner: "direct" | "history";
url: string;
};

成员说明:

  • nodeId:canonical 节点 id。
  • owner:来源种类;history 使用独立身份,不覆盖 direct 卡片。
  • url:受控同源 URL(同 nodeId+owner 下换 url 视为换源)。

ViewportTransitionRequest

一次取景过渡请求(由 feature adapter 按公共进度应用;不读时间)。

export type ViewportTransitionRequest = {
key: string;
from: FocusViewport;
to: FocusViewport;
duration: number;
apply: (view: FocusViewport, progress: number) => void;
};

关联类型:FocusViewport

成员说明:

  • key:过渡身份(scope/node/kind/generation),供 coordinator 取消/反向与代际守门。
  • duration:时长(毫秒);≤0 表示 reduced motion / 测试同步落位。
  • apply:按公共进度应用;progress 为 0..1 的原始进度(未缓动)。

Woohaa3CanvasDocument

export type Woohaa3CanvasDocument = {
schemaVersion: Woohaa3CanvasSchemaVersion;
nodes: Woohaa3CanvasSerializedNode[];
edges: Woohaa3CanvasEdge[];
updatedAt: string;
};

关联类型:Woohaa3CanvasSchemaVersion · Woohaa3CanvasSerializedNode · Woohaa3CanvasEdge

Woohaa3CanvasEdge

export type Woohaa3CanvasEdge = {
id: string;
source: string;
target: string;
sourceHandle?: string | null;
targetHandle?: string | null;
data: Woohaa3CanvasJsonObject;
};

关联类型:Woohaa3CanvasJsonObject

Woohaa3CanvasJsonObject

export type Woohaa3CanvasJsonObject = {
[key: string]: Woohaa3CanvasJsonValue;
};

关联类型:Woohaa3CanvasJsonValue