viewDocument( 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" };} 参数
- 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" };
}
构造一个携带当前 schema 版本的视图文档。