@firecms/core
Version:
Awesome Firebase/Firestore-based headless open-source CMS
27 lines (26 loc) • 1.03 kB
TypeScript
import { AuthController, ConditionContext, JsonLogicRule, ResolvedProperty, CMSType } from "../types";
/**
* Register custom JSON Logic operations for FireCMS.
* Call this once at app initialization.
*/
export declare function registerConditionOperations(): void;
/**
* Evaluate a JSON Logic rule against the given context.
*/
export declare function evaluateCondition(rule: JsonLogicRule, context: ConditionContext): any;
/**
* Build a ConditionContext from the current property resolution context.
*/
export declare function buildConditionContext(params: {
propertyKey?: string;
values?: Record<string, any>;
previousValues?: Record<string, any>;
path: string;
entityId?: string;
index?: number;
authController: AuthController;
}): ConditionContext;
/**
* Apply PropertyConditions to a resolved property, evaluating all JSON Logic rules.
*/
export declare function applyPropertyConditions<T extends CMSType>(property: ResolvedProperty<T>, context: ConditionContext): ResolvedProperty<T>;