UNPKG

@r1tsu/payload

Version:

326 lines 16.4 kB
import type { LivePreviewConfig, ServerOnlyLivePreviewProperties } from '../../config/types.js'; export type ServerOnlyCollectionProperties = keyof Pick<SanitizedCollectionConfig, 'access' | 'custom' | 'endpoints' | 'hooks'>; export type ServerOnlyCollectionAdminProperties = keyof Pick<SanitizedCollectionConfig['admin'], 'components' | 'hidden' | 'preview'>; export type ClientCollectionConfig = Omit<SanitizedCollectionConfig, 'admin' | 'fields' | ServerOnlyCollectionProperties> & { admin: Omit<SanitizedCollectionConfig['admin'], 'fields' | 'livePreview' | ServerOnlyCollectionAdminProperties> & { livePreview?: Omit<LivePreviewConfig, ServerOnlyLivePreviewProperties>; }; fields: ClientFieldConfig[]; }; import type { TFunction } from '@payloadcms/translations'; import type { ClientFieldConfig } from '../../fields/config/client.js'; import type { SanitizedCollectionConfig } from './types.js'; export declare const createClientCollectionConfig: ({ collection, t, }: { collection: SanitizedCollectionConfig; t: TFunction; }) => { auth: import("../../auth/types.js").Auth; endpoints: false | import("../../config/types.js").Endpoint[]; fields: import("../../exports/types.js").Field[]; upload: import("../../uploads/types.js").SanitizedUploadConfig; versions: import("../../versions/types.js").SanitizedCollectionVersions; admin: { components: { AfterList: import("../../config/types.js").CustomComponent[]; AfterListTable: import("../../config/types.js").CustomComponent[]; BeforeList: import("../../config/types.js").CustomComponent[]; BeforeListTable: import("../../config/types.js").CustomComponent[]; edit: { PreviewButton: import("../../admin/types.js").CustomPreviewButton; PublishButton: import("../../admin/types.js").CustomPublishButton; SaveButton: import("../../admin/types.js").CustomSaveButton; SaveDraftButton: import("../../admin/types.js").CustomSaveDraftButton; }; views: { Edit: import("../../config/types.js").EditViewComponent | { API: import("../../config/types.js").EditViewComponent | { Tab: import("../../admin/types.js").DocumentTabComponent | { Pill: import("react").ComponentType<{}>; condition: import("../../admin/types.js").DocumentTabCondition; href: string | ((args: { apiURL: string; collection: SanitizedCollectionConfig; global: import("../../exports/types.js").SanitizedGlobalConfig; id?: string; routes: { admin: string; api: string; graphQL: string; graphQLPlayground: string; }; }) => string); isActive: boolean | ((args: { href: string; }) => boolean); label: string | ((args: { t: (key: string) => string; }) => string); newTab: boolean; }; path: string; } | { Component: import("../../config/types.js").EditViewComponent; path: string; } | { actions: import("../../config/types.js").CustomComponent<any>[]; }; Default: import("../../config/types.js").EditViewComponent | { Tab: import("../../admin/types.js").DocumentTabComponent | { Pill: import("react").ComponentType<{}>; condition: import("../../admin/types.js").DocumentTabCondition; href: string | ((args: { apiURL: string; collection: SanitizedCollectionConfig; global: import("../../exports/types.js").SanitizedGlobalConfig; id?: string; routes: { admin: string; api: string; graphQL: string; graphQLPlayground: string; }; }) => string); isActive: boolean | ((args: { href: string; }) => boolean); label: string | ((args: { t: (key: string) => string; }) => string); newTab: boolean; }; path: string; } | { Component: import("../../config/types.js").EditViewComponent; path: string; } | { actions: import("../../config/types.js").CustomComponent<any>[]; }; LivePreview: import("../../config/types.js").EditViewComponent | { Tab: import("../../admin/types.js").DocumentTabComponent | { Pill: import("react").ComponentType<{}>; condition: import("../../admin/types.js").DocumentTabCondition; href: string | ((args: { apiURL: string; collection: SanitizedCollectionConfig; global: import("../../exports/types.js").SanitizedGlobalConfig; id?: string; routes: { admin: string; api: string; graphQL: string; graphQLPlayground: string; }; }) => string); isActive: boolean | ((args: { href: string; }) => boolean); label: string | ((args: { t: (key: string) => string; }) => string); newTab: boolean; }; path: string; } | { Component: import("../../config/types.js").EditViewComponent; path: string; } | { actions: import("../../config/types.js").CustomComponent<any>[]; }; Version: import("../../config/types.js").EditViewComponent | { Tab: import("../../admin/types.js").DocumentTabComponent | { Pill: import("react").ComponentType<{}>; condition: import("../../admin/types.js").DocumentTabCondition; href: string | ((args: { apiURL: string; collection: SanitizedCollectionConfig; global: import("../../exports/types.js").SanitizedGlobalConfig; id?: string; routes: { admin: string; api: string; graphQL: string; graphQLPlayground: string; }; }) => string); isActive: boolean | ((args: { href: string; }) => boolean); label: string | ((args: { t: (key: string) => string; }) => string); newTab: boolean; }; path: string; } | { Component: import("../../config/types.js").EditViewComponent; path: string; } | { actions: import("../../config/types.js").CustomComponent<any>[]; }; Versions: import("../../config/types.js").EditViewComponent | { Tab: import("../../admin/types.js").DocumentTabComponent | { Pill: import("react").ComponentType<{}>; condition: import("../../admin/types.js").DocumentTabCondition; href: string | ((args: { apiURL: string; collection: SanitizedCollectionConfig; global: import("../../exports/types.js").SanitizedGlobalConfig; id?: string; routes: { admin: string; api: string; graphQL: string; graphQLPlayground: string; }; }) => string); isActive: boolean | ((args: { href: string; }) => boolean); label: string | ((args: { t: (key: string) => string; }) => string); newTab: boolean; }; path: string; } | { Component: import("../../config/types.js").EditViewComponent; path: string; } | { actions: import("../../config/types.js").CustomComponent<any>[]; }; } | { [x: string]: { Tab: import("../../admin/types.js").DocumentTabComponent | { Pill: import("react").ComponentType<{}>; condition: import("../../admin/types.js").DocumentTabCondition; href: string | ((args: { apiURL: string; collection: SanitizedCollectionConfig; global: import("../../exports/types.js").SanitizedGlobalConfig; id?: string; routes: { admin: string; api: string; graphQL: string; graphQLPlayground: string; }; }) => string); isActive: boolean | ((args: { href: string; }) => boolean); label: string | ((args: { t: (key: string) => string; }) => string); newTab: boolean; }; path: string; } | { Component: import("../../config/types.js").EditViewComponent; path: string; } | { actions: import("../../config/types.js").CustomComponent<any>[]; }; }; List: import("react").ComponentType<any> | { Component: import("react").ComponentType<any>; actions: import("../../config/types.js").CustomComponent[]; }; }; }; custom: { [x: string]: any; }; defaultColumns: string[]; description: string | import("../../config/types.js").EntityDescriptionComponent | import("../../config/types.js").EntityDescriptionFunction | { [x: string]: string; }; enableRichTextLink: boolean; enableRichTextRelationship: boolean; group: string | { [x: string]: string; }; hidden: boolean | ((args: { user: import("../../auth/types.js").ClientUser; }) => boolean); hideAPIURL: boolean; listSearchableFields: string[]; livePreview: { breakpoints: { height: string | number; label: string; name: string; width: string | number; }[]; url: string | ((args: { collectionConfig?: SanitizedCollectionConfig; data: Record<string, any>; globalConfig?: import("../../exports/types.js").SanitizedGlobalConfig; locale: import("../../config/types.js").Locale; payload: import("../../index.js").Payload; }) => string | Promise<string>); }; pagination: { defaultLimit: number; limits: number[]; }; preview: import("../../config/types.js").GeneratePreviewURL; useAsTitle: string; }; custom: { [x: string]: any; }; graphQL: false | { pluralName: string; singularName: string; }; hooks: { afterChange: import("./types.js").AfterChangeHook<any>[]; afterDelete: import("./types.js").AfterDeleteHook<any>[]; afterError: import("./types.js").AfterErrorHook; afterForgotPassword: import("./types.js").AfterForgotPasswordHook[]; afterLogin: import("./types.js").AfterLoginHook<any>[]; afterLogout: import("./types.js").AfterLogoutHook<any>[]; afterMe: import("./types.js").AfterMeHook<any>[]; afterOperation: import("./types.js").AfterOperationHook<any>[]; afterRead: import("./types.js").AfterReadHook<any>[]; afterRefresh: import("./types.js").AfterRefreshHook<any>[]; beforeChange: import("./types.js").BeforeChangeHook<any>[]; beforeDelete: import("./types.js").BeforeDeleteHook[]; beforeLogin: import("./types.js").BeforeLoginHook<any>[]; beforeOperation: import("./types.js").BeforeOperationHook[]; beforeRead: import("./types.js").BeforeReadHook<any>[]; beforeValidate: import("./types.js").BeforeValidateHook<any>[]; }; typescript: { interface: string; }; access: { admin: ({ req }: { req: import("../../types/index.js").PayloadRequestWithData; }) => boolean | Promise<boolean>; create: import("../../config/types.js").Access; delete: import("../../config/types.js").Access; read: import("../../config/types.js").Access; readVersions: import("../../config/types.js").Access; unlock: import("../../config/types.js").Access; update: import("../../config/types.js").Access; }; dbName: import("../../database/types.js").DBIdentifierName; defaultSort: string; disableDuplicate: boolean; labels: { plural: string | import("../../config/types.js").LabelFunction | { [x: string]: string; }; singular: string | import("../../config/types.js").LabelFunction | { [x: string]: string; }; }; slug: string; timestamps: boolean; }; export declare const createClientCollectionConfigs: ({ collections, t, }: { collections: SanitizedCollectionConfig[]; t: TFunction; }) => ClientCollectionConfig[]; //# sourceMappingURL=client.d.ts.map