@heybox/hb-sdk API Reference - v0.9.5
    正在准备搜索索引...

    函数 viewDocument

    • 构造一个携带当前 schema 版本的视图文档。

      参数

      • regions: readonly {
            emptyText?: string;
            errorText?: string;
            id: string;
            nodes: ViewNode[];
            notice?: {
                dismissible?: boolean;
                id: string;
                text: string;
                tone?: "default" | "success" | "warning" | "accent" | "muted" | "danger";
            };
            refreshing?: boolean;
            retry?: {
                commandId: string;
                input?: JSONType;
                inputFrom?: Record<string, string>;
            };
            retryPresentation?: "button"
            | "inline";
            status: "error" | "ready" | "empty" | "loading";
            title?: string;
        }[]

        文档区域。

      • 可选options: ViewDocumentOptions

        文档级过渡等渐进增强配置。

      返回 {
          regions: {
              emptyText?: string;
              errorText?: string;
              id: string;
              nodes: ViewNode[];
              notice?: {
                  dismissible?: boolean;
                  id: string;
                  text: string;
                  tone?: "default" | "success" | "warning" | "accent" | "muted" | "danger";
              };
              refreshing?: boolean;
              retry?: {
                  commandId: string;
                  input?: JSONType;
                  inputFrom?: Record<string, string>;
              };
              retryPresentation?: "button"
              | "inline";
              status: "error" | "ready" | "empty" | "loading";
              title?: string;
          }[];
          schema: number;
          transition?: { effect: "crossfade"
          | "morph" };
      }