rulepilot
Version:
Rule parsing engine for JSON rules
28 lines (27 loc) • 923 B
TypeScript
export declare class Mutator {
#private;
/**
* Adds a mutation to the mutator instance.
* @param name The name of the mutation.
* @param mutation The mutation function.
*/
add(name: string, mutation: Function): void;
/**
* Removes a mutation to the mutator instance.
* Any cached mutation values for this mutation will be purged.
* @param name The name of the mutation.
*/
remove(name: string): void;
/**
* Clears the mutator cache.
* The entire cache, or cache for a specific mutator, can be cleared
* by passing or omitting the mutator name as an argument.
* @param name The mutator name to clear the cache for.
*/
clearCache(name?: string): void;
/**
* Mutates and returns a criteria object.
* @param criteria The criteria to mutate.
*/
mutate(criteria: object | object[]): Promise<object | object[]>;
}