UNPKG

alasql-angular

Version:
103 lines (102 loc) 2.7 kB
export declare enum tiposConexion { FILE = 0, API = 1, GRAPHQL = 2 } export declare enum tiposArchivoBD { CSV = 0 } export interface OpcionesBDFile { configTablas: PropiedadesTabla[]; } export interface OpcionesBDApi { url: string; parametroSQL: string; } export interface OpcionesBDGrapthQL { url: string; } export interface OpcionesBD { nombre: string; tipoConexion: tiposConexion; opciones: OpcionesBDApi | OpcionesBDFile | OpcionesBDGrapthQL; } export interface PropiedadesTabla { nombreTabla: string; pathArchivo: string; tipoArchivo: tiposArchivoBD; separador: string; primaryKey: string[]; indices: Index[]; } export interface Index { nombre: string; campos: string[]; } export interface Campo { nombre: string; tipo: string; } import * as xlsx from 'xlsx'; export interface AlaSQLCallback { (data?: any, err?: Error): void; } export interface AlaSQLOptions { errorlog: boolean; valueof: boolean; dropifnotexists: boolean; datetimeformat: string; casesensitive: boolean; logtarget: string; logprompt: boolean; modifier: any; columnlookup: number; autovertex: boolean; usedbo: boolean; autocommit: boolean; cache: boolean; nocount: boolean; nan: boolean; angularjs: boolean; tsql: boolean; mysql: boolean; postgres: boolean; oracle: boolean; sqlite: boolean; orientdb: boolean; } export interface AlaSQLStatement { (params?: any, cb?: AlaSQLCallback, scope?: any): any; } export interface AlaSQLAST { compile(databaseid: string): AlaSQLStatement; } export interface Thenable<T> { then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>; then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>; catch<U>(onRejected?: (error: any) => U | Thenable<U>): Thenable<U>; } export interface userDefinedFunction { (x: any): any; } export interface userDefinedFunctionLookUp { [x: string]: userDefinedFunction; } export interface userAggregator { (value: any, accumulator: any, stage: number): any; } export interface userAggregatorLookUp { [x: string]: userAggregator; } export interface AlaSQL { options: AlaSQLOptions; error: Error; (sql: any, params?: any, cb?: AlaSQLCallback, scope?: any): any; parse(sql: any): AlaSQLAST; promise(sql: any, params?: any): Thenable<any>; fn: userDefinedFunctionLookUp; aggr: userAggregatorLookUp; autoval(tablename: string, colname: string, getNext?: boolean): number; yy: {}; setXLSX(xlsxlib: typeof xlsx): void; }