@sconedev/ai_toolkit
Version:
Simplify AI integration in web apps with local and offline model support
22 lines (21 loc) • 696 B
TypeScript
/**
* Utility to detect browser vs Node.js environment
*/
/**
* Check if the code is running in a browser environment
*/
export declare function isBrowser(): boolean;
/**
* Check if the code is running in a Node.js environment
*/
export declare function isNode(): boolean;
/**
* Throws an error if being run in a browser environment
* @param functionName Name of the function that requires Node.js
*/
export declare function requireNodeEnvironment(functionName: string): void;
/**
* Throws an error if being run in a Node.js environment
* @param functionName Name of the function that requires browser
*/
export declare function requireBrowserEnvironment(functionName: string): void;