wizard-ql
Version:
WizardQL is a natural-language-like query language for constructing data queries for resources that meet conditions.
43 lines (42 loc) • 1.34 kB
TypeScript
import type { Expression } from './spec';
export interface StringifyOptions {
/**
* The notation to use for junction operations
* @example Programmatic: foo & bar
* @example Linguistic: foo AND bar
* @example Formal: foo ^ bar
* @default 'programmatic'
*/
junctionNotation?: 'programmatic' | 'linguistic' | 'formal';
/**
* The notation to use for comparison expressions
* @example Programmatic: foo = bar
* @example Linguistic: foo EQUALS bar
* @default 'programmatic'
*/
comparisonNotation?: 'programmatic' | 'linguistic';
/**
* Always surround a group with parentheses, even if unnecessary
* @default false
*/
alwaysParenthesize?: boolean;
/**
* Don't include spaces (Spaces will be included around operators that are "linguistic")
* @default false
*/
compact?: boolean;
/**
* Condense boolean values to their implicit denotations
* @example 'field'
* @example '!field'
* @default false
*/
condenseBooleans?: boolean;
}
/**
* Convert a parsed WizardQL expression to a string
* @param expression The expression
* @param opts Formatting options
* @returns The formatted string
*/
export declare function stringify(expression: Expression, opts?: StringifyOptions): string;