import { Component, ContentType, Field } from 'contensis-core-api'; import { TagGroup } from 'contensis-management-api'; import { FormContentType } from '../../models/FormContentTypeManagement'; /** * A series of static helper methods for resolving content types or components * Instance-based implementations */ export declare class ContentTypeResolver { private _contentTypes; private _components; private _tagGroups; static contentType: (caseInsensitiveId: string | undefined, contentTypes: ContentType[]) => ContentType | undefined; static contentTypes: (caseInsensitiveIds: string[] | undefined, contentTypes: ContentType[]) => ContentType[]; static component: (caseInsensitiveId: string | undefined, components: Component[]) => Component | undefined; static components: (caseInsensitiveIds: string[] | undefined, components: Component[]) => Component[]; static tagGroup: (caseInsensitiveId: string | undefined, tagGroups: TagGroup[]) => TagGroup | undefined; static tagGroups: (caseInsensitiveIds: string[] | undefined, tagGroups: TagGroup[]) => TagGroup[]; static resource: (caseInsensitiveId: string, contentTypes: ContentType[], components: Component[]) => ContentType | Component | undefined; private dependencyResolver; constructor(_contentTypes: ContentType[], _components: Component[], _tagGroups: TagGroup[]); contentType: (caseInsensitiveId: string | undefined, contentTypes?: ContentType[]) => ContentType | undefined; contentTypeId: (caseInsensitiveId: string, contentTypes?: ContentType[]) => string; contentTypes: (caseInsensitiveIds: string[] | undefined, contentTypes?: ContentType[]) => ContentType[]; component: (caseInsensitiveId: string | undefined, components?: Component[]) => Component | undefined; componentId: (caseInsensitiveId: string | undefined, components?: Component[]) => string; components: (caseInsensitiveIds: string[] | undefined, components?: Component[]) => Component[]; tagGroup: (caseInsensitiveId: string | undefined, tagGroups?: TagGroup[]) => TagGroup | undefined; tagGroupId: (caseInsensitiveId: string | undefined, tagGroups?: TagGroup[]) => string; tagGroups: (caseInsensitiveIds: string[] | undefined, tagGroups?: TagGroup[]) => TagGroup[]; resource: (caseInsensitiveId: string | undefined, contentTypes?: ContentType[], components?: Component[]) => ContentType | Component | undefined; /** * Loop through content type or component fields one time to look for all possible * dependency types in each field * @param resource Content type or Component * @returns list of dependency ids under each key of { contentTypeIds, componentIds, defaults, nodes } */ dependencies: (resource: ContentType | Component) => { contentTypes: string[]; components: string[]; tagGroups: string[]; defaults: [string, string][]; nodes: ([string] | [string, string])[]; }; /** * Resolve a child field within the supplied contentTypeId, for example field within a nested component. * Returns an object containing a field, any parent fields, and the level it * was resolved at. * @param fieldId can contain dot notation to resolve a field at any component depth starting at the uppermost field content type * @param contentTypeOrId the content type to resolve the field in * @param contentTypes optional: resolve the field within a specific list of contentTypes * @param components optional: resolve the field within a specific list of components * @returns */ deepField: (fieldId: string, contentTypeOrId: ContentType | string, contentTypes?: ContentType[], components?: Component[]) => { field?: Field; level?: number; parents?: Field[]; }; language: (resource: ContentType | Component | FormContentType) => string; }