/*! Copyright (c) 2019 Siemens AG. Licensed under the MIT License. */ import { CoatyObject } from "./object"; import { ContextFilter, ObjectFilterProperties } from "./object-filter"; /** * Provides a static `matchesFilter` method to match an object against a * given object filter. Useful for retrieving matching objects on Query events * without using a database adapter. Also useful to filter out Coaty objects * that match given filter conditions before publishing with Advertise or * Channel events. */ export declare class ObjectMatcher { private static COLLATOR; /** * Gets an Intl.Collator instance that is shared by all callers. * To be used to efficiently perform language-sensitive string comparison. * The returned collator object uses default locales and options. */ static get collator(): Intl.Collator; /** * Determines whether the given object matches the given context filter. * Note that if you pass in an `ObjectFilter`, only the filter conditions are * heeded for the result. * * @param obj The object to pass the filter on. * @param filter The context filter to apply. * @returns true on match; false otherwise */ static matchesFilter(obj: CoatyObject, filter: ContextFilter): boolean; /** * @internal For internal use in framework only. * * Gets an array of property names for the given nested properties specified either * in dot notation or array notation. * * @param propNames property names as string in dot notation or as array of property names * @returns an array of nested property names */ static getFilterProperties(propNames: ObjectFilterProperties): string[]; /** * @internal For internal use in framework only. * * Gets the value of a given property for the given object. Property names may be * specified to retrieve the value of a nested property of a subordinate object. * * @param propNames property names as string in dot notation or as array of property names * @param obj a Coaty object * @returns the value of the nested properties of the given object */ static getFilterPropertyValue(propNames: ObjectFilterProperties, obj: CoatyObject): any; private static _matchesCondition; private static _createLikeRegexp; }