UNPKG

2.14 kBTypeScriptView Raw
1import type { Client, Integration, IntegrationClass, IntegrationFn, IntegrationFnResult, Options } from '@sentry/types';
2declare module '@sentry/types' {
3 interface Integration {
4 isDefaultInstance?: boolean;
5 }
6}
7export declare const installedIntegrations: string[];
8/** Map of integrations assigned to a client */
9export type IntegrationIndex = {
10 [key: string]: Integration;
11};
12/** Gets integrations to install */
13export declare function getIntegrationsToSetup(options: Pick<Options, 'defaultIntegrations' | 'integrations'>): Integration[];
14/**
15 * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default
16 * integrations are added unless they were already provided before.
17 * @param integrations array of integration instances
18 * @param withDefault should enable default integrations
19 */
20export declare function setupIntegrations(client: Client, integrations: Integration[]): IntegrationIndex;
21/**
22 * Execute the `afterAllSetup` hooks of the given integrations.
23 */
24export declare function afterSetupIntegrations(client: Client, integrations: Integration[]): void;
25/** Setup a single integration. */
26export declare function setupIntegration(client: Client, integration: Integration, integrationIndex: IntegrationIndex): void;
27/** Add an integration to the current hub's client. */
28export declare function addIntegration(integration: Integration): void;
29/**
30 * Convert a new integration function to the legacy class syntax.
31 * In v8, we can remove this and instead export the integration functions directly.
32 *
33 * @deprecated This will be removed in v8!
34 */
35export declare function convertIntegrationFnToClass<Fn extends IntegrationFn>(name: string, fn: Fn): IntegrationClass<Integration>;
36/**
37 * Define an integration function that can be used to create an integration instance.
38 * Note that this by design hides the implementation details of the integration, as they are considered internal.
39 */
40export declare function defineIntegration<Fn extends IntegrationFn>(fn: Fn): (...args: Parameters<Fn>) => IntegrationFnResult;
41//# sourceMappingURL=integration.d.ts.map
\No newline at end of file