> ## Documentation Index
> Fetch the complete documentation index at: https://qawolf-mintlify-79e74a8b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Types Reference

> Reference notes for the public types used by @qawolf/testkit.

These are the main public types exposed through `@qawolf/testkit` and `@qawolf/testkit/client`.

## `MountCifsShareOptions`

```ts theme={null}
type MountCifsShareOptions = {
  mountPoint: string;
  password: string;
  share: string;
  username: string;
};
```

Used by:

* `mountCifsShare(...)`
* `TestkitPorts["mountCifsShare"]`

Example:

```ts theme={null}
const options: MountCifsShareOptions = {
  mountPoint: "/Volumes/shared",
  password: "secret",
  share: "//server/share",
  username: "wolf",
};
```

## `StartOpenVpnOptions`

```ts theme={null}
type StartOpenVpnOptions = {
  configPath: string;
  routeHosts?: string[];
  routeIps?: string[];
  routeNoPull?: boolean;
};
```

Used by:

* `startOpenVpn(...)`
* `TestkitPorts["startOpenVpn"]`

Example:

```ts theme={null}
const options: StartOpenVpnOptions = {
  configPath: "/tmp/test.ovpn",
  routeHosts: ["internal.example.com"],
};
```

## `StartWireGuardOptions`

```ts theme={null}
type StartWireGuardOptions = {
  configPath: string;
};
```

Used by:

* `TestkitPorts["startWireGuard"]`

The current code exposes this through the client ports, but there is no top-level `startWireGuard(...)` helper export today.

Example:

```ts theme={null}
const options: StartWireGuardOptions = {
  configPath: "/tmp/test.conf",
};
```

## `Screenshotable`

```ts theme={null}
type Screenshotable = {
  screenshot: (screenshotOptions?: unknown) => Promise<Buffer>;
};
```

Used by `saveBaselineScreenshot(...)`. Any page or locator-like object that supports this screenshot method shape can be used.

Example:

```ts theme={null}
const pageLike: Screenshotable = {
  screenshot: async () => Buffer.from("image"),
};
```

## `SaveBaselineScreenshot`

```ts theme={null}
type SaveBaselineScreenshot = (
  pageOrLocator: Screenshotable,
  name: string,
  screenshotOptions?: unknown,
) => Promise<void>;
```

Example:

```ts theme={null}
await saveBaselineScreenshot(page, "login-page");
await saveBaselineScreenshot(locator, "login-form", {
  animations: "disabled",
});
```

## `SaveSnapshot`

```ts theme={null}
type SaveSnapshot = (name: string, bytes: Buffer) => Promise<void>;
```

This is the lower-level runner port used to implement `saveBaselineScreenshot(...)`.

Example:

```ts theme={null}
const saveSnapshot: SaveSnapshot = async (name, bytes) => {
  console.log(name, bytes.length);
};
```

## `TestkitPorts`

```ts theme={null}
type TestkitPorts = {
  mountCifsShare: (options: MountCifsShareOptions) => Promise<string>;
  saveSnapshot?: SaveSnapshot;
  startOpenVpn: (options: StartOpenVpnOptions) => Promise<string>;
  startWireGuard: (options: StartWireGuardOptions) => Promise<string>;
};
```

These are the environment-specific ports that runners pass to `createTestkitClient(...)`.

Example:

```ts theme={null}
const ports: TestkitPorts = {
  mountCifsShare: async ({ mountPoint }) => mountPoint,
  saveSnapshot: async (name, bytes) => {
    console.log(name, bytes.length);
  },
  startOpenVpn: async ({ configPath }) => configPath,
  startWireGuard: async ({ configPath }) => configPath,
};
```

## `TestkitClient`

`TestkitClient` is a union of:

* a client with baseline screenshot support
* a client without baseline screenshot support

If `saveSnapshot` is provided, the created client exposes `saveBaselineScreenshot(...)`. Otherwise that method is absent.

Example:

```ts theme={null}
import { createTestkitClient } from "@qawolf/testkit/client";

const client = createTestkitClient({
  mountCifsShare: async ({ mountPoint }) => mountPoint,
  startOpenVpn: async ({ configPath }) => configPath,
  startWireGuard: async ({ configPath }) => configPath,
});

console.log(client.saveBaselineScreenshot); // undefined without saveSnapshot
```
