import { Expression, Splat } from './expressions'; import { Identifier } from './identifier'; import { InvokeCallable } from './invoke'; import { BinOp, DestructuringBind, IsObject, Null, ObjectPropertyAccess, Ternary, ThisInstance, Undefined } from '../expressions/objects'; import { ThingSymbol } from '../symbol'; import { Type } from '../type'; /** * Insert direct code, bypassing all translation */ export declare function directCode(code: string): Expression; /** * An identifier: `` */ export declare function ident(identifier: string): Identifier; /** * A property access: `.` */ export declare function get(lhs: Expression, prop: string): ObjectPropertyAccess; /** * Reference a symbol and render its name: `` (will add imports if necessary) */ export declare function sym(symb: ThingSymbol): Expression; /** * A list/array literal: `[, ...]` */ export declare function list(es: Expression[]): Expression; /** * An object literal: `{ : , ... }` */ export declare function object(...parts: Array | Array | Splat>): Expression; /** * A splat expression: `...` */ export declare function splat(operand: Expression): Splat; /** * A negation expression: `!` */ export declare function not(operand: Expression): Expression; /** * Equality: ` === ` */ export declare function eq(left: Expression, right: Expression): Expression; /** * Render a JavaScript value as a literal */ export declare function lit(value: any): Expression; /** * Render a JavaScript value as a string */ export declare function str(value: any): Expression; /** * Render a JavaScript value as a number */ export declare function num(value: number): Expression; /** * An array for use in a destructuring assignment: `[, ...]` */ export declare function destructuringArray(...names: Expression[]): DestructuringBind; /** * An object for use in a destructuring assignment: `{ , ... }` */ export declare function destructuringObject(...names: Expression[]): DestructuringBind; /** * Call a function that does not need to be imported: `(, ...)` */ export declare function builtInFn(jsBuiltIn: string, ...args: Expression[]): InvokeCallable; /** * Reference to the current object: `this` */ export declare function this_(): ThisInstance; /** * A symbol that refers to a type (will add imports if necessary) */ export declare function type(x: Type): Expression; /** * A ternary expression: ` ? : ` */ export declare function cond(condition: Expression, thenExpression?: Expression, elseExpression?: Expression): Ternary; /** * `null` */ export declare const NULL: Null; /** * `undefined` */ export declare const UNDEFINED: Undefined; /** * Binary operator: ` ` */ export declare function binOp(lhs: Expression, op: string, rhs: Expression): BinOp; /** * Type test: ` && typeof === 'object' && !Array.isArray()` */ export declare function isObject(op: Expression): IsObject; /** * Concatenation: ` + + ...` */ export declare function strConcat(...ops: Expression[]): Expression;