@settlemint/sdk-utils
Version:
Shared utilities and helper functions for SettleMint SDK modules
34 lines • 1.05 kB
text/typescript
//#region src/runtime/ensure-server.d.ts
/**
* Ensures that code is running on the server and not in a browser environment.
*
* @throws {Error} If called from a browser environment
* @example
* import { ensureServer } from "@settlemint/sdk-utils/runtime";
*
* // Will throw if running in browser
* ensureServer();
*/
declare function ensureServer(): void;
/**
* Ensures that code is running in a browser environment and not on the server.
*
* @throws {Error} If called from a server environment
* @example
* import { ensureBrowser } from "@settlemint/sdk-utils/runtime";
*
* // Will throw if running on server
* ensureBrowser();
*/
declare function ensureBrowser(): void;
/**
* Boolean indicating if code is currently running in a browser environment
*/
declare const runsInBrowser: boolean;
/**
* Boolean indicating if code is currently running in a server environment
*/
declare const runsOnServer: boolean;
//#endregion
export { ensureBrowser, ensureServer, runsInBrowser, runsOnServer };
//# sourceMappingURL=runtime.d.cts.map