diff --git a/packages/payload/src/collections/config/types.ts b/packages/payload/src/collections/config/types.ts index 6c4d7a153d1..d12ec14de4a 100644 --- a/packages/payload/src/collections/config/types.ts +++ b/packages/payload/src/collections/config/types.ts @@ -35,6 +35,8 @@ import type { } from '../../fields/config/types.js' import type { CollectionFoldersConfiguration } from '../../folders/types.js' import type { + CollectionAdminCustom, + CollectionCustom, CollectionSlug, JsonObject, RequestContext, @@ -383,7 +385,7 @@ export type CollectionAdminOptions = { } } /** Extension point to add your custom data. Available in server and client. */ - custom?: Record + custom?: CollectionAdminCustom /** * Default columns to show in list view */ @@ -506,7 +508,7 @@ export type CollectionConfig = { */ auth?: boolean | IncomingAuthType /** Extension point to add your custom data. Server only. */ - custom?: Record + custom?: CollectionCustom /** * Used to override the default naming of the database table or collection with your using a function or string * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations diff --git a/packages/payload/src/globals/config/types.ts b/packages/payload/src/globals/config/types.ts index 80c0ade3b24..7ae171a7acf 100644 --- a/packages/payload/src/globals/config/types.ts +++ b/packages/payload/src/globals/config/types.ts @@ -23,7 +23,14 @@ import type { } from '../../config/types.js' import type { DBIdentifierName } from '../../database/types.js' import type { Field, FlattenedField } from '../../fields/config/types.js' -import type { GlobalSlug, RequestContext, TypedGlobal, TypedGlobalSelect } from '../../index.js' +import type { + GlobalAdminCustom, + GlobalCustom, + GlobalSlug, + RequestContext, + TypedGlobal, + TypedGlobalSelect, +} from '../../index.js' import type { PayloadRequest, SelectIncludeType, Where } from '../../types/index.js' import type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js' @@ -134,7 +141,7 @@ export type GlobalAdminOptions = { } } /** Extension point to add your custom data. Available in server and client. */ - custom?: Record + custom?: GlobalAdminCustom /** * Custom description for collection */ @@ -179,7 +186,7 @@ export type GlobalConfig = { } admin?: GlobalAdminOptions /** Extension point to add your custom data. Server only. */ - custom?: Record + custom?: GlobalCustom /** * Customize the SQL table name */ diff --git a/packages/payload/src/index.ts b/packages/payload/src/index.ts index 67991eda800..935aefd5aac 100644 --- a/packages/payload/src/index.ts +++ b/packages/payload/src/index.ts @@ -1459,6 +1459,14 @@ export { export interface FieldCustom extends Record {} +export interface CollectionCustom extends Record {} + +export interface CollectionAdminCustom extends Record {} + +export interface GlobalCustom extends Record {} + +export interface GlobalAdminCustom extends Record {} + export { sanitizeFields } from './fields/config/sanitize.js' export type { diff --git a/packages/plugin-import-export/src/index.ts b/packages/plugin-import-export/src/index.ts index 939e4810970..38dbf8120a2 100644 --- a/packages/plugin-import-export/src/index.ts +++ b/packages/plugin-import-export/src/index.ts @@ -212,7 +212,7 @@ declare module 'payload' { 'plugin-import-export'?: { /** * When `true` the field is **completely excluded** from the import-export plugin: - * - It will not appear in the “Fields to export” selector. + * - It will not appear in the "Fields to export" selector. * - It is hidden from the preview list when no specific fields are chosen. * - Its data is omitted from the final CSV / JSON export. * @default false @@ -224,4 +224,14 @@ declare module 'payload' { toCSV?: ToCSVFunction } } + + export interface CollectionAdminCustom { + 'plugin-import-export'?: { + /** + * Array of field paths that are disabled for import/export. + * These paths are collected from fields marked with `custom['plugin-import-export'].disabled = true`. + */ + disabledFields?: string[] + } + } }