## class: `WyFileVersions`, `wy-file-versions`

File versions list for a file — displays available versions and actions (download, revert, remove).

**Used sub components:**

*   [`<wy-item-list>`](./ui/wy-item)
*   [`<wy-item>`](./ui/wy-item)
*   [`<wy-dropdown>`](./ui/wy-dropdown)
*   [`<wy-dropdown-divider>`](./ui/wy-dropdown)
*   [`<wy-dropdown-item>`](./ui/wy-dropdown)
*   [`<wy-icon>`](./ui/wy-icon)
*   [`<wy-progress-circular>`](./ui/wy-progress-circular)
*   [`<wy-empty>`](./wy-empty)

### Fields

| Name            | Type                       | Default | Description                                                                   | Inherited From        |
| --------------- | -------------------------- | ------- | ----------------------------------------------------------------------------- | --------------------- |
| `file`          | `FileType \| undefined`    |         | Source file whose version timeline should be displayed.                       |                       |
| `activeVersion` | `FileType \| undefined`    |         | Currently selected version. Falls back to the latest when unset.              |                       |
| `activeDraft`   | `boolean`                  | `false` | Whether the unsaved draft is the selected entry rather than a stored version. |                       |
| `app`           | `AppType \| undefined`     |         | The app data.                                                                 | WeavySubAppComponent  |
| `apps`          | `AppListType \| undefined` |         | Multiple apps data.                                                           | WeavySubAppComponent  |
| `link`          | `LinkType \| undefined`    |         | Any provided link that should be loaded, shown and highlighted.               | WeavySubTypeComponent |

### Methods

| Name             | Description                                                                                                                                    | Parameters                        | Return                       | Inherited From        |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ---------------------------- | --------------------- |
| `selectVersion`  | Selects the provided version and emits \`file-version-select\`.                                                                                | `versionFile: FileType`           |                              |                       |
| `selectDraft`    | Selects the unsaved draft and emits \`file-version-select\` with \`draft\` set, so the host can show the draft&#xA;without entering edit mode. |                                   |                              |                       |
| `removeDraft`    | Removes any draft for the current file.                                                                                                        |                                   |                              |                       |
| `whenApp`        | Resolves when app data is available.                                                                                                           |                                   | `Promise<AppType>`           | WeavySubAppComponent  |
| `whenApps`       | Resolves when multiple app data is available.                                                                                                  |                                   | `Promise<AppListType>`       | WeavySubAppComponent  |
| `whenLink`       | Resolves when a provided link is available.                                                                                                    |                                   | `Promise<LinkType>`          | WeavySubTypeComponent |
| `whenReady`      | Resolves when the component has rendered first time.                                                                                           |                                   | `Promise<WeavySubComponent>` | WeavySubComponent     |
| `dispatchAction` | Dispatch a \`wy-action\` event on the component.                                                                                               | `detail: WyActionEventDetailType` | `boolean`                    | WeavySubComponent     |

### Events

| Name                  | Type                         | Description                                                                     | Inherited From    |
| --------------------- | ---------------------------- | ------------------------------------------------------------------------------- | ----------------- |
| `file-version-select` | `FileVersionSelectEventType` | Emitted when a file version, or the unsaved draft (\`draft\` set), is selected. |                   |
| `edit`                | `FileEditEventType`          | Emitted when the file/draft should be edited.                                   |                   |
| `ready`               | `CustomEvent`                | When the component has rendered.                                                | WeavySubComponent |

### Attributes

| Name          | Field       | Inherited From |
| ------------- | ----------- | -------------- |
| `activeDraft` | activeDraft |                |

### CSS Parts

| Name          | Description                    |
| ------------- | ------------------------------ |
| `wy-versions` | Wrapper for the versions list. |

<details><summary>Private API</summary>

### Fields

| Name                        | Privacy | Type                                                               | Default                                                                               | Description | Inherited From        |
| --------------------------- | ------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------- | ----------- | --------------------- |
| `#resolveApp`               | private | `(app: AppType) => void \| undefined`                              |                                                                                       |             | WeavySubAppComponent  |
| `#whenApp`                  | private |                                                                    | `new Promise<AppType>((r) => { this.#resolveApp = r; })`                              |             | WeavySubAppComponent  |
| `#resolveApps`              | private | `(apps: AppListType) => void \| undefined`                         |                                                                                       |             | WeavySubAppComponent  |
| `#whenApps`                 | private |                                                                    | `new Promise<AppListType>((r) => { this.#resolveApps = r; })`                         |             | WeavySubAppComponent  |
| `#resolveContextDataBlobs`  | private | `(blobs: ContextDataBlobsType) => void \| undefined`               |                                                                                       |             | WeavySubTypeComponent |
| `#whenContextDataBlobs`     | private |                                                                    | `new Promise<ContextDataBlobsType>((r) => { this.#resolveContextDataBlobs = r; })`    |             | WeavySubTypeComponent |
| `#resolveComponentFeatures` | private | `(componentFeatures: ComponentFeaturePolicy) => void \| undefined` |                                                                                       |             | WeavySubTypeComponent |
| `#whenComponentFeatures`    | private |                                                                    | `new Promise<ComponentFeaturePolicy>((r) => { this.#resolveComponentFeatures = r; })` |             | WeavySubTypeComponent |
| `#resolveLink`              | private | `(link: LinkType) => void \| undefined`                            |                                                                                       |             | WeavySubTypeComponent |
| `#whenLink`                 | private |                                                                    | `new Promise<LinkType>((r) => { this.#resolveLink = r; })`                            |             | WeavySubTypeComponent |
| `#resolveSettings`          | private | `(settings: WeavyComponentSettingsType) => void \| undefined`      |                                                                                       |             | WeavySubTypeComponent |
| `#whenSettings`             | private |                                                                    | `new Promise<WeavyComponentSettingsType>((r) => { this.#resolveSettings = r; })`      |             | WeavySubTypeComponent |
| `#resolveContextId`         | private | `(contextId: ContextIdType) => void \| undefined`                  |                                                                                       |             | WeavySubComponent     |
| `#whenContextId`            | private |                                                                    | `new Promise<ContextIdType>((r) => { this.#resolveContextId = r; })`                  |             | WeavySubComponent     |
| `#resolveUser`              | private | `(user: UserType) => void \| undefined`                            |                                                                                       |             | WeavySubComponent     |
| `#whenUser`                 | private |                                                                    | `new Promise<UserType>((r) => { this.#resolveUser = r; })`                            |             | WeavySubComponent     |
| `#resolveWeavy`             | private | `(weavy: WeavyType) => void \| undefined`                          |                                                                                       |             | WeavySubComponent     |
| `#whenWeavy`                | private |                                                                    | `new Promise<WeavyType>((r) => { this.#resolveWeavy = r; })`                          |             | WeavySubComponent     |
| `#resolveReady`             | private | `(component: WeavySubComponent) => void \| undefined`              |                                                                                       |             | WeavySubComponent     |
| `#whenReady`                | private |                                                                    | `new Promise<WeavySubComponent>((r) => { this.#resolveReady = r; })`                  |             | WeavySubComponent     |

</details>

<hr/>

## Exports

| Kind                        | Name               | Declaration    | Module                             | Package |
| --------------------------- | ------------------ | -------------- | ---------------------------------- | ------- |
| `js`                        | `WyFileVersions`   | WyFileVersions | lib/components/wy-file-versions.ts |         |
| `custom-element-definition` | `wy-file-versions` | WyFileVersions | lib/components/wy-file-versions.ts |         |
