# IResourceWithWaitSupport

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `13.4.0`
- Kind: `interface`
- Source: [GitHub](https://github.com/microsoft/aspire)

Represents a resource that can wait for other resources to be running, health, and/or completed.

## Definition

```typescript
interface IResourceWithWaitSupport {
  waitFor(
      dependency: IResource,
      waitBehavior?: WaitBehavior): IResourceWithWaitSupport;
  waitForCompletion(
      dependency: IResource,
      exitCode?: number): IResourceWithWaitSupport;
  waitForStart(
      dependency: IResource,
      waitBehavior?: WaitBehavior): IResourceWithWaitSupport;
}
```

## Methods

- [waitFor](/reference/api/typescript/aspire.hosting/iresourcewithwaitsupport/waitfor.md) -- `method` -- Waits for another resource to be ready
    ```typescript
  waitFor(dependency: IResource, waitBehavior?: WaitBehavior): IResourceWithWaitSupport
  ```
- [waitForCompletion](/reference/api/typescript/aspire.hosting/iresourcewithwaitsupport/waitforcompletion.md) -- `method` -- Waits for the dependency resource to enter the Exited or Finished state before starting the resource.
    ```typescript
  waitForCompletion(dependency: IResource, exitCode?: number): IResourceWithWaitSupport
  ```
- [waitForStart](/reference/api/typescript/aspire.hosting/iresourcewithwaitsupport/waitforstart.md) -- `method` -- Waits for another resource to start
    ```typescript
  waitForStart(dependency: IResource, waitBehavior?: WaitBehavior): IResourceWithWaitSupport
  ```
