## class: `WeavyComponent`

Base class for exposed/public weavy components. This class provides common external properties and internal data provided as contexts for sub components.

### Fields

| Name        | Type                     | Default | Description                                            | Inherited From |
| ----------- | ------------------------ | ------- | ------------------------------------------------------ | -------------- |
| `weavy`     | `WeavyType \| undefined` |         | The consumed weavy context.                            |                |
| `contextId` | `ContextIdType`          |         | Contextual guid that is unique for the client context. |                |
| `user`      | `UserType \| undefined`  |         | The current user.                                      |                |

### Methods

| Name             | Description                                          | Parameters                        | Return                    | Inherited From |
| ---------------- | ---------------------------------------------------- | --------------------------------- | ------------------------- | -------------- |
| `whenUser`       | Resolves when current user data is available.        |                                   | `Promise<UserType>`       |                |
| `whenWeavy`      | Resolves when a weavy context is available.          |                                   | `Promise<WeavyType>`      |                |
| `whenReady`      | Resolves when the component has rendered first time. |                                   | `Promise<WeavyComponent>` |                |
| `dispatchAction` | Dispatch a \`wy-action\` event on the component.     | `detail: WyActionEventDetailType` | `boolean`                 |                |

### Events

| Name    | Type          | Description                      | Inherited From |
| ------- | ------------- | -------------------------------- | -------------- |
| `ready` | `CustomEvent` | When the component has rendered. |                |

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

### Fields

| Name                | Privacy | Type                                               | Default                                                              | Description | Inherited From |
| ------------------- | ------- | -------------------------------------------------- | -------------------------------------------------------------------- | ----------- | -------------- |
| `#resolveContextId` | private | `(contextId: ContextIdType) => void \| undefined`  |                                                                      |             |                |
| `#whenContextId`    | private |                                                    | `new Promise<ContextIdType>((r) => { this.#resolveContextId = r; })` |             |                |
| `#resolveUser`      | private | `(user: UserType) => void \| undefined`            |                                                                      |             |                |
| `#whenUser`         | private |                                                    | `new Promise<UserType>((r) => { this.#resolveUser = r; })`           |             |                |
| `#resolveWeavy`     | private | `(weavy: WeavyType) => void \| undefined`          |                                                                      |             |                |
| `#whenWeavy`        | private |                                                    | `new Promise<WeavyType>((r) => { this.#resolveWeavy = r; })`         |             |                |
| `#resolveReady`     | private | `(component: WeavyComponent) => void \| undefined` |                                                                      |             |                |
| `#whenReady`        | private |                                                    | `new Promise<WeavyComponent>((r) => { this.#resolveReady = r; })`    |             |                |
| `#userQuery`        | private |                                                    | `new QueryController<UserType>(this)`                                |             |                |

</details>

<hr/>

## Exports

| Kind | Name             | Declaration    | Module                         | Package |
| ---- | ---------------- | -------------- | ------------------------------ | ------- |
| `js` | `WeavyComponent` | WeavyComponent | lib/classes/weavy-component.ts |         |
