dbgate-tools
Version:
Auxiliary tools for other DbGate packages.
51 lines (50 loc) • 3.49 kB
TypeScript
import { DataEditorTypesBehaviour } from 'dbgate-types';
export declare const MAX_GRID_TEXT_LENGTH = 1000;
export type EditorDataType = 'null' | 'objectid' | 'string' | 'number' | 'object' | 'date' | 'array' | 'boolean' | 'unknown';
export declare function arrayToHexString(byteArray: any): any;
export declare function hexStringToArray(inputString: any): any[];
export declare function parseCellValue(value: any, editorTypes?: DataEditorTypesBehaviour): any;
export declare function stringifyCellValue(value: any, intent: 'gridCellIntent' | 'inlineEditorIntent' | 'multilineEditorIntent' | 'stringConversionIntent' | 'exportIntent' | 'clipboardIntent', editorTypes?: DataEditorTypesBehaviour, gridFormattingOptions?: {
useThousandsSeparator?: boolean;
}, jsonParsedValue?: any): {
value: string;
gridStyle?: 'textCellStyle' | 'valueCellStyle' | 'nullCellStyle';
gridTitle?: string;
};
export declare function safeJsonParse(json: any, defaultValue?: any, logError?: boolean): any;
export declare function safeCompileRegExp(regex: string, flags: string): RegExp;
export declare function shouldOpenMultilineDialog(value: any): boolean;
export declare function isJsonLikeLongString(value: any): RegExpMatchArray;
export declare function getIconForRedisType(type: any): "img folder" | "img type-string" | "img type-hash" | "img type-set" | "img type-list" | "img type-zset" | "img type-stream" | "img type-binary" | "img type-rejson";
export declare function isWktGeometry(s: any): boolean;
export declare function arrayBufferToBase64(buffer: any): string;
export declare function getAsImageSrc(obj: any): string;
export declare function parseSqlDefaultValue(value: string): string | number;
export declare function detectCellDataType(value: any): EditorDataType;
export declare function detectTypeIcon(value: any): "icon type-null" | "icon type-objectid" | "icon type-date" | "icon type-string" | "icon type-number" | "icon type-object" | "icon type-array" | "icon type-boolean" | "icon type-unknown";
export declare function getConvertValueMenu(value: any, onSetValue: any, editorTypes?: DataEditorTypesBehaviour): {
text: string;
onClick: () => any;
}[];
export declare function extractErrorMessage(err: any, defaultMessage?: string): any;
export declare function extractErrorStackTrace(err: any): string;
export declare function extractErrorLogData(err: any, additionalFields?: {}): {
errorMessage: any;
errorObject: any;
errorStack: string;
};
export declare function safeFormatDate(date: any): any;
export declare function getLimitedQuery(sql: string): string;
export declare function pinoLogRecordToMessageRecord(logRecord: any, defaultSeverity?: string): any;
export declare function jsonLinesStringify(jsonArray: any[]): string;
export declare function jsonLinesParse(jsonLines: string): any[];
export declare function serializeJsTypesForJsonStringify(obj: any, replacer?: any): any;
export declare function deserializeJsTypesFromJsonParse(obj: any): any;
export declare function serializeJsTypesReplacer(key: any, value: any): any;
export declare function deserializeJsTypesReviver(key: any, value: any): any;
export declare function parseNumberSafe(value: any): number | bigint;
export declare function getSqlFrontMatter(text: string, yamlModule: any): any;
export declare function removeSqlFrontMatter(text: string): string;
export declare function setSqlFrontMatter(text: string, data: {
[key: string]: any;
}, yamlModule: any): string;