@ai-stack/payloadcms
Version:
<p align="center"> <img alt="Payload AI Plugin" src="assets/payload-ai-intro.gif" width="100%" /> </p>
15 lines (14 loc) • 914 B
TypeScript
import type { Field, GlobalConfig, CollectionConfig, ClientGlobalConfig, ClientCollectionConfig } from 'payload';
type AnyCollectionConfig = GlobalConfig | CollectionConfig | ClientGlobalConfig | ClientCollectionConfig;
/**
* Resolve a Payload field definition by a full schemaPath like:
* "{collectionSlug}.fieldA.subFieldB.blockSlug.innerField"
*
* Notes:
* - Tabs are a UI construct and are not part of schemaPath (fields inside tabs are at the same level).
* - Blocks include the block slug as part of the path (we must consume it between the block field and its inner fields).
* - Unnamed row/group/collapsible fields are UI-only groupings and are not part of schemaPath
* either (fields inside them are at the same level), matching how the plugin builds paths.
*/
export declare const getFieldBySchemaPath: (collectionConfig: AnyCollectionConfig, schemaPath: string) => Field | null;
export {};