Skip to content

feat: add EndpointCustom augmentation interface#16179

Open
jhb-dev wants to merge 1 commit intopayloadcms:mainfrom
jhb-dev:feat/endpoint-custom-interface
Open

feat: add EndpointCustom augmentation interface#16179
jhb-dev wants to merge 1 commit intopayloadcms:mainfrom
jhb-dev:feat/endpoint-custom-interface

Conversation

@jhb-dev
Copy link
Copy Markdown
Contributor

@jhb-dev jhb-dev commented Apr 5, 2026

Payload provides CollectionCustom, GlobalCustom, CollectionAdminCustom, GlobalAdminCustom, and FieldCustom augmentation interfaces for type-safe custom data, but Endpoint.custom was typed as an inline Record<string, any> — making it impossible to augment via TypeScript module augmentation.

Adds EndpointCustom interface in packages/payload/src/index.ts alongside the existing custom interfaces, and updates Endpoint.custom in packages/payload/src/config/types.ts to use it.

Users can now augment endpoint custom data the same way they do for collections/globals:

declare module 'payload' {
  export interface EndpointCustom {
    myProperty: string
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant