Skip to main content

TypeScript 类型参考

warning

实验性包:我们保留在本通知取消之前,为了纠正糟糕的设计决策而进行重大更改的权利。

以下类型是 @remotion/vercel 的 API 的一部分:

🌐 The following types are part of the API of @remotion/vercel:

VercelSandbox

import type {VercelSandbox} from '@remotion/vercel';
(alias) type VercelSandbox = Sandbox & AsyncDisposable import VercelSandbox

一个具有 AsyncDisposable 支持的 Sandbox。由 createSandbox() 返回。

🌐 A Sandbox with AsyncDisposable support. Returned by createSandbox().

CreateSandboxOnProgress

import type {CreateSandboxOnProgress} from '@remotion/vercel';
(alias) type CreateSandboxOnProgress = (update: { progress: number; message: string; }) => Promise<void> | void import CreateSandboxOnProgress
  • progress:一个从 01 的数字,表示总体进度
  • message:当前阶段的可人类阅读的描述

RenderMediaOnVercelProgress

import type {RenderMediaOnVercelProgress} from '@remotion/vercel';
(alias) type RenderMediaOnVercelProgress = { stage: "opening-browser"; overallProgress: number; } | { stage: "selecting-composition"; overallProgress: number; } | { stage: "render-progress"; progress: RenderMediaProgress; overallProgress: number; } import RenderMediaOnVercelProgress

一个带有以下成员的判别联合(在 stage 上):

🌐 A discriminated union (on stage) with the following members:

  • {stage: 'opening-browser', overallProgress: number} - 浏览器正在被打开。
  • {stage: 'selecting-composition', overallProgress: number} - 作品正在被选中。
  • {stage: 'render-progress', progress: RenderMediaProgress, overallProgress: number} - 渲染正在进行中。progress 字段包含与 RenderMediaProgress 相同的字段。

每个变体都包括 overallProgress——一个从 01 的数字,表示加权的整体进度。

🌐 Every variant includes overallProgress — a number from 0 to 1 representing the weighted overall progress.

用作 renderMediaOnVercel()onProgress 回调类型。

🌐 Used as the onProgress callback type for renderMediaOnVercel().

RenderStillOnVercelProgress

import type {RenderStillOnVercelProgress} from '@remotion/vercel';
(alias) type RenderStillOnVercelProgress = { stage: "opening-browser"; overallProgress: number; } | { stage: "selecting-composition"; overallProgress: number; } import RenderStillOnVercelProgress

一个带有以下成员的判别联合(在 stage 上):

🌐 A discriminated union (on stage) with the following members:

  • {stage: 'opening-browser', overallProgress: number} - 浏览器正在被打开。
  • {stage: 'selecting-composition', overallProgress: number} - 作品正在被选中。

每个变体都包括 overallProgress——一个从 01 的数字,表示加权的整体进度。

🌐 Every variant includes overallProgress — a number from 0 to 1 representing the weighted overall progress.

用作 renderStillOnVercel()onProgress 回调类型。

🌐 Used as the onProgress callback type for renderStillOnVercel().

VercelBlobAccess

import type {VercelBlobAccess} from '@remotion/vercel';
(alias) type VercelBlobAccess = "public" | "private" import VercelBlobAccess

要么是 "public",要么是 "private"。用作 uploadToVercelBlob()access 参数。

🌐 Either "public" or "private". Used as the access parameter for uploadToVercelBlob().