import moment from 'moment'; import { IValue, RegClass, _ISchema, _ISelection, _IType, _Transaction } from './interfaces-private'; import { DataTypeDef, Expr, ExprRef, Interval, nil, QName } from 'pgsql-ast-parser'; import { ISubscription, IType } from './interfaces'; export interface Ctor extends Function { new (...params: any[]): T; prototype: T; } export declare type Optional = { [key in keyof T]?: T[key]; }; export declare type SRecord = Record; export declare function trimNullish(value: T, depth?: number): T; export declare function watchUse(rootValue: T): { checked: T; check?: () => string | null; }; export declare function deepEqual(a: T, b: T, strict?: boolean, depth?: number, numberDelta?: number): boolean; export declare function deepCompare(a: T, b: T, strict?: boolean, depth?: number, numberDelta?: number): number; declare type Json = { [key: string]: Json; } | Json[] | string | number | null; export declare function queryJson(a: Json, b: Json): boolean; export declare function buildLikeMatcher(likeCondition: string, caseSensitive?: boolean): (stringToMatch: string | number) => boolean | null; export declare function nullIsh(v: any): v is nil; export declare function hasNullish(...vals: any[]): boolean; export declare function sum(v: number[]): number; export declare function deepCloneSimple(v: T): T; export declare function isSelectAllArgList(select: Expr[]): boolean; export declare function ignore(...val: any[]): void; export declare function combineSubs(...vals: ISubscription[]): ISubscription; export interface ExecCtx { readonly schema: _ISchema; readonly transaction: _Transaction; readonly parametersValues?: any[]; } export declare function executionCtx(): ExecCtx; export declare function hasExecutionCtx(): boolean; export declare function pushExecutionCtx(ctx: ExecCtx, act: () => T): T; export declare function indexHash(this: void, vals: (IValue | string)[]): string; export declare function randomString(length?: number, chars?: string): string; export declare function schemaOf(t: DataTypeDef): string | nil; export declare function isType(t: any): t is (_IType | IType); export declare namespace isType { var TAG: symbol; } export declare function suggestColumnName(expr: Expr | nil): string | null; export declare function findTemplate(this: void, selection: _ISelection, t: _Transaction, template?: T, columns?: (keyof T)[]): Iterable; export declare function compareVersions(_a: string, _b: string): number; export declare function intervalToSec(v: Interval): number; export declare function parseRegClass(_reg: RegClass): QName | number; export declare function parseTime(str: string): moment.Moment; export declare function colByName(refs: Map, ref: string | ExprRef, nullIfNotFound: boolean | nil): T | nil; export declare function colToStr(col: string | ExprRef): string; export declare function qnameToStr(col: string | QName): string; export declare function asSingleName(col: string | ExprRef): string | nil; export declare function asSingleQName(col: string | QName, allowedSchema?: string): string | nil; export declare function errorMessage(error: unknown): string; export declare function it(iterable: Iterable): IteratorHelper; export declare class IteratorHelper implements Iterable { private underlying; constructor(underlying: () => Iterable); [Symbol.iterator](): Iterator; flatten(): T extends Iterable ? IteratorHelper : never; reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U; } export declare function fromEntries(iterable: readonly (readonly [K, V])[]): Map; export declare function notNil(value: (T | nil)[] | nil): Exclude[]; /** Modify an array if necessary */ export declare function modifyIfNecessary(values: T[], mapper: (input: T) => T | nil): T[]; export {}; //# sourceMappingURL=utils.d.ts.map