import { FASTElement } from '@microsoft/fast-element'; declare type ConditionalExpression = { expression?: ValidExpressionType; condition?: Predicate; join?: Join; groupName?: string; }; /** * @public */ export declare const createFormCriteriaBuilder: (criteriaBuilder: CriteriaBuilder) => (config: ExpressionConfig, formValue: any, formData: T) => void; /** * Builder class used to generate query criteria * * @public */ export declare class CriteriaBuilder { private expressions; withExpression(expression: ValidExpressionType, options?: ExpressionOptions, groupJoin?: Join): this; And: (expression: ValidExpressionType, options?: ExpressionOptions) => this; Or: (expression: ValidExpressionType, options?: ExpressionOptions) => this; Not: (expression: ValidExpressionType, options?: ExpressionOptions) => this; build(outputFn?: (groups: GroupedExpressions) => string): string; reset(): void; private parseExpression; } /** * Main class which defines the criteria segmented control component. * * @remarks * * Displays segmented criteria and dispatches events with the selected criteria. * * @public * * @example * Example of using the component: * ``` * * const toolbarOptions: CriteriaSegmentedControlOption[] = [ * { label: 'A', field: 'INSTRUMENT_ID', value: 'id1', serialiser: Serialisers.EQ }, * { label: 'B', field: 'INSTRUMENT_ID', value: 'id2', serialiser: Serialisers.EQ }, * { label: 'C', field: 'INSTRUMENT_ID', value: 'id3', serialiser: Serialisers.EQ }, * ]; * * toolbarOptions} * :value=${sync((x) => x.criteriaFilter)} * > * * * ``` * */ export declare class CriteriaSegmentedControl extends FASTElement { criteriaOptions: CriteriaSegmentedControlOption[]; /** * design system prefix to use for component tags * @internal * */ prefix: any; value: string; valueChanged(): void; selectedLabel: string; selectedLabelChanged(): void; itemClickHandler(label: string): void; private createCriteria; } /** * @internal */ export declare type CriteriaSegmentedControlOption = { field: string; value: unknown; serialiser: Serialiser; label: string; }; /** * @internal */ export declare type Expression = { field: string; value: unknown; serialiser: Serialiser; params: any; valueGetter?: (value: unknown) => string; group: string; }; /** * @public */ export declare class ExpressionBuilder { private field; private value; private serialiser; private params; private valueGetter; private group; constructor(opts?: Partial<{ field: string; value: unknown; serialiser: Serialiser; params: any; valueGetter: (value: unknown) => string; group: string; }>); withField(field: string): ExpressionBuilder; withValue(value: unknown): ExpressionBuilder; withSerialiser(serialiser: Serialiser): ExpressionBuilder; withParams(params: any): ExpressionBuilder; withValueGetter(valueGetter: (value: unknown) => string): ExpressionBuilder; withGroup(group: string): ExpressionBuilder; build: () => Expression; } /** * Interface for fields to implement to generate expression criteria * @public */ export declare type ExpressionConfig = { criteria: (value: V, filters: T) => ExpressionParams | Array>; }; /** * Maps form fields to expression configuration * @public */ export declare type ExpressionConfigMap = Partial<{ [key in keyof T]: ExpressionConfig; }>; /** * @internal */ export declare type ExpressionList = Array; declare type ExpressionOptions = Omit; /** * @internal */ export declare type ExpressionParams = [ string | string[], Serialiser, ExpressionValueType | ExpressionValueType[], boolean?, GroupName? ]; declare type ExpressionValueType = number | string | boolean | undefined | null | Function; declare type GroupedExpressions = Record; /** * Used to describe how Expressions are joined * @public */ export declare class Join { private $$operator; constructor(type: Operator); static And(): Join; static Or(): Join; static Not(): Join; static GreaterThan(): Join; static GreaterThanOrEqual(): Join; static LessThan(): Join; static LessThanOrEqual(): Join; static NotEqual(): Join; static Equal(): Join; get operator(): Operator; } /** * @internal */ export declare enum Operator { AND = "&&", OR = "||", NOT = "!", GT = ">", GE = ">=", LT = "<", LE = "<=", NE = "!=", EQ = "==" } declare type Predicate = () => boolean; /** * @internal */ export declare type Serialiser = (e: Expression) => string; /** * Functions to to serialise an Expression to a string * @public */ export declare const Serialisers: { AND: (e: Expression) => string; OR: (e: Expression) => string; NOT: (e: Expression) => string; GT: (e: Expression) => string; GE: (e: Expression) => string; LT: (e: Expression) => string; LE: (e: Expression) => string; NE: (e: Expression) => string; EQ: (e: Expression) => string; equals: (e: Expression) => string; equalsIgnoreCase: (e: Expression) => string; contains: (e: Expression) => string; fieldContains: (e: Expression) => string; containsIgnoreCase: (e: Expression) => string; startsWith: (e: Expression) => string; endsWith: (e: Expression) => string; dateIsToday: (e: Expression) => string; dateIsEqual: (e: Expression) => string; dateIsGreaterEqual: (e: Expression) => string; dateIsLessEqual: (e: Expression) => string; dateTimeIsGreaterEqual: (e: Expression) => string; dateTimeIsLessEqual: (e: Expression) => string; }; declare type ValidExpressionType = Expression | ExpressionList | string; export { }