@invisiblecities/sidequest-cqo
Version:
Configuration-agnostic TypeScript and ESLint orchestrator with real-time watch mode, SQLite persistence, and intelligent terminal detection
64 lines • 2.04 kB
TypeScript
/**
* Node.js Compatibility Utilities
* Provides fallbacks for newer Node.js features to support LTS versions 18, 20, 22
*/
/**
* Safe replaceAll implementation with fallback for older Node versions
* String.prototype.replaceAll is available in Node 15.0.0+
* Since we support Node 18+, this is mostly future-proofing
*/
export declare function replaceAll(string_: string, searchValue: string | RegExp, replaceValue: string): string;
/**
* Safe array.at() implementation with fallback for older Node versions
* Array.prototype.at is available in Node 16.6.0+
* Since we support Node 18+, this is mostly future-proofing
*/
export declare function arrayAt<T>(array: T[], index: number): T | undefined;
/**
* Node.js version detection utilities
*/
export declare const NodeVersion: {
/**
* Get the current Node.js version as a number for easy comparison
* e.g., "18.17.1" becomes 18.17
*/
getMajorMinor(): number;
/**
* Get the major version number
*/
getMajor(): number;
/**
* Check if current Node version supports a feature
*/
supports: {
replaceAll: () => boolean;
arrayAt: () => boolean;
nodePrefix: () => boolean;
abortController: () => boolean;
structuredClone: () => boolean;
};
/**
* Check if running on a supported LTS version
*/
isLTS(): boolean;
/**
* Get compatibility warnings if running on unsupported version
*/
getCompatibilityWarnings(): string[];
};
/**
* Safe dynamic import with fallback error handling
* Provides consistent behavior across Node versions
*/
export declare function safeDynamicImport<T = any>(specifier: string): Promise<T>;
/**
* Environment compatibility checker
* Reports potential issues with the current Node.js environment
*/
export declare function checkEnvironmentCompatibility(): {
compatible: boolean;
version: string;
warnings: string[];
recommendations: string[];
};
//# sourceMappingURL=node-compatibility.d.ts.map