/** @packageDocumentation * @module TypeConverters */ import { Primitives, PropertyDescription, PropertyRecord, PropertyValue } from "@bentley/ui-abstract"; import { ConvertedPrimitives } from "./valuetypes/ConvertedTypes"; /** Sort compare method for types that support sorting * @public */ export interface SortComparer { /** Sort function for two primitive values */ sortCompare(valueA: Primitives.Value, valueB: Primitives.Value, ignoreCase?: boolean): number; } /** Operators for all filterable types * @public */ export interface OperatorProcessor { /** Determines if two primitive values are equal */ isEqualTo(a: Primitives.Value, b: Primitives.Value): boolean; /** Determines if two primitive values are not equal */ isNotEqualTo(a: Primitives.Value, b: Primitives.Value): boolean; } /** Operators for Numeric types, DateTime, TimeSpan, or any type that supports these comparisons * @public */ export interface LessGreaterOperatorProcessor { /** Determines if a primitive values is less than another primitive value */ isLessThan(a: Primitives.Value, b: Primitives.Value): boolean; /** Determines if a primitive values is less than or equal to another primitive value */ isLessThanOrEqualTo(a: Primitives.Value, b: Primitives.Value): boolean; /** Determines if a primitive values is greater than another primitive value */ isGreaterThan(a: Primitives.Value, b: Primitives.Value): boolean; /** Determines if a primitive values is greater than or equal to another primitive value */ isGreaterThanOrEqualTo(a: Primitives.Value, b: Primitives.Value): boolean; } /** Operators for all filterable null-able types * @public */ export interface NullableOperatorProcessor { /** Determines if a primitive value is null or undefined */ isNull(value: Primitives.Value): boolean; /** Determines if a primitive value is not null or not undefined */ isNotNull(value: Primitives.Value): boolean; } /** * Type Converter base class. * @public */ export declare abstract class TypeConverter implements SortComparer, OperatorProcessor, NullableOperatorProcessor { /** Converts a primitive value to a string */ convertToString(value?: Primitives.Value): string | Promise; /** Default implementation just calls convertToString with no options */ convertToStringWithOptions(value?: Primitives.Value, _options?: { [key: string]: any; }): string | Promise; /** Converts a string to a primitive value */ convertFromString(_value: string): ConvertedPrimitives.Value | undefined | Promise; /** Default implementation just calls convertFromString with no options */ convertFromStringWithOptions(value: string, _options?: { [key: string]: any; }): ConvertedPrimitives.Value | undefined | Promise; /** Converts a value associated with a property description to a string */ convertPropertyToString(propertyDescription: PropertyDescription, value?: Primitives.Value): string | Promise; /** Converts a string with a property record to a property value */ convertFromStringToPropertyValue(value: string, propertyRecord?: PropertyRecord): Promise; /** Sort function for two primitive values */ abstract sortCompare(valueA: Primitives.Value, valueB: Primitives.Value, _ignoreCase?: boolean): number; /** Determines if two primitive values are equal */ isEqualTo(valueA: Primitives.Value, valueB: Primitives.Value): boolean; /** Determines if two primitive values are not equal */ isNotEqualTo(valueA: Primitives.Value, valueB: Primitives.Value): boolean; /** Determines if a primitive value is null or undefined */ isNull(value: Primitives.Value): boolean; /** Determines if a primitive value is not null or not undefined */ isNotNull(value: Primitives.Value): boolean; /** Determines if the converter is for a string type */ get isStringType(): boolean; /** Determines if the converter is for a numeric type */ get isLessGreaterType(): boolean; /** Determines if the converter is for a boolean type */ get isBooleanType(): boolean; /** Determines if the converter is for a nullable type */ get isNullableType(): boolean; } //# sourceMappingURL=TypeConverter.d.ts.map