import type { ChildProcess } from 'child_process'; import { Observable } from 'rxjs'; import { LibTypeNames } from './constants'; export declare namespace CoreModels { export type Package = { name: string; version?: string; installType?: InstalationType; }; export type NpmInstallOptions = { pkg?: CoreModels.Package; /** * false by default */ silent?: boolean; /** * false by default */ useYarn?: boolean; /** * false by default */ force?: boolean; /** * Reason for installing package(s) */ reason?: string; /** * true by default */ removeYarnOrPackageJsonLock?: boolean; /** * false by default */ generateYarnOrPackageJsonLock?: boolean; /** * false by default */ skipRemovingNodeModules?: boolean; }; export type InstalationType = '-g' | '--save' | '--save-dev' | 'remove'; export const InstalationTypeArr: string[]; export interface NpmPublishOptions { registry?: string; skipQuestionsToUser?: boolean; } export type ReleaseVersionType = 'major' | 'minor' | 'patch'; export enum ReleaseVersionTypeEnum { MAJOR = "major", MINOR = "minor", PATCH = "patch" } export type PreReleaseVersionTag = 'alpha' | 'beta' | 'rc' | 'next'; export const NpmSpecialVersions: string[]; export type PROGRESS_DATA_TYPE = 'info' | 'error' | 'warning' | 'event'; export enum EnvironmentName { /** * Default environment, typically for artifact without application * or for storing common data */ __ = "__", /** * Local development environment, typically the developer's machine. */ LOCALHOST = "localhost", /** * Development environment used by engineers to deploy and test new features. */ DEV = "dev", /** * Staging environment used for final validations before production. */ STAGE = "stage", /** * Production environment serving live users. */ PROD = "prod", /** * Automated test environment for running unit, integration, or automated tests. */ TEST = "test", /** * Quality assurance environment designated for manual and exploratory testing. */ QA = "qa", /** * Sandbox environment for experimenting and integration without affecting other environments. */ SANDBOX = "sandbox", /** * User Acceptance Testing environment where clients or stakeholders validate the release candidate. */ UAT = "uat", /** * Pre-production environment, closely mirroring production for final testing and validation. */ PREPROD = "preprod", /** * Demonstration environment specifically configured for client presentations and demos. */ DEMO = "demo", /** * Documentation environment for hosting and managing project documentation. */ DOCS = "docs", /** * Demonstration environment ONLY html files, typically used for static pages or documentation. * This environment is not intended for dynamic content or server-side processing. * Perfect to github pages or similar. * It is not intended for production use and should not be used for any critical applications or services. */ STATIC_PAGES = "static-pages", /** * Continuous Integration environment used by CI/CD pipelines for automated builds and deployments. */ CI = "ci", /** * Training environment dedicated to internal team onboarding and training activities. */ TRAINING = "training", /** * Staging environment used for final validations before production. */ STAGING = "staging" } export type EnvironmentNameTaon = `${EnvironmentName}`; export type PUSHTYPE = 'feat' | 'chore' | 'feature' | 'refactor' | 'perf' | 'styles' | 'ci' | 'build' | 'fix' | 'bugfix' | 'release' | 'docs'; /** * @deprecated */ export type UIFramework = 'bootstrap' | 'material' | 'ionic'; export type GitConnection = 'https' | 'ssh'; export const GitConnectionArr: GitConnection[]; export type FrameworkVersion = 'v1' | 'v2' | 'v3' | 'v4' | 'v16' | 'v18' | 'v19' | 'v20' | 'v21' | 'v22'; export type CutableFileExt = 'scss' | 'css' | 'less' | 'sass' | 'html' | 'ts' | 'tsx' | 'js'; export type ImageFileExtension = 'jpg' | 'jpeg' | 'png' | 'svg'; export const ImageFileExtensionArr: CoreModels.ImageFileExtension[]; export type FileExtension = 'json' | 'html' | ImageFileExtension | 'txt' | 'md' | CutableFileExt; /** * known http code */ export type HttpCode = 200 | 400 | 401 | 404 | 500; export type HttpMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'jsonp'; export const HttpMethodArr: HttpMethod[]; export type ParamType = 'Path' | 'Query' | 'Cookie' | 'Header' | 'Body'; export type TsUsage = 'import' | 'export'; export type BaseProjectType = 'typescript' | 'angular' | 'angular-lib' | 'unknown' | 'unknown-npm-project'; export const BaseProjectTypeArr: string[]; export type LibType = BaseProjectType | LibTypeNames; /** * @deprecated */ export type NewFactoryType = LibType | 'model' | 'single-file-project'; /** * @deprecated */ export type CoreLibCategory = LibType | 'common'; export type FileEvent = 'created' | 'changed' | 'removed' | 'rename'; /** * @deprecated */ export type OutFolder = 'dist' | 'browser'; export type DatabaseType = ':inmemory' | 'mysql' | 'sqljs'; export interface UploadedBackendFile { data: any | Buffer; encoding: string; md5: string; tempFilePath: string; mimetype: ContentType; mv: (path: any, callback: any) => any; name: string; truncated: boolean; } /** * @deprecated */ export interface ExecuteOptions { /** Extract string from line */ extractFromLine?: (string | Function)[]; /** * Modify output line by line */ outputLineReplace?: (outputLine: string) => string; resolvePromiseMsg?: { stdout?: string | string[]; stderr?: string | string[]; }; resolvePromiseMsgCallback?: { stdout?: () => any; stderr?: () => any; exitCode?: (exitCode: number) => any; }; prefix?: string; detach?: boolean; rebuildOnChange?: Observable<{}>; /** * Try command again after fail after n miliseconds */ tryAgainWhenFailAfter?: number; /** * TODO @LAST implement this * * Output from processe with this key * will not be displayed twice when * 2 processes are running at the same time */ similarProcessKey?: string; /** * Use big buffer for big webpack logs */ biggerBuffer?: boolean; env?: any; askToTryAgainOnError?: boolean; onChildProcessChange?: (childProcess: ChildProcess) => void; exitOnErrorCallback?: (code: number) => void; /** * From displaying in console */ hideOutput?: { stdout?: boolean; stderr?: boolean; acceptAllExitCodeAsSuccess?: boolean; }; outputBuffer?: string[]; outputBufferMaxSize?: number; } /** * @deprecated */ export interface RunOptions extends ExecuteOptions { showCommand?: boolean; /** * Show process output */ output?: boolean; silence?: boolean; stdio?: any; cwd?: string; } export const mimeTypes: { readonly '.aac': "audio/aac"; readonly '.abw': "application/x-abiword"; readonly '.arc': "application/x-freearc"; readonly '.avi': "video/x-msvideo"; readonly '.azw': "application/vnd.amazon.ebook"; readonly '.bin': "application/octet-stream"; readonly '.bmp': "image/bmp"; readonly '.bz': "application/x-bzip"; readonly '.bz2': "application/x-bzip2"; readonly '.csh': "application/x-csh"; readonly '.css': "text/css"; readonly '.csv': "text/csv"; readonly '.doc': "application/msword"; readonly '.docx': "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; readonly '.eot': "application/vnd.ms-fontobject"; readonly '.epub': "application/epub+zip"; readonly '.gz': "application/gzip"; readonly '.gif': "image/gif"; readonly '.htm': "text/html"; readonly '.html': "text/html"; readonly '.ico': "image/vnd.microsoft.icon"; readonly '.ics': "text/calendar"; readonly '.jar': "application/java-archive"; readonly '.jpeg': "image/jpeg"; readonly '.jpg': "image/jpeg"; readonly '.js': "text/javascript"; readonly '.json': "application/json"; readonly '.jsonld': "application/ld+json"; readonly '.mid': "application/midi"; readonly '.midi': "application/midi"; readonly '.mjs': "text/javascript"; readonly '.mp3': "audio/mpeg"; readonly '.mp4': "video/mp4"; readonly '.mpeg': "video/mpeg"; readonly '.mpkg': "application/vnd.apple.installer+xml"; readonly '.odp': "application/vnd.oasis.opendocument.presentation"; readonly '.ods': "application/vnd.oasis.opendocument.spreadsheet"; readonly '.odt': "application/vnd.oasis.opendocument.text"; readonly '.oga': "audio/ogg"; readonly '.ogg': "audio/ogg"; readonly '.ogv': "video/ogg"; readonly '.ogx': "application/ogg"; readonly '.opus': "audio/opus"; readonly '.otf': "font/otf"; readonly '.png': "image/png"; readonly '.pdf': "application/pdf"; readonly '.php': "application/php"; readonly '.ppt': "application/vnd.ms-powerpoint"; readonly '.pptx': "application/vnd.openxmlformats-officedocument.presentationml.presentation"; readonly '.rar': "application/vnd.rar"; readonly '.rtf': "application/rtf"; readonly '.sh': "application/x-sh"; readonly '.svg': "image/svg+xml"; readonly '.swf': "application/x-shockwave-flash"; readonly '.tar': "application/x-tar"; readonly '.tif': "image/tiff"; readonly '.tiff': "image/tiff"; readonly '.ts': "video/mp2t"; readonly '.ttf': "font/ttf"; readonly '.txt': "text/plain"; readonly '.vsd': "application/vnd.visio"; readonly '.wav': "audio/wav"; readonly '.weba': "audio/webm"; readonly '.webm': "video/webm"; readonly '.webp': "image/webp"; readonly '.woff': "font/woff"; readonly '.woff2': "font/woff2"; readonly '.xhtml': "application/xhtml+xml"; readonly '.xls': "application/vnd.ms-excel"; readonly '.xlsx': "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; readonly '.xml': "application/xml"; readonly '.xul': "application/vnd.mozilla.xul+xml"; readonly '.zip': "application/zip"; readonly '.3gp': "video/3gpp"; readonly '.3g2': "video/3gpp2"; readonly '.7z': "application/x-7z-compressed"; }; export type ContentTypeKeys = keyof typeof mimeTypes; export type ContentType = (typeof mimeTypes)[ContentTypeKeys] | 'multipart/form-data'; /** * https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types */ export type MediaType = 'text' | 'image' | 'audio' | 'font' | 'video' | 'application' | 'multipart' | 'message' | 'model'; export const MediaTypeAllArr: MediaType[]; export type MimeType = keyof typeof mimeTypes; export const MimeTypesObj: { readonly '.aac': "audio/aac"; readonly '.abw': "application/x-abiword"; readonly '.arc': "application/x-freearc"; readonly '.avi': "video/x-msvideo"; readonly '.azw': "application/vnd.amazon.ebook"; readonly '.bin': "application/octet-stream"; readonly '.bmp': "image/bmp"; readonly '.bz': "application/x-bzip"; readonly '.bz2': "application/x-bzip2"; readonly '.csh': "application/x-csh"; readonly '.css': "text/css"; readonly '.csv': "text/csv"; readonly '.doc': "application/msword"; readonly '.docx': "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; readonly '.eot': "application/vnd.ms-fontobject"; readonly '.epub': "application/epub+zip"; readonly '.gz': "application/gzip"; readonly '.gif': "image/gif"; readonly '.htm': "text/html"; readonly '.html': "text/html"; readonly '.ico': "image/vnd.microsoft.icon"; readonly '.ics': "text/calendar"; readonly '.jar': "application/java-archive"; readonly '.jpeg': "image/jpeg"; readonly '.jpg': "image/jpeg"; readonly '.js': "text/javascript"; readonly '.json': "application/json"; readonly '.jsonld': "application/ld+json"; readonly '.mid': "application/midi"; readonly '.midi': "application/midi"; readonly '.mjs': "text/javascript"; readonly '.mp3': "audio/mpeg"; readonly '.mp4': "video/mp4"; readonly '.mpeg': "video/mpeg"; readonly '.mpkg': "application/vnd.apple.installer+xml"; readonly '.odp': "application/vnd.oasis.opendocument.presentation"; readonly '.ods': "application/vnd.oasis.opendocument.spreadsheet"; readonly '.odt': "application/vnd.oasis.opendocument.text"; readonly '.oga': "audio/ogg"; readonly '.ogg': "audio/ogg"; readonly '.ogv': "video/ogg"; readonly '.ogx': "application/ogg"; readonly '.opus': "audio/opus"; readonly '.otf': "font/otf"; readonly '.png': "image/png"; readonly '.pdf': "application/pdf"; readonly '.php': "application/php"; readonly '.ppt': "application/vnd.ms-powerpoint"; readonly '.pptx': "application/vnd.openxmlformats-officedocument.presentationml.presentation"; readonly '.rar': "application/vnd.rar"; readonly '.rtf': "application/rtf"; readonly '.sh': "application/x-sh"; readonly '.svg': "image/svg+xml"; readonly '.swf': "application/x-shockwave-flash"; readonly '.tar': "application/x-tar"; readonly '.tif': "image/tiff"; readonly '.tiff': "image/tiff"; readonly '.ts': "video/mp2t"; readonly '.ttf': "font/ttf"; readonly '.txt': "text/plain"; readonly '.vsd': "application/vnd.visio"; readonly '.wav': "audio/wav"; readonly '.weba': "audio/webm"; readonly '.webm': "video/webm"; readonly '.webp': "image/webp"; readonly '.woff': "font/woff"; readonly '.woff2': "font/woff2"; readonly '.xhtml': "application/xhtml+xml"; readonly '.xls': "application/vnd.ms-excel"; readonly '.xlsx': "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; readonly '.xml': "application/xml"; readonly '.xul': "application/vnd.mozilla.xul+xml"; readonly '.zip': "application/zip"; readonly '.3gp': "video/3gpp"; readonly '.3g2': "video/3gpp2"; readonly '.7z': "application/x-7z-compressed"; }; export interface ManifestIcon { src: string; sizes: string; type: string; purpose: string; } export interface PwaManifest { name: string; short_name: string; theme_color: string; background_color: string; display: 'standalone'; scope: string; start_url: string; icons: ManifestIcon[]; } export interface VSCodeSettings { 'files.exclude': { [files: string]: boolean; }; 'workbench.colorTheme': 'Default Light+' | 'Kimbie Dark'; 'workbench.colorCustomizations': { 'activityBar.background'?: string; 'activityBar.foreground'?: string; 'statusBar.background'?: string; }; } /** * @deprecated */ export interface Position { x: number; y: number; } /** * @deprecated */ export interface Size { w: number; h: number; } interface GlobalNpmDependency { name: string; installName?: string; version?: string | number; } interface GlobalCommandLineProgramDependency { name: string; website: string; version?: string; } export interface GlobalDependencies { npm?: GlobalNpmDependency[]; programs?: GlobalCommandLineProgramDependency[]; } export type CfontStyle = 'block' | 'slick' | 'tiny' | 'grid' | 'pallet' | 'shade' | 'chrome' | 'simple' | 'simpleBlock' | '3d' | 'simple3d' | 'huge'; export type CfontAlign = 'left' | 'center' | 'right' | 'block'; export const tagForTaskName = "@updateValueWithPortNumForTaskName"; /** * This is for storiginal class function (needed for typeorm/taon) */ export const OrignalClassKey = "$$originalClass$$"; /** * This is for storing class name inside special static property */ export const ClassNameStaticProperty = "$$className$$"; export const localhostIp127 = "127.0.0.1"; export const localhostDomain = "localhost"; export const SPECIAL_WORKER_READY_MESSAGE = "$$$ WORKER_READY $$$"; export const SPECIAL_APP_READY_MESSAGE = "$$$ APP_READY $$$"; export const TaonHttpErrorCustomProp = "$$taonError$$"; /** * Absolute path to project children; */ export const pathToChildren = "path-to-children"; /** * Absolute path to project parent; */ export const parentLocation = "parent-location"; export {}; }