UNPKG

@firecms/core

Version:

Awesome Firebase/Firestore-based headless open-source CMS

90 lines (89 loc) 4.55 kB
import { ArrayProperty, AuthController, CMSType, CustomizationController, EntityAction, EntityCollection, EntityCustomView, EntityValues, EnumValueConfig, EnumValues, NumberProperty, PropertiesOrBuilders, Property, PropertyConfig, PropertyOrBuilder, ResolvedArrayProperty, ResolvedEntityCollection, ResolvedNumberProperty, ResolvedProperties, ResolvedProperty, ResolvedStringProperty, StringProperty, UserConfigurationPersistence } from "../types"; export declare const resolveCollection: <M extends Record<string, any>>({ collection, path, entityId, values, previousValues, userConfigPersistence, propertyConfigs, ignoreMissingFields, authController }: { collection: EntityCollection<M> | ResolvedEntityCollection<M>; path: string; entityId?: string; values?: Partial<EntityValues<M>>; previousValues?: Partial<EntityValues<M>>; userConfigPersistence?: UserConfigurationPersistence; propertyConfigs?: Record<string, PropertyConfig>; ignoreMissingFields?: boolean; authController: AuthController; }) => ResolvedEntityCollection<M>; /** * Resolve property builders, enums and arrays. * @param propertyOrBuilder * @param propertyValue */ export declare function resolveProperty<T extends CMSType = CMSType, M extends Record<string, any> = any>({ propertyOrBuilder, fromBuilder, ignoreMissingFields, ...props }: { propertyKey?: string; propertyOrBuilder: PropertyOrBuilder<T, M> | ResolvedProperty<T> | PropertyOrBuilder | Property | ResolvedProperty | undefined; values?: Partial<M>; previousValues?: Partial<M>; path?: string; entityId?: string; index?: number; fromBuilder?: boolean; propertyConfigs?: Record<string, PropertyConfig<any>>; ignoreMissingFields?: boolean; authController: AuthController; }): ResolvedProperty<T> | null; export declare function getArrayResolvedProperties<M>({ propertyKey, propertyValue, property, ...props }: { propertyValue: any; propertyKey?: string; property: ArrayProperty<any> | ResolvedArrayProperty<any>; ignoreMissingFields: boolean; values?: Partial<M>; previousValues?: Partial<M>; path?: string; entityId?: string; index?: number; fromBuilder?: boolean; propertyConfigs?: Record<string, PropertyConfig>; authController: AuthController; }): ResolvedProperty[]; export declare function resolveArrayProperty<T extends any[], M>({ propertyKey, property, ignoreMissingFields, ...props }: { propertyKey?: string; property: ArrayProperty<T> | ResolvedArrayProperty<T>; values?: Partial<M>; previousValues?: Partial<M>; path?: string; entityId?: string; index?: number; fromBuilder?: boolean; propertyConfigs?: Record<string, PropertyConfig>; ignoreMissingFields?: boolean; authController: AuthController; }): ResolvedArrayProperty | null; /** * Resolve enums and arrays for properties * @param properties * @param value */ export declare function resolveProperties<M extends Record<string, any>>({ propertyKey, properties, ignoreMissingFields, ...props }: { propertyKey?: string; properties: PropertiesOrBuilders<M>; values?: Partial<M>; previousValues?: Partial<M>; path?: string; entityId?: string; index?: number; fromBuilder?: boolean; propertyConfigs?: Record<string, PropertyConfig>; ignoreMissingFields?: boolean; authController: AuthController; }): ResolvedProperties<M>; /** * Resolve enum aliases for a string or number property * @param property * @param fromBuilder */ export declare function resolvePropertyEnum(property: StringProperty | NumberProperty, fromBuilder?: boolean): ResolvedStringProperty | ResolvedNumberProperty; export declare function resolveEnumValues(input: EnumValues): EnumValueConfig[] | undefined; export declare function resolveEntityView(entityView: string | EntityCustomView<any>, contextEntityViews?: EntityCustomView<any>[]): EntityCustomView<any> | undefined; export declare function resolveEntityAction<M extends Record<string, any>>(entityAction: string | EntityAction<M>, contextEntityActions?: EntityAction<M>[]): EntityAction<M> | undefined; export declare function resolvedSelectedEntityView<M extends Record<string, any>>(customViews: (string | EntityCustomView<M>)[] | undefined, customizationController: CustomizationController, selectedTab?: string, canEdit?: boolean): { resolvedEntityViews: EntityCustomView<M>[]; selectedEntityView: EntityCustomView<M> | undefined; selectedSecondaryForm: EntityCustomView<M> | undefined; };