import { ServiceProvider } from '@rudderjs/core'; import { type TelescopeConfig, type TelescopeStorage, type TelescopeEntry, type EntryType, type Collector, type ListOptions } from './types.js'; export type { TelescopeConfig, TelescopeStorage, TelescopeEntry, EntryType, Collector, ListOptions }; export { MemoryStorage, SqliteStorage, createEntry } from './storage.js'; export { RequestCollector } from './collectors/request.js'; export { QueryCollector } from './collectors/query.js'; export { JobCollector } from './collectors/job.js'; export { ExceptionCollector } from './collectors/exception.js'; export { LogCollector } from './collectors/log.js'; export { MailCollector } from './collectors/mail.js'; export { NotificationCollector } from './collectors/notification.js'; export { EventCollector } from './collectors/event.js'; export { CacheCollector } from './collectors/cache.js'; export { ScheduleCollector } from './collectors/schedule.js'; export { ModelCollector } from './collectors/model.js'; export { CommandCollector } from './collectors/command.js'; export { BroadcastCollector } from './collectors/broadcast.js'; export { SyncCollector } from './collectors/sync.js'; export { HttpCollector } from './collectors/http.js'; export { GateCollector } from './collectors/gate.js'; export { DumpCollector } from './collectors/dump.js'; export { AiCollector } from './collectors/ai.js'; export { McpCollector } from './collectors/mcp.js'; /** * Process-wide registry holding the active `TelescopeStorage` and the * recording on/off flag. * * **Recording state lives on `globalThis`, not as a static class field.** * Telescope is loaded under Vite's SSR module runner in dev — every HMR * cycle re-evaluates the module, which would re-initialize a static field * to `true` and silently lose the dashboard's "Paused" state. The * `globalThis['__rudderjs_telescope_recording__']` slot survives module * re-eval; the recording API in `api/routes.ts` reads/writes the same * key directly (never via `require('../index.js')` — ESM-only). The SSE * stream subscriber registry follows the same pattern; see `stream.ts`. * * `storage.store()` (in `storage.ts`) checks `isRecording()` centrally * before persisting — callers don't need to gate writes themselves. */ export declare class TelescopeRegistry { private static storage; static set(storage: TelescopeStorage): void; static get(): TelescopeStorage | null; /** Whether collectors are currently recording. Defaults to `true`. */ static get recording(): boolean; static set recording(v: boolean); /** Toggle and return the new recording state. */ static toggleRecording(): boolean; } export declare class Telescope { private static store; static list(options?: ListOptions): Promise | TelescopeEntry[]; static find(id: string): Promise | TelescopeEntry | null; static count(type?: EntryType): Promise | number; static prune(type?: EntryType): Promise | void; static record(entry: TelescopeEntry): Promise | void; } /** * Returns a TelescopeServiceProvider class configured for the given config. * * Records requests, queries, jobs, exceptions, logs, mail, notifications, * events, cache operations, scheduled tasks, and model changes. * * Usage in bootstrap/providers.ts: * import { telescope } from '@rudderjs/telescope' * export default [..., telescope(configs.telescope), ...] */ export declare class TelescopeProvider extends ServiceProvider { register(): void; boot(): Promise; } export { registerTelescopeRoutes, type RegisterTelescopeRoutesOptions } from './routes.js'; //# sourceMappingURL=index.d.ts.map