import * as i0 from '@angular/core'; import { OnChanges, ElementRef, EventEmitter, SimpleChanges, AfterContentInit, QueryList, OnDestroy, ComponentRef, InjectionToken, AfterViewInit, NgZone, OnInit, ChangeDetectorRef, TemplateRef } from '@angular/core'; import * as i19 from '@angular/cdk/a11y'; import { FocusableOption, FocusKeyManager } from '@angular/cdk/a11y'; import { Subject, BehaviorSubject, Observable } from 'rxjs'; import { MapOf, FieldValue } from '@sinequa/core/base'; import { NotificationsService } from '@sinequa/core/notification'; import { Clipboard } from '@angular/cdk/clipboard'; import { Overlay, OverlayPositionBuilder, ConnectedPosition } from '@angular/cdk/overlay'; import * as i20 from '@sinequa/core/intl'; import { AbstractIntlPipe, IntlService } from '@sinequa/core/intl'; import { FormatService, ValueItem, AppService } from '@sinequa/core/app-utils'; import { CCColumn, Aggregation, AggregationItem, IQuery, Select } from '@sinequa/core/web-services'; import * as i18 from '@angular/common'; declare class Autofocus implements OnChanges { value: number; element: HTMLElement; constructor(elementRef: ElementRef); private setFocus; ngOnChanges(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } interface ClickOutsideOptions { exclude?: string[]; } declare class ClickOutside { options?: ClickOutsideOptions; clickOutside: EventEmitter<{ click: UIEvent; }>; element: HTMLElement; wasInside: boolean; constructor(elementRef: ElementRef); click(event: Event): void; clickHandler(event: MouseEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } interface ScrollIntoViewOptions { active: boolean; first: boolean; } declare class ScrollIntoView implements OnChanges { private elementRef; options: ScrollIntoViewOptions; constructor(elementRef: ElementRef); ngOnChanges(changes: SimpleChanges): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class FocusKeyListItemDirective implements FocusableOption { protected element: ElementRef; tabindex: number; role: string; constructor(element: ElementRef); focus(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class FocusKeyListDirective implements OnChanges, AfterContentInit { activeItem: number; withWrap: boolean; itemSelect: EventEmitter; role: string; components: QueryList; protected keyManager: FocusKeyManager; ngOnChanges(): void; ngAfterContentInit(): void; onKeydown(event: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } interface CaretPosition { start: number; end: number; } declare const SCREEN_SIZE_RULES: InjectionToken>; declare class UIService implements OnDestroy { screenSizeRules: MapOf; notificationsService: NotificationsService; clipboard: Clipboard; _resizeEvent: Subject; _priorityResizeEvent: Subject; screenSizes: string[]; screenSize: string; elementResizeDetector: any; isDarkTheme$: BehaviorSubject; private observer; constructor(screenSizeRules: MapOf, notificationsService: NotificationsService, clipboard: Clipboard); protected resizeEventListener: (...params: any[]) => any; ngOnDestroy(): void; get resizeEvent(): Observable; get priorityResizeEvent(): Observable; /** * * @param appComponentRef * * @deprecated Not used */ appInit(appComponentRef: ComponentRef): void; addResizeListener(listener: (event?: UIEvent) => any): void; private screenSizeIs; private setScreenSize; screenSizeIsEqual(screenSize: string): boolean; screenSizeIsGreater(screenSize: string | undefined): boolean; screenSizeIsLess(screenSize: string): boolean; screenSizeIsGreaterOrEqual(screenSize: string | undefined): boolean; screenSizeIsLessOrEqual(screenSize: string): boolean; private _screenSizeTest; screenSizeTest(screenSizes: string): boolean; getContentRect(element: HTMLElement): DOMRect; getCaret(input: HTMLInputElement): CaretPosition; setCaret(input: HTMLInputElement, start: number, end?: number, text?: string, selectionAction?: UIService.SelectionAction, ensureVisible?: boolean, raiseEvent?: boolean): void; private textPositionProperties; getTextPosition(element: HTMLElement, position: number, options?: { debug: boolean; }): { top: number; left: number; lineHeight: number; }; getViewport(): ClientRect; addElementResizeListener(element: HTMLElement, listener: (this: HTMLElement) => void): void; removeElementResizeListener(element: HTMLElement, listener: (this: HTMLElement) => void): void; copyToClipboard(data: string, maxLength?: number): void; copyToClipboardCdk(data: string, maxLength?: number): void; /** * Whether the UI is in dark or light mode */ isDark(): boolean; /** * Toggle dark mode */ toggleDark(): void; private observeThemeChange; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare namespace UIService { enum SelectionAction { adjust = 0, none = 1, collapseToStart = 2, collapse = 3 } } declare class ResizeEventDirective implements AfterViewInit, OnDestroy { protected elementRef: ElementRef; protected zone: NgZone; protected uiService: UIService; resizeEvent: EventEmitter; protected resizeObserver: any; constructor(elementRef: ElementRef, zone: NgZone, uiService: UIService); protected raiseEvent: () => void; ngAfterViewInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class StickyComponent implements OnInit, AfterViewInit, OnDestroy { protected ui: UIService; protected cdRef: ChangeDetectorRef; offsets?: { top: number; bottom: number; }; container: ElementRef; top?: number; bottom?: number; scrollY: number; marginTop: number; private listener; constructor(ui: UIService, cdRef: ChangeDetectorRef); onScroll(forceScrollDown?: boolean): void; postScrollUp: (...params: any[]) => any; ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type Placement = "top" | "bottom" | "right" | "left"; /** * Directive that attaches a tooltip to the host element * * @example *
* * @example * // A template can be passed to the directive instead of a string. Here 'tooltip' is a template reference *
* * *

Title

*

{{ "this is a comment" | uppercase }}

*

Other text

*
* * @example * //HTML can be used directly (not recommanded) *
*/ declare class TooltipDirective implements OnDestroy { private overlay; private overlayPositionBuilder; private elementRef; /** * Defining a property called textOrTemplate that can be a string, a function that * returns an Observable of a string or undefined, or a TemplateRef. */ value?: TooltipDisplay | ((data?: TooltipData) => Observable | undefined); data?: TooltipData; template?: TemplateRef; /** * Setting the default value of the placement property to `bottom` */ placement: Placement; /** * List of fallback placement if *Placement* defined can't be applyied */ fallbackPlacements: Placement | Placement[]; /** * Delay in millisecond before showing/hiding the tooltip. * * Default value is 300ms */ delay: number; /** * If the tooltip should stay opened on hover */ hoverableTooltip: boolean; /** * Custom class for the tooltip */ tooltipClass?: string; /** * Applies the "has-tooltip" class to its host when displayed */ hasTooltip: boolean; private overlayRef; private subscription?; private clearTimeout?; static activeTooltip?: TooltipDirective; constructor(overlay: Overlay, overlayPositionBuilder: OverlayPositionBuilder, elementRef: ElementRef); ngOnDestroy(): void; show(): void; mouseClick(): void; hide(): void; cancelHide(): void; /** * Clear timeout function and detach overlayRef */ clear(): void; position(placement?: Placement): ConnectedPosition; fallbackPositions(): ConnectedPosition[]; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[sqTooltip]", never, { "value": { "alias": "sqTooltip"; "required": false; }; "data": { "alias": "sqTooltipData"; "required": false; }; "template": { "alias": "sqTooltipTemplate"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "fallbackPlacements": { "alias": "fallbackPlacements"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "hoverableTooltip": { "alias": "hoverableTooltip"; "required": false; }; "tooltipClass": { "alias": "tooltipClass"; "required": false; }; }, {}, never, never, false, never>; } /** * Internal component that wraps the tooltip's content */ declare class TooltipComponent { data?: T; template?: TemplateRef; tooltipClass?: string; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "sqx-tooltip", never, {}, {}, never, never, false, never>; } declare class DatePipe extends AbstractIntlPipe<(Number | Date | string), Intl.DateTimeFormatOptions> { updateValue(key: number | Date | string, params: Intl.DateTimeFormatOptions): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * A pipe to transform a number into a readable internationalized memory size label, * for example "126432" into "126 kB". * * @example * Size:{{ documentSize | sqMemorySize }} */ declare class MemorySizePipe extends AbstractIntlPipe { protected readonly formatService: FormatService; updateValue(key: number): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * When type = "diff", unit need to be set */ interface DateParams { format?: string; type?: "fromNow" | "from" | "toNow" | "to" | "calendar" | "diff" | "valueOf" | "unix" | "daysInMonth" | "iso"; suffix?: boolean; reference?: Date | number | string; unit?: Intl.RelativeTimeFormatUnit; precise?: boolean; } declare class DateFnsPipe extends AbstractIntlPipe<(Date | number | string), DateParams> { updateValue(key: Date | number | string, params?: DateParams): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * @deprecated 11.8.2 - Kept only for backward compatibility */ declare class MomentPipe extends DateFnsPipe { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class NumberPipe extends AbstractIntlPipe<(number | string), Intl.NumberFormatOptions> { updateValue(key: number | string, params: Intl.NumberFormatOptions): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } type RelativeTimeParams = { unit: Intl.RelativeTimeFormatUnit; } & Intl.RelativeTimeFormatOptions & { format?: string; }; declare class RelativeTimePipe extends AbstractIntlPipe<(string | number | Date | undefined), RelativeTimeParams> { updateValue(key: string | number | Date | undefined, params: RelativeTimeParams): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class TimePipe extends AbstractIntlPipe<(number | Date), Intl.DateTimeFormatOptions> { updateValue(key: number | Date, params: Intl.DateTimeFormatOptions): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class ValuePipe extends AbstractIntlPipe<(ValueItem | FieldValue), CCColumn> { protected readonly formatService: FormatService; updateValue(key: ValueItem | FieldValue, params: CCColumn): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Infinite Scroll Component * * The component handles the scrolling and splitting parts * It takes the whole list in which to scroll in input, and emits the updated one upon scrolling */ declare class BsVirtualScroller implements OnChanges, AfterViewInit, OnDestroy { /** * The list to be scrolled */ list: Object[]; /** * The number of items per loaded pages */ itemsNumber: number; /** * When going to a specific index */ scrollIndex: number; /** * The updated list after reaching one end of the container */ newList: EventEmitter; spacing: ElementRef; private indexTo; private observer; get subList(): Object[]; constructor(); ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare const defaultScreenSizeRules: { xxl: string; xl: string; lg: string; md: string; sm: string; xs: string; }; declare class UtilsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class VoiceRecognitionService implements OnDestroy { private intlService; private notify; recognition: any; recognizing: boolean; ignore_onend: boolean; start_timestamp: any; text: Subject; started: Subject; available: boolean; constructor(intlService: IntlService, notify: NotificationsService); init(): void; ngOnDestroy(): void; start(): void; stop(): void; toggleRecognition(): void; private onResult; private onStart; private onEnd; private onError; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare namespace VoiceRecognitionService { } declare const enUtils: any; declare const frUtils: any; declare const deUtils: any; /** * @ignore * * Used internally to avoid circular references between ExprParser, AppService and FormatService. * Do not export from the app-utils module. */ declare class AppServiceHelpers { static isString(column: CCColumn | undefined): boolean; static isCsv(column: CCColumn | undefined): boolean; static isTree(column: CCColumn | undefined): boolean; static isEntity(column: CCColumn | undefined): boolean; static isBoolean(column: CCColumn | undefined): boolean; static isDate(column: CCColumn | undefined): boolean; static isDouble(column: CCColumn | undefined): boolean; static isInteger(column: CCColumn | undefined): boolean; static isNumber(column: CCColumn | undefined): boolean; static isScalar(column: CCColumn | undefined): boolean; static isSortable(column: CCColumn | undefined): boolean; } /** * Helper class to build selection expressions * @deprecated */ declare class ExprBuilder { /** * Make a standard selection expression * (resulting in a SQL clause like "company contains 'BOEING'") * @param field Name of the field to select (eg. "company") * @param value Value of the field to select (eg. "BOEING") * @param display Optional string to display that value (eg. "Boeing") */ makeExpr(field: string, value: string, display?: string): string; /** * Make a boolean expression * @param field Name of the field to select (eg. "toto") * @param value Value of the field to select (eg. "true") * @param display Optional string to display that value (eg. "True") */ makeBooleanExpr(field: string, value: boolean, display?: string): string; /** * Make a numerical expression using a comparison operator (>, <, <=, >=, etc.) * @param field Name of the field to select (eg. "modified") * @param operator Comparison operator used for that selection (eg. ">") * @param value Value of the field to select (eg. "2020-12-15") * @param display Optional string to display that value (eg. "After Dec 15 2020") */ makeNumericalExpr(field: string, operator: ">" | ">=" | "<" | "<=" | "=" | "<>", value: number | Date | string, display?: string): string; /** * Make a list expression * @param field Name of the field to select (eg. "docformat") * @param values Values of the field to select (eg. ['htm','pdf']) * @param display Optional string to display that value (eg. "htm, pdf") */ makeListExpr(field: string, values: string[], display?: string): string; /** * Make a range expression * @param field Name of the field to select (eg. "modified") * @param from Begining of the range (eg. 2020-12-15) * @param to End of the range (eg. 2020-12-20) * @param display Optional string to display that value (eg. "[Dec 15 2020, Dec 20 2020]") */ makeRangeExpr(field: string, from: number | Date | string, to: number | Date | string, display?: string): string; /** * Make a RegExp expression * @param field Name of the field to select (eg. "company") * @param value Value of the regular expression to match (eg. "BOE.*") * @param display Optional string to display that value (eg. "Boe...") */ makeRegexpExpr(field: string, value: string, display?: string): string; /** * Make a refine expression * @param text The text to add to the query */ makeRefineExpr(text: string): string; /** * Return an expression that selects multiple values for a field * (All values are ANDed) * @param field Name of the field to select (eg. "company") * @param values Values of the field to select (eg. ['IBM','APPLE']) * @param display Optional string to display that value (eg. "IBM and Apple") */ makeAndExpr(field: string, values: (string | ValueItem)[], display?: string): string; /** * Return an expression that selects multiple values for a field * (All values are ORed) * This function should be equivalent to using makeListExpr * @param field Name of the field to select (eg. "company") * @param values Values of the field to select (eg. ['IBM','APPLE']) * @param display Optional string to display that value (eg. "IBM and Apple") */ makeOrExpr(field: string, values: (string | ValueItem)[], display?: string): string; /** * Combine a list of values with AND or OR operators * @param values the list of values * @param operator the operator */ private concatWithOperator; /** * Returns the negative expression of the given expression * eg. NOT(person:Bill GATES) * @param expr */ makeNotExpr(expr: string): string; /** * Returns an expression that is the union of given expressions * eg. person:Bill GATES OR company:MICROSOFT * @param exprs */ concatOrExpr(exprs: string[]): string; /** * Returns an expression that is the intersection of given expressions * eg. person:Bill GATES AND company:MICROSOFT * @param exprs */ concatAndExpr(exprs: string[]): string; /** * Returns an expression to select the given item * @param field Name of the field to select (eg. "company") * @param items A single or list of ValueItem object(s) (eg. content of a record) */ makeFieldExpr(field: string, items: ValueItem | ValueItem[], combineWithAnd?: boolean): string; /** * Create an expression for the given aggregation item * @param aggregation The aggregation containing this object * @param items The AggregationItem(s) to select * @param combineWithAnd If there are multiple values, combine them with AND (instead of OR) */ makeAggregationExpr(aggregation: Aggregation, items: AggregationItem | AggregationItem[], combineWithAnd?: boolean): string; /** * Combines the field with the optional display value(s) * @param field * @param display */ private formatField; /** * Return the AggregationItem list as a ValueItem list * @param items * @param isTree */ private asValueItems; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Describes a context for processing expressions */ interface ExprContext { appService: AppService; formatService: FormatService; intlService: IntlService; disallowFulltext?: boolean; } /** * The operators accepted in fielded search expressions */ declare const enum ExprOperator { none = 0, eq = 1, gt = 2, gte = 3, lt = 4, lte = 5, neq = 6, regex = 7, like = 8, contains = 9, in = 10, between = 11 } /** * The range operators accepted in fielded search expressions */ declare const enum ExprRange { none = 0, gteLte = 1, gteLt = 2, gtLte = 3, gtLt = 4 } /** * An object containing the data necessary to format an `Expr` using * [IntlService.formatMessage]{@link IntlService#formatMessage} */ interface ExprMessage { /** * The `IntlService` compatible message string */ message: string; /** * Any values referenced by `message` */ values?: { [key: string]: FieldValue; }; } /** * Options to be used with `Expr.toMessage` */ interface ExprMessageOptions { /** * If `true`, field names are included in the message */ withFields?: boolean; /** * If `true`, use any display value set in the expression */ useDisplay?: boolean; /** * Include HTML formatting in the message */ asHTML?: boolean; /** * If `true`, don't include any outer `NOT` operator in the message */ hideOuterNot?: boolean; } /** * Describes a location in a fielded search expression */ interface ExprLocation { start: number; length: number; } /** * Describes a location and value in a fielded search expression */ interface ExprValueLocation extends ExprLocation { value: string; } /** * Describes a location, value and field in a fielded search expression */ interface ExprValueInfo extends ExprValueLocation { field: string; } /** * Describes the data used in [Expr.evaluate]{@link Expr#evaluate} */ interface ExprEvaluationContext { [key: string]: any; } /** * Describes an initialization object used in the construction of an {@link Expr} from a value */ interface ExprValueInitializer { /** * The expression context */ exprContext: ExprContext; /** * A single value */ value?: string; /** * An array of values */ values?: string[]; /** * Locations of the values used in range expressions */ locations?: ExprLocation[]; /** * The operator used in the expression */ operator?: ExprOperator; /** * The field name */ field?: string; /** * The display value */ display?: string; } /** * Describes an initialization object used in the construction of a boolean {@link Expr} with a pair of operands */ interface ExprOperandsInitializer { /** * The expression context */ exprContext: ExprContext; /** * The first operand */ op1: Expr; /** * If `true` this `Expr` represents an `AND` expression, otherwise it represents an `OR` expression */ and: boolean; /** * The second operand */ op2: Expr; /** * The field name */ field?: string; /** * The display value */ display?: string; } /** * Represents a parsed fielded search expression. A tree of expression nodes is built when an expression * combines sub-expressions using boolean operators */ declare class Expr { private _field; /** * Return the field name of this expression. Return the first ancestor's non-empty field * if the field on this node is empty */ get field(): string | undefined; /** * Set the field name of this expression */ set field(value: string | undefined); private _display; private _displayObj; /** * Return the display value of this expression. Return the first ancestor's non-empty display value * if the display value on this node is empty */ get display(): string | undefined; /** * Set the display value of this expression. If the display value is a valid stringified JSON object * then set `displayObj` to the parsed object */ set display(value: string | undefined); /** * Return the display object of this expression. Return the first ancestor's non-empty display object * if the display object on this node is empty */ get displayObj(): { label?: string; display?: string; } | undefined; /** * The values of this expression */ values: string[] | undefined; /** * The locations of the values of this expression */ locations: ExprLocation[] | undefined; /** * Return the value of this expression. Note that range expressions may have multiple values */ get value(): string | undefined; /** * Set the value of this expression */ set value(value: string | undefined); /** * The operator of this expression */ operator: ExprOperator; /** * If `true` then this expression included the `NOT` boolean operator */ not: boolean; /** * If `true` then the operands of this expression are combined with the `AND` operator. * Otherwise the operands are combined with the `OR` operator */ and: boolean; /** * The operands of this expression, if any */ operands: Expr[]; /** * The parent expression, if any */ parent: Expr; /** * The expression context */ exprContext: ExprContext; /** * The distance specified in a `NEAR` expression */ near: number; /** * The position of this expression's value in the original text */ start: number; /** * The length of this expression's value in the original text */ length: number; private mergedStructured; private _evaluationRegExps; private get evaluationRegExps(); constructor(init: ExprValueInitializer | ExprOperandsInitializer); /** * Add an operand to this expression * * @param operand The operand to add * @param contextField The parser's field context, if any * @param prepend If `true` the operand is prepended to the operands */ addOperand(operand: Expr, contextField?: string, prepend?: boolean): void; /** * Return `true` if this expression is a leaf node (does have a value) */ get isLeaf(): boolean; /** * Make an expression object * * @param exprContext The expression context * @param text The value of the expression * @param field The parser's field context * @param display The display value * @param allowEmptyValue Determines how empty values will be processed when making the expression */ static makeExpr(exprContext: ExprContext, text: string, field: string, display: string, allowEmptyValue: boolean): Expr | undefined; private static resolveField; private static getColumn; /** * Return the {@link CCColumn} corresponding to this expression */ get column(): CCColumn | undefined; private static getIsStructuredField; /** * Return `true` if the expression has a non-fulltext field. In this case the expression will be a leaf node */ get isStructuredField(): boolean; /** * Return `true` if the expression only contains non-fulltext fields */ get isStructured(): boolean; /** * Return `true` if the expression and its ancestors do not have `not` set to `true` */ get isPositive(): boolean; /** * Return an `ExprValueLocation` object for the passed text. Leading and trailing * whitespace is excluded */ static getValueAndLocation(text: string): ExprValueLocation; private static parseValue; private static getOperatorText; /** * Find the first `ExprValueInfo` object from a starting position in this expression * * @param start The position at which to start the search */ findValue(start: number): ExprValueInfo | undefined; /** * Combine two expressions into a single expression. The second expression will be added to * the first expression and the first expression returned if the first expression is non-leaf * and is an `AND` expression and not negated. Otherwise, a new `AND` expression will be created * to which both expressions are added as operands. */ static combine(expr1: Expr, expr2: Expr): Expr; private normalizeField; private shouldDisplayField; private getOperatorString; private escapeValue; private getValueString; private addFieldToString; private _toString; /** * Return a string representation of this expression * * @param withFields If `true`, include field names */ toString(withFields?: boolean): string; private addDisplay; private encodeHTML; private _addValue; private addValue; private addText; private addFieldLabel; private addField; private addOperator; private _toMessage; /** * Return an `ExprMessage` for the expression which can be used with [IntlService.formatMessage]{@link IntlService#formatMessage} * for display purposes */ toMessage(options?: ExprMessageOptions): ExprMessage; private static matchNode; /** * Return `true` if this expression matches the passed one */ matchNode(expr: Expr): boolean; /** * Returns the matching expression or sub-expression in this expression with the passed one. * * @param expr The expression to match * @param filter An option filter function called on first level candidate sub-expressions * before matching within them */ find(expr: Expr, filter?: (expr: Expr) => boolean): Expr | null; /** * Perform the passed `action` on this expression and any descendant operands * * @param action The action to perform */ forEach(action: (expr: Expr) => void): void; /** * Execute the callback function on this node and any descendants until the callback returns a truthy value * in which case immediately return `true`. Otherwise return `false`. */ some(callback: (expr: Expr) => boolean): boolean; /** * Execute the callback function on this node and any descendants until the callback returns a falsy value * in which case, immediately return `false`. Otherwise return `true`. */ every(callback: (expr: Expr) => boolean): boolean; /** * Return `true` if the exoression has at least one fulltext operand. * The test on `isPositive` filters expressions that only contain * negative fulltext terms which will be ignored on the server. Fulltext * expressions must have at least one positive term. */ get hasRelevance(): boolean; /** * Return an array of all fields used in this expression */ getFields(): string[]; /** * Return an array of all values used in this expression that pertain to the passed field and where the associated `isPositive` * field matches the passed `positive` parameter * * @param field The field for which values are to be returned * @param positive The value to test against `isPositive` */ getValues(field: string, positive?: boolean): string[]; private getDataValue; private getWildcardRegExp; private compare; /** * Evaluate this expression using `data` to provide field values. Field values * can contain scopes (full stop separated components) to reference sub-objects * in the data * * @param data The field values to be used in the evaluation * @param defaultScope If a field value cannot be resolved then try to retrieve a value with this scope prepended to the field name * @return The boolean result of the expression evaluation */ evaluate(data: ExprEvaluationContext, defaultScope?: string): boolean; } /** * @ignore */ declare const enum Token { invalid = -1, or = 0, and = 1, not = 2, near = 3, infixNear = 4, lPar = 5, rPar = 6, eof = 7, value = 8 } /** * Parsing options */ interface ExprParserOptions { /** * If `true` then a fielded search expression with no value will not generate an error. This would be used * when providing feedback during text entry */ allowEmptyValues?: boolean; /** * If `true`, fields can contain the scoping character (`.`). This is typically used with `Expr.evaluate` */ allowScopedFields?: boolean; /** * If `true` then arbitrary field names are permitted. This is typically used with `Expr.evaluate` */ disallowFulltext?: boolean; /** * If `true` then fielded search is enabled */ enabledFieldedSearch?: boolean; } /** * @ignore */ declare class ExprParserOperator { static invalid: ExprParserOperator; static or: ExprParserOperator; static and: ExprParserOperator; static not: ExprParserOperator; static lPar: ExprParserOperator; static rPar: ExprParserOperator; static eof: ExprParserOperator; tok: Token; tokValue: string; tokValuePos: number; tokValueLen: number; constructor(tok: Token, value?: string, valuePos?: number, valueLen?: number); } /** * A parser for Sinequa fielded search expressions. Such expressions allow filters to be specified in fulltext and * can be combined with boolean operators to build complex queries. * * A single fielded search clause has this form: * ``[`display value`]:[:][]`` * * A field name is either a column name or alias or a partname. In the case of a partname and column name clashing then * the field is treated as a column. Two colons can be specified as the separator to denote that the field is a partname. * An optional display value can follow the fieldname enclosed in backquote characters * * Operators are: `=` (default), `>=`, `>`, `<=`, `<`, `~` (regexp) * In addition, a regular expression can be specified by enclosing the value in `/` characters * * An inclusive range of values can be specified using a square bracket syntax: `[value1..value2]` * An exclusive range of values can be specified using a curly bracket syntax: `{value1..value2}` * The brackets can be mixed. For example: `age:{5..13]` expresses `13 >= age > 5`. * * For multi-value csv fields an `IN` condition can be expressed using a comma-separated list of values enclosed in square brackets. * For example: `authors:[Proust, Orwell, Dickens]` * * If a value contains reserved characters then it can be enclosed in backquote characters to prevent the parser interpreting them * incorrectly. For example: ``code: `a:b:c` `` * * The parser also supports a NEAR operator to allow searching for terms close to each other. There are two forms suppported: * * infix - `term1 NEAR[/n] term2` where `n` is the maximum number of words between the two terms for them to match * * function - `NEAR[/n](term1, term2, term3, ...)` where `n` is "window" size within which all the terms must be present for them * to match. The minimum useful value for n is thus equal to the number of terms passed to the operator. * * Fielded search expresions can be combined with the boolean operators `AND`, `OR` and `NOT` and brackets used for grouping. * For example: `football (age:>=7 AND (name:smith OR name:jones))` */ declare class ExprParser { static fieldPartnamePrefix: string; private static parsetbl; private exprContext; private options; private expressions; private operators; private fields; private displays; private op; private prevOp; private saveOp; private field; private display; private text; private current; private length; private constructor(); /** * Escape a string so that the characters in it are not processed by the fielded search expression parser. * Single occurrences of the backslash character are replaced by two backslashes and backquote characters * are prefixed by a backslash. Finally, the string is enclosed in backquotes. * * For example: `` a\`\b `` => `` a\\\`\\b `` */ static escape(value: string | undefined): string; private static isEscaped; /** * Perform the reverse operation to [ExprParser.escpae]{@link ExprParser#escape} */ static unescape(value: string): string; /** * @ignore */ static unescapeList(values: string[]): string[]; /** * @ignore */ static valuesAndLocationsFromText(text: string, separator: string): ExprValueLocation[]; private matchKeyword; private matchUntil; private static matchUntil; private matchSimpleValue; private getTerminators; private canBeTokValue; private _getTokValue; private getTokValue; private ensureNearValue; private findDisplay; private isValidFieldName; private isAllowedField; private readToken; private clear; /** * Parse some text using the Sinequa fielded search syntax * * @return The parsed `Expr` or an error string */ static parse(text: string, context: ExprContext, options?: ExprParserOptions): Expr | string; private parseResult; private get contextField(); private get contextDisplay(); private parse; private shift; private peekField; private peekDisplay; private canBeMergeTarget; private mergeExpr; private reduce; } /** * @deprecated 11.9.0 - Kept only for backward compatibility */ declare class ExprPipe extends AbstractIntlPipe<(Expr | string), ExprMessageOptions> { updateValue(key: Expr | string, params: ExprMessageOptions): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Add a select filter to the query * * @param expr The fielded search expression to filter the results * @param facet The name of the associated facet * * @deprecated */ declare const addSelect: (query: IQuery, expr: string, facet?: string) => void; /** * Adds a new `Select` object to the end of the query's `selects` * * @deprecated */ declare const pushSelect: (query: IQuery, select: Select) => void; /** * Remove the last `Select` object from the `selects` and return it * * @deprecated */ declare const popSelect: (query: IQuery) => Select | undefined; /** * Remove the `Select` object identified by `indexOrFacet` * * @param indexOrFacet either an index in the `selects` array or a facet name * @param all If `true` and `indexOrFacet` is a facet name then all `Select` objects with a matching facet name will be removed * * @deprecated */ declare const removeSelect: (query: IQuery, indexOrFacet: number | string, all?: boolean) => void; /** * Replace a `Select` with another * * @param index The index in the `selects` array of the `Select to replace * @param select The `Select` to use as a replacement * * @deprecated */ declare const replaceSelect: (query: IQuery, index: number, select: Select) => void; /** * Find the index of the nth `Select` object matching the passed facet name * * @param facet A facet name * @param ordinal Specifies which `Select` object to retrieve among selects with the same facet name * * @deprecated */ declare const findSelectIndex: (query: IQuery, facet: string, ordinal?: number) => number; /** * Find the first `Select` matching the passed facet name * * @param facet A facet name * @param fromEnd If `true` start searching backwards from the last `Select` * * @deprecated */ declare const findSelect: (query: IQuery, facet: string, fromEnd?: boolean) => Select | undefined; export { AppServiceHelpers, Autofocus, BsVirtualScroller, ClickOutside, DateFnsPipe, DatePipe, Expr, ExprBuilder, ExprOperator, ExprParser, ExprParserOperator, ExprPipe, ExprRange, FocusKeyListDirective, FocusKeyListItemDirective, MemorySizePipe, MomentPipe, NumberPipe, RelativeTimePipe, ResizeEventDirective, SCREEN_SIZE_RULES, ScrollIntoView, StickyComponent, TimePipe, Token, TooltipComponent, TooltipDirective, UIService, UtilsModule, ValuePipe, VoiceRecognitionService, addSelect, deUtils, defaultScreenSizeRules, enUtils, findSelect, findSelectIndex, frUtils, popSelect, pushSelect, removeSelect, replaceSelect }; export type { CaretPosition, ClickOutsideOptions, DateParams, ExprContext, ExprEvaluationContext, ExprLocation, ExprMessage, ExprMessageOptions, ExprOperandsInitializer, ExprParserOptions, ExprValueInfo, ExprValueInitializer, ExprValueLocation, Placement, ScrollIntoViewOptions };