@codybrom/denim
Version:
A Deno/TypeScript library for the Threads API
14 lines (12 loc) • 373 B
text/typescript
import type { MockThreadsAPI } from "../types.ts";
type GlobalWithEnvironment = typeof globalThis & {
threadsAPI?: MockThreadsAPI;
};
/**
* Retrieves the mock API instance if available.
*
* @returns The mock API instance or null if not available
*/
export function getAPI(): MockThreadsAPI | null {
return (globalThis as GlobalWithEnvironment).threadsAPI || null;
}