import 'reflect-metadata'; import { Blob } from 'buffer'; import { CoreModels__NS__ContentType } from './core-models'; export declare const Utils__NS__wait: (second: number) => Promise; export declare const Utils__NS__waitMilliseconds: (milliseconds: number) => Promise; export declare const Utils__NS__uniqArray: (array: any[], uniqueProperty?: keyof T) => T[]; /** * @param anyObject * @returns object with sorted keys */ export declare const Utils__NS__sortKeys: (anyObject: any) => any; /** * Example: * new RegExp(escapeStringForRegEx('a.b.c'),'g') => /a\.b\.c/g */ export declare const Utils__NS__escapeStringForRegEx: (stringForRegExp: string, options?: { skipEscapeSlashAndDash?: boolean; }) => string; export declare function Utils__NS__removeChalkSpecialChars(str: string): string; export declare const Utils__NS__fullDateTime: () => string; export declare const Utils__NS__fullDate: () => string; export declare const Utils__NS__getFreePort: (options?: { startFrom?: number; }) => Promise; export declare const Utils__NS__requireUncached: (module: string) => any; /** * similar to camelCase but remove * all non word / repeated characters */ export declare const Utils__NS__camelize: (str?: string) => string; export declare enum Utils__NS__DbBinaryFormatEnum { Blob = "Blob", File = "File", string = "string", Buffer = "Buffer" } export type Utils__NS__DbBinaryFormatForBrowser = Blob | File | string; export type Utils__NS__DbBinaryFormatForBackend = Buffer; /** * Binary format that can be stored in database * * for nodejs => Buffer * for sql.js => string (shoulb be blob - but not supported) * */ export type Utils__NS__DbBinaryFormat = Utils__NS__DbBinaryFormatForBrowser | Utils__NS__DbBinaryFormatForBackend; /** * This is for BROWSER ONLY * @param blob * @returns */ export declare function Utils__NS__binary__NS__blobToArrayBuffer(blob: Blob): Promise; /** * it is revers to base64toBlob * @param blob * @returns */ export declare function Utils__NS__binary__NS__blobToBase64(blob: Blob): Promise; /** * it is revers to blobToBase64() * @param base64Data * @returns */ export declare function Utils__NS__binary__NS__base64toBlob(base64Data: string, contentTypeOverride?: CoreModels__NS__ContentType): Promise; export declare function Utils__NS__binary__NS__base64toDbBinaryFormat(text: string): Promise; export declare function Utils__NS__binary__NS__dbBinaryFormatToBase64(binaryFormat: Utils__NS__DbBinaryFormat): Promise; export declare function Utils__NS__binary__NS__textToDbBinaryFormat(text: string): Promise; export declare function Utils__NS__binary__NS__dbBinaryFormatToText(binaryFormat: Utils__NS__DbBinaryFormat): Promise; export declare function Utils__NS__binary__NS__base64toBuffer(base64Data: string, contentTypeOverride?: CoreModels__NS__ContentType): Promise; export declare function Utils__NS__binary__NS__bufferToBase64(bufferData: Buffer): Promise; export declare function Utils__NS__binary__NS__fileToBlob(file: File): Promise; export declare function Utils__NS__binary__NS__blobToFile(blob: Blob, nameForFile?: string): Promise; export declare function Utils__NS__binary__NS__blobToBuffer(blob: Blob): Promise; export declare function Utils__NS__binary__NS__bufferToBlob(buffer: Buffer): Promise; export declare function Utils__NS__binary__NS__textToBuffer(text: string, type?: CoreModels__NS__ContentType): Promise; export declare function Utils__NS__binary__NS__bufferToText(buffer: Buffer): Promise; export declare function Utils__NS__binary__NS__textToBlob(text: string, type?: CoreModels__NS__ContentType): Promise; export declare function Utils__NS__binary__NS__blobToText(blob: Blob): Promise; export declare function Utils__NS__binary__NS__textToFile(text: string, fileRelativePathOrName: string): Promise; export declare function Utils__NS__binary__NS__fileToText(file: File): Promise; export declare function Utils__NS__binary__NS__jsonToBlob(jsonObj: object): Promise; /** * TODO NOT TESTED */ export declare function Utils__NS__binary__NS__blobToJson(blob: Blob): Promise; export declare function Utils__NS__binary__NS__getBlobFrom(url: string): Promise; /** * * @param pixelsCss pixels ex. 100px * @returns */ export declare function Utils__NS__css__NS__numValue(pixelsCss: string | number): number; export declare const UtilsStringRegex__NS__containsNonAscii: (pathStringOrPathParts: string) => boolean; /** * TODO @LAST @IN_PROGRESS * - utils for messages * - export when ready * - should be ready for everything async refactor */ export declare const UtilsMessages__NS__compilationWrapper: (fn: () => any, taskName?: string, executionType?: "Compilation of" | "Code execution of" | "Event:") => Promise; /** * All possible sudo states on Windows 11 (24H2+) */ declare enum SudoStatus { NotInstalled = "NotInstalled", Disabled = "Disabled", Enabled_ForceNewWindow = "Enabled_ForceNewWindow",// Enabled = 2 Enabled_Inline = "Enabled_Inline",// Enabled = 3 ← current default Unknown = "Unknown" } /** * @returns true if current process is elevated (admin or sudo root), false otherwise */ export declare const UtilsSudo__NS__isCurrentProcessElevated: () => Promise; /** * Main function – returns detailed sudo status */ export declare function UtilsSudo__NS__getStatus(): Promise<{ status: SudoStatus; label: string; isAvailable: boolean; isInline: boolean; }>; /** * check if sudo is available and in proper mode */ export declare const UtilsSudo__NS__isInProperModeForTaon: ({ displayErrorMessage, }: { displayErrorMessage?: boolean; }) => Promise; export declare const UtilsString__NS__kebabCaseNoSplitNumbers: (input: string) => string; /** * Taon migration utilities */ export declare const UtilsMigrations__NS__getTimestampFromClassName: (className: string) => number | undefined; export declare const UtilsMigrations__NS__getFormattedTimestampFromClassName: (className: string) => string | undefined; export declare const UtilsMigrations__NS__formatTimestamp: (timestamp: number) => string; export declare const UtilsMigrations__NS__isValidTimestamp: (value: any) => boolean; export interface UtilsJson__NS__AttrJsoncProp { name: string; value?: any; } /** * ! TODO handle packages like zone.js with dot * Get attributes from jsonc or json5 file * @param jsonDeepPath lodash path to property in json ex. deep.path.to.prop * @param fileContent jsonc or json5 - json with comments * @returns array of attributes */ export declare const UtilsJson__NS__getAtrributiesFromJsonWithComments: (jsonDeepPath: string, // lodash path to property in json ex. deep.path.to.prop fileContent: string) => UtilsJson__NS__AttrJsoncProp[]; export declare const UtilsJson__NS__getAttributiesFromComment: (comment: string, attributes?: UtilsJson__NS__AttrJsoncProp[]) => UtilsJson__NS__AttrJsoncProp[]; /** * read json from absolute path * @returns json object */ export declare const UtilsJson__NS__readJson: (absoluteFilePath: string | string[], defaultValue?: {}, useJson5?: boolean) => any; export declare const UtilsJson__NS__readJsonWithComments: (absoluteFilePath: string | string[], defaultValue?: any) => any; export declare const UtilsYaml__NS__yamlToJson: (yamlString: string) => any; export declare const UtilsYaml__NS__jsonToYaml: (json: any) => string; export declare const UtilsYaml__NS__readYamlAsJson: (absFilePathToYamlOrYmlFile: string, options?: { defaultValue?: FORMAT; }) => FORMAT; export declare const UtilsYaml__NS__writeJsonToYaml: (destinationYamlfileAbsPath: string, json: any) => void; /** * Embed metadata into filename while preserving the extension. * * Example: * embedData({ version: "1.2.3", envName: "__" }, "project.zip") * -> "version|-|1.2.3||--||envName|-|__|||project.zip" * * keysMap = { * projectName: "pn", * envName: "en", * version: "v" * } */ export declare const FilePathMetaData__NS__embedData: >(data: T, orgFilename: string, options?: { skipAddingBasenameAtEnd?: boolean; keysMap?: Record; }) => string; /** * Extract metadata from filename (reverse of embedData). * * Example: * extractData<{ version: string; env: string }>("myfile__version-1.2.3__env-prod.zip") * -> { version: "1.2.3", env: "prod" } * * keysMap = { * projectName: "pn", * envName: "en", * version: "v" * } */ export declare const FilePathMetaData__NS__extractData: >(filename: string, options?: { keysMap?: Record; }) => T; export declare const FilePathMetaData__NS__getOnlyMetadataString: (filename: string) => string; export declare const UtilsDotFile__NS__setValueToDotFile: (dotFileAbsPath: string | string[], key: string, value: string | number | boolean) => void; export declare const UtilsDotFile__NS__setCommentToKeyInDotFile: (dotFileAbsPath: string | string[], key: string, comment: string) => void; export declare const UtilsDotFile__NS__getValueFromDotFile: (dotFileAbsPath: string | string[], key: string) => string | number | boolean; export declare const UtilsDotFile__NS__addCommentAtTheBeginningOfDotFile: (dotFileAbsPath: string | string[], comment: string) => void; export declare const UtilsDotFile__NS__setValuesKeysFromObject: (dotFileAbsPath: string | string[], obj: Record, options?: { /** * if true, it will overwrite existing keys */ setAsNewFile?: boolean; }) => void; export declare const UtilsDotFile__NS__getValuesKeysAsJsonObject: >(dotFileAbsPath: string | string[]) => T; /** * @returns key|comment pairs as json object */ export declare const UtilsDotFile__NS__getCommentsKeysAsJsonObject: >(dotFileAbsPath: string | string[]) => T; export declare const UtilsCliClassMethod__NS__decoratorMethod: (methodName: string) => MethodDecorator; export declare const UtilsCliClassMethod__NS__getFrom: (ClassPrototypeMethodFnHere: Function, options?: { globalMethod?: boolean; /** * arguments to parse into CLI format * Example: { projectName: "myproj", envName: "prod" } => "--projectName=myproj --envName=prod" * TODO @LAST add support for DEEP args parsing with lodash-walk-object */ argsToParse?: ARGS_TO_PARSE; }) => string; export {};