# ToSSGResult

**Kind:** Interface

**Source:** [`src/helper/ssg/ssg.ts`](https://github.com/honojs/hono/blob/main/src/helper/ssg/ssg.ts#L44)

**Part of:** [Helper](subsystem-src-helper)

`ToSSGResult` represents the outcome of a static site generation operation. It reports whether generation succeeded, lists generated file paths, and carries an `Error` when the operation fails.

## Properties

| Property | Type |
|---|---|
| `success` | `boolean` |
| `files` | `string[]` |
| `error` | `Error` |

## Diagram

```mermaid
graph LR
  SSG[Static site generation] --> Result[ToSSGResult]
  Result --> Success[success: boolean]
  Result --> Files[files: string[]]
  Result --> Error[error: Error]
```

## Usage

```ts
import type { ToSSGResult } from "./src/helper/ssg/ssg";

function reportGeneration(result: ToSSGResult): void {
  if (result.success) {
    console.log("Generated files:", result.files);
    return;
  }

  console.error("Static site generation failed:", result.error);
}

const result: ToSSGResult = {
  success: true,
  files: ["dist/index.html", "dist/about/index.html"],
  error: new Error(),
};

reportGeneration(result);
```

## AI Coding Instructions

- Return `success`, `files`, and `error` together when creating a `ToSSGResult`.
- Check `success` before treating entries in `files` as generated output.
- Pass the original failure through the `error` field so callers can log or handle it.
- Keep `files` limited to paths produced by the static site generation operation.
