# configuration/configs/snapshot.config.ts

> 26 lines of code and 2 definitions.

Tree: Project Scripts
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/scripts#file-scripts-configuration-configs-snapshot-config-ts
Source text: https://banes-lab.com/source/scripts/configuration/configs/snapshot.config.ts.txt

Listed in [configuration/configs](https://banes-lab.com/api/source/scripts/configuration/configs.md), after [configuration/configs/route.config.ts](https://banes-lab.com/source/scripts/configuration/configs/route.config.ts.md) and before [configuration/configs/viewport.config.ts](https://banes-lab.com/source/scripts/configuration/configs/viewport.config.ts.md).

## Definitions

- `SNAPSHOT_DEFAULTS` (lexical_declaration, line 3, exported)
- `SNAPSHOT_ARGV` (lexical_declaration, line 11, exported)

## Contained in

- [configuration/configs](https://banes-lab.com/anatomy/scripts/folder-scripts-configuration-configs.md)

## Source

```typescript
import type { ArgvSpec } from "@govlab/argv";

export const SNAPSHOT_DEFAULTS = {
    clickAfterMs: 9000,
    height: 900,
    settleMs: 6000,
    timeoutMs: 60_000,
    width: 1440,
} as const;

export const SNAPSHOT_ARGV: ArgvSpec = {
    command: "npm run snapshot --",
    flags: [
        { describe: "the page to open; required", name: "--url", takesValue: true },
        { describe: "write a png screenshot here", name: "--out", takesValue: true },
        { describe: "write the console log here", name: "--log", takesValue: true },
        { describe: "the chrome or edge binary; detected when absent", name: "--browser", takesValue: true },
        { describe: "click at x,y after the page settles", name: "--click", takesValue: true },
        { describe: "milliseconds to wait before the click", name: "--click-after", takesValue: true },
        { describe: "viewport width in pixels", name: "--width", takesValue: true },
        { describe: "viewport height in pixels", name: "--height", takesValue: true },
        { describe: "milliseconds to let the page settle", name: "--settle", takesValue: true },
        { describe: "milliseconds before the capture is abandoned", name: "--timeout", takesValue: true },
        { describe: "render on the gpu instead of in software", name: "--gpu", takesValue: false },
    ],
    summary:
        "Open a page in a headless browser and capture a screenshot, a console log, or both. One of --out or --log is required.",
};
```
