> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tappify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generated types

> Turn your manifest and its schemas into TypeScript so a wrong collection, procedure or setting is a compile error.

`src/tappify.d.ts` is generated from your manifest and the JSON Schemas it points at. It is
what makes `tap.storage.preferences`, `tap.server.getSummary` and `TapSettingsProps` know
their own shapes. Commit it.

```bash theme={null}
tappify extension types
```

`add`, `remove` and `dev` run it for you, and `dev` rewrites it every time the manifest
changes.

## What it declares

The file declares one named type per schema, then augments the SDK's module with maps that
point at them:

```ts theme={null}
export interface Preferences {
  compact: boolean;
  metric: 'downloads' | 'impressions';
}

declare module '@tappify/extension-sdk' {
  interface TapStorageMap {
    'preferences': { kind: 'singleton'; scope: 'user'; document: Preferences };
  }

  interface TapProcedureMap {
    'getSummary': { input: GetSummaryInput; output: GetSummaryOutput };
  }

  interface TapTelemetryEvents {
    'summary_viewed': true;
  }

  interface TapSettings extends Settings {}
}
```

| Declared from                       | Types it produces                                                                                                          |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `contributes.storage`               | `tap.storage.<name>`, and `useTapStorage("<name>")` for singletons                                                         |
| `server.procedures`                 | `tap.server.<name>(input)`, `useTapServer("<name>", input)`, and the server's `procedures.<name>` handler                  |
| `contributes.settings.schema`       | `TapSettingsProps["values"]`, the reserved singleton, and `documents.settings` on your server                              |
| `telemetry`                         | `TelemetryEvent`, so `tap.telemetry.event` takes only names you declared                                                   |
| `contributes.ai.tools`              | The input type each `tools.<id>` handler receives                                                                          |
| `contributes.ai.actions`            | `ActionId` and `ActionInput<A>`, so `tap.actions.run` type-checks                                                          |
| `contributes.ai.prompts`            | The placeholder types a prompt template resolves against                                                                   |
| `contributes.webhooks`              | `sendEvent` names and payloads                                                                                             |
| `contributes.connector.auth.fields` | `TapCredentialValues`, the shape your server reads as `credentials`                                                        |
| The Tappify event catalogue         | The payload behind each event name, so `payload.version` on `release.shipped` resolves to a field rather than to `unknown` |

The event names themselves come with the SDK, so `tap.data.subscribe` rejects a name that
does not exist whether or not you have generated. What generating adds is the payload.

Query results are not generated: the seven query kinds are fixed, so `useTapQuery` already
knows what each returns.

## When it goes stale

[`tappify extension doctor`](/extensions/test/doctor-checks) compares the file with what the
generator would write now and fails the `types.stale` check when they differ.
`tappify extension doctor --fix` rewrites it.

Names fall back to `string` while a map is empty, so `useTapStorage("preferences")` and
`useTapServer("getSummary", input)` compile before you have generated anything. A document
and a procedure output fall back to `unknown`, so reading a field off one is a compile error
until the file exists. Generate once the manifest declares the contribution, and write the
component against real fields.
