From afe18ad47007f8625c5f7afdfe9c7c3080bcb5ac Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Fri, 15 May 2026 16:51:21 +0100 Subject: [PATCH] vault backup: 2026-05-15 16:51:21 --- raw/{ => _processed}/typescript__overview.md | 0 wiki/payloadcms/typescript.md | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) rename raw/{ => _processed}/typescript__overview.md (100%) diff --git a/raw/typescript__overview.md b/raw/_processed/typescript__overview.md similarity index 100% rename from raw/typescript__overview.md rename to raw/_processed/typescript__overview.md diff --git a/wiki/payloadcms/typescript.md b/wiki/payloadcms/typescript.md index 9fc7314..cac9ecc 100644 --- a/wiki/payloadcms/typescript.md +++ b/wiki/payloadcms/typescript.md @@ -1,11 +1,15 @@ --- -tags: [payloadcms, tech-patterns] +title: "Payload CMS — TypeScript" +aliases: [payload-typescript, payloadcms-typescript] +tags: [payloadcms, typescript, tech-patterns] topic: payloadcms sources: + - raw/typescript__overview.md - https://payloadcms.com/docs/typescript/overview - https://payloadcms.com/docs/typescript/generating-types - https://payloadcms.com/docs/typescript/ts-plugin created: 2026-05-15 +updated: 2026-05-15 --- # PayloadCMS — TypeScript @@ -13,9 +17,18 @@ created: 2026-05-15 ## Overview - Payload is built entirely in TypeScript — native first-class support, no bolt-on. -- Scaffold with `npx create-payload-app@latest` and pick a TS template. +- Scaffold a new project: `npx create-payload-app@latest` → pick a TypeScript template. - The generated `payload-types.ts` file wires up automatic type inference across the entire Local API. +## Key Takeaways + +- Payload is TypeScript-native — all internals, config, hooks, and access control are fully typed. +- Use `npx create-payload-app@latest` to bootstrap; all templates are TypeScript by default. +- Run `payload generate:types` after every schema change to keep `payload-types.ts` in sync. +- Export custom reusable types using `interfaceName` on group/array/block/tab fields. +- The `@payloadcms/typescript-plugin` adds IDE path validation and autocomplete for `PayloadComponent` strings — it does NOT affect `tsc` or builds. +- Exported types cover: Config, Collections, Globals, Fields, Hooks, and FormState. + ## Key Steps / Concepts ### Generating Types