Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/payload/src/collections/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -383,7 +385,7 @@ export type CollectionAdminOptions = {
}
}
/** Extension point to add your custom data. Available in server and client. */
custom?: Record<string, any>
custom?: CollectionAdminCustom
/**
* Default columns to show in list view
*/
Expand Down Expand Up @@ -506,7 +508,7 @@ export type CollectionConfig<TSlug extends CollectionSlug = any> = {
*/
auth?: boolean | IncomingAuthType
/** Extension point to add your custom data. Server only. */
custom?: Record<string, any>
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
Expand Down
13 changes: 10 additions & 3 deletions packages/payload/src/globals/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -134,7 +141,7 @@ export type GlobalAdminOptions = {
}
}
/** Extension point to add your custom data. Available in server and client. */
custom?: Record<string, any>
custom?: GlobalAdminCustom
/**
* Custom description for collection
*/
Expand Down Expand Up @@ -179,7 +186,7 @@ export type GlobalConfig<TSlug extends GlobalSlug = any> = {
}
admin?: GlobalAdminOptions
/** Extension point to add your custom data. Server only. */
custom?: Record<string, any>
custom?: GlobalCustom
/**
* Customize the SQL table name
*/
Expand Down
8 changes: 8 additions & 0 deletions packages/payload/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,14 @@ export {

export interface FieldCustom extends Record<string, any> {}

export interface CollectionCustom extends Record<string, any> {}

export interface CollectionAdminCustom extends Record<string, any> {}

export interface GlobalCustom extends Record<string, any> {}

export interface GlobalAdminCustom extends Record<string, any> {}

export { sanitizeFields } from './fields/config/sanitize.js'

export type {
Expand Down
12 changes: 11 additions & 1 deletion packages/plugin-import-export/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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[]
}
}
}
Loading