[**@wocart/theme v4.1.0**](../../README)

***

[@wocart/theme](../../README) / [index](../README) / resolveSurfaceDocument

# Function: resolveSurfaceDocument()

> **resolveSurfaceDocument**(`theme`, `surface`, `saved`, `scope?`): [`SurfaceDocument`](../interfaces/SurfaceDocument)

The page a surface or area renders: the saved document when this theme can
render it, else the theme's default (`SurfaceSpec.document` or
`AreaSpec.document`, or an empty page). A saved document that names another theme, or whose sections
this catalog knows none of, renders the default — a theme switch must not
leave an empty page. A deliberately emptied document renders empty. The
result is completed (`completePage`), so required and fixed blocks render
whatever was saved.

## Parameters

### theme

[`ThemeDefinition`](../interfaces/ThemeDefinition)

### surface

`string`

### saved

`unknown`

### scope?

[`ResolutionScope`](../interfaces/ResolutionScope)

## Returns

[`SurfaceDocument`](../interfaces/SurfaceDocument)
