# CoverApi

interface in `@dioramajs/diorama/transitions`

```ts
import type { CoverApi } from '@dioramajs/diorama/transitions'
```

The `cover` service.

```ts
interface CoverApi
```

## Members

| Name | Type | Description |
| --- | --- | --- |
| `state` | `ReadonlySignal<CoverState>` | Where the cover is. |
| `close` | `close(at?: CoverOrigin): Promise<boolean>` | Closes the cover over the page from `at`, or the viewport centre. Resolves true once the page is covered, false at once when the cover can't play (reduced motion, no 3D, the engine not ready in time). Opens again by itself when the page changes, or after `timeout`. |
| `load` | `load(): Promise<boolean>` | Loads the engine and the cover now. Resolves false when the cover can't play. |
| `open` | `open(): void` | Opens the cover now, without waiting for a page change. |

Also exported from `@dioramajs/transitions/cover`.

Defined in [packages/transitions/src/cover/types.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/transitions/src/cover/types.ts#L103).
