TypeTide
Keep your frontend's TypeScript types in sync with the APIs it consumes.
Any OpenAPI or Swagger spec in, types that read like you wrote them out.
Point TypeTide at an openapi.json or swagger.json (Express, katax, FastAPI, NestJS, Spring, ASP.NET, Hono...), choose where the types go, and it writes them for you. When the API changes, TypeTide tells you which endpoints were added, removed or modified before anything is overwritten.
Features
- Readable types.
interface Folder { ... }, GetFolderParams, CreateFolderBody, ListFoldersResponse, with the descriptions from the spec as JSDoc. No paths["/api/..."]["get"]... lookups.
- Named models. Shapes repeated across endpoints become one model (
Folder, User, FileInfo); named schemas keep their names.
- Envelope detection. A shared response wrapper such as
{ success, message, data } or { ok, result } becomes ApiResponse<T>, detected from the structure, not from property names.
- One file or one per domain.
folders.ts, auth.ts, files.ts... plus common.ts and index.ts.
- Change detection. Checks on startup (and optionally every N minutes) and shows the endpoint diff. It never overwrites your files on its own.
- Private APIs. Bearer tokens, API keys, Basic auth and key-in-the-URL, with secrets stored encrypted on your machine, never in
settings.json.
- Quiet git history. Files only change when the API does, and files of domains that disappear are removed (only files TypeTide wrote).
- Panel in the Activity Bar with every source, its status, last sync and pending changes.
Getting started
- Open the TypeTide panel in the Activity Bar and click +.
- Paste the spec URL (or a path to a local
openapi.json / .yaml), click Test connection.
- Choose One file per domain or A single file, then Save and sync.
import type { Folder, CreateFolderBody, GetFolderResponse } from './types/files-api';
What you get
// src/types/files-api/folders.ts
import type { ApiResponse } from './common';
export interface Folder {
/** Folder UUID. */
id: string;
name: string;
parent_id: string | null;
created_at: string;
}
/** GET /api/folders/{id} - Get folder details */
export interface GetFolderParams {
id: string;
}
export interface GetFolderQuery {
with_stats?: "true" | "false";
}
export type GetFolderResponse = ApiResponse<GetFolderData>;
/** POST /api/folders - Create a folder */
export interface CreateFolderBody {
name: string;
parent_id?: string | null;
}
export type CreateFolderData = Folder;
Names come from the method and the path: GET /folders is ListFolders, POST /folders is CreateFolder, GET /folders/{id} is GetFolder, PUT/PATCH is UpdateFolder, DELETE is DeleteFolder, and actions such as POST /auth/login are AuthLogin. A clean operationId wins over the path, and any name can be changed with Renames.
Private APIs
Every source can send headers and query parameters. Tick Secret on a value and it is stored encrypted on your machine with VS Code's SecretStorage (Windows Credential Manager, macOS Keychain, libsecret); settings.json only gets ${secret}, so tokens never reach git.
| API expects |
In the form |
Authorization: Bearer <token> |
+ Bearer token |
API key header (x-api-key: ...) |
+ Add header, Secret |
| Basic auth |
+ Basic auth, enter username and password |
Key in the URL (?api_key=...) |
+ Add query parameter, Secret |
| A value from an environment variable (CI) |
${env:NAME} as the value |
Teammates who clone the project enter their own secret the first time; TypeTide tells them it's missing.
Settings
Sources live in the project's .vscode/settings.json (the form writes them for you):
{
"typetide.sources": [
{
"name": "files",
"url": "https://files.vinicioesparza.dev/openapi.json",
"output": "src/types/files-api/",
"headers": { "Authorization": "${secret}" },
"renames": { "AuthLogin": "Login" }
}
]
}
| Setting |
Default |
|
typetide.sources |
[] |
name, url, output (.ts file or folder), optional headers, query, renames, enabled. Only read from workspace settings, so sources never leak into other projects. |
typetide.includePaths |
false |
Also emit openapi-typescript's raw paths / components, for openapi-fetch. |
typetide.importExtension |
"" |
Extension in imports between generated files: empty for bundlers, .js for node16 / nodenext. |
typetide.checkOnStartup |
true |
Check every source when the project opens. |
typetide.checkIntervalMinutes |
0 |
Periodic check; 0 turns it off. |
typetide.requestTimeoutSeconds |
15 |
Timeout per request. |
Commands
| Command |
|
| TypeTide: Sync all API types |
Download every spec and regenerate what changed |
| TypeTide: Check APIs for changes |
Compare every API with the last sync without writing anything |
| TypeTide: Add API source |
Open the source form |
| TypeTide: Remove source |
Remove a source, optionally with its generated files |
| TypeTide: Show log |
Output channel with the diff of every sync |
Notes
- OpenAPI 3.0, 3.1 and 3.2, JSON or YAML. Swagger 2.0 documents are converted to OpenAPI 3 automatically.
output must be inside the project folder.
- TypeTide only runs in trusted workspaces, since it downloads URLs and writes files from the workspace settings.
License
MIT
| |