|
| 1 | +/* eslint-disable import/export */ |
| 2 | + |
| 3 | +// We export everything from both the client part of the SDK and from the server part. Some of the exports collide, |
| 4 | +// which is not allowed, unless we redifine the colliding exports in this file - which we do below. |
| 5 | +export * from './index.client'; |
| 6 | +export * from './index.server'; |
| 7 | + |
| 8 | +import type { Integration, StackParser } from '@sentry/types'; |
| 9 | + |
| 10 | +import * as clientSdk from './index.client'; |
| 11 | +import * as serverSdk from './index.server'; |
| 12 | +import { RemixOptions } from './utils/remixOptions'; |
| 13 | + |
| 14 | +/** Initializes Sentry Remix SDK */ |
| 15 | +export declare function init(options: RemixOptions): void; |
| 16 | + |
| 17 | +// We export a merged Integrations object so that users can (at least typing-wise) use all integrations everywhere. |
| 18 | +export const Integrations = { ...clientSdk.Integrations, ...serverSdk.Integrations }; |
| 19 | + |
| 20 | +export declare const defaultIntegrations: Integration[]; |
| 21 | +export declare const defaultStackParser: StackParser; |
| 22 | + |
| 23 | +// This variable is not a runtime variable but just a type to tell typescript that the methods below can either come |
| 24 | +// from the client SDK or from the server SDK. TypeScript is smart enough to understand that these resolve to the same |
| 25 | +// methods from `@sentry/core`. |
| 26 | +declare const runtime: 'client' | 'server'; |
| 27 | + |
| 28 | +export const close = runtime === 'client' ? clientSdk.close : serverSdk.close; |
| 29 | +export const flush = runtime === 'client' ? clientSdk.flush : serverSdk.flush; |
| 30 | +export const lastEventId = runtime === 'client' ? clientSdk.lastEventId : serverSdk.lastEventId; |
0 commit comments