Skip to content

Commit 0914768

Browse files
committed
change client types
1 parent dc99c51 commit 0914768

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

packages/core/src/transports/base.ts

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export const ATTACHMENT_TRANSPORT_CATEGORY = 'attachment';
2929

3030
export const SESSION_TRANSPORT_CATEGORY = 'session';
3131

32+
export const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;
33+
3234
/**
3335
* Creates a `NewTransport`
3436
*

packages/types/src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ export type { Thread } from './thread';
6565
export type {
6666
Outcome,
6767
Transport,
68-
TransportOptions,
69-
TransportClass,
7068
TransportCategory,
7169
TransportRequest,
7270
TransportMakeRequestResponse,

packages/types/src/options.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { CaptureContext } from './scope';
55
import { SdkMetadata } from './sdkmetadata';
66
import { StackLineParser, StackParser } from './stacktrace';
77
import { SamplingContext } from './transaction';
8-
import { Transport, TransportClass, TransportOptions } from './transport';
8+
import { BaseTransportOptions, NewTransport } from './transport';
99

10-
export interface ClientOptions {
10+
export interface ClientOptions<TO extends BaseTransportOptions> {
1111
/**
1212
* Enable debug functionality in the SDK itself
1313
*/
@@ -61,7 +61,7 @@ export interface ClientOptions {
6161
/**
6262
* Transport object that should be used to send events to Sentry
6363
*/
64-
transport: TransportClass<Transport>;
64+
transport: (transportOptions: TO) => NewTransport;
6565

6666
/**
6767
* A stack parser implementation
@@ -72,7 +72,7 @@ export interface ClientOptions {
7272
/**
7373
* Options for the default transport that the SDK uses.
7474
*/
75-
transportOptions?: TransportOptions;
75+
transportOptions?: TO;
7676

7777
/**
7878
* Sample rate to determine trace sampling.
@@ -202,7 +202,8 @@ export interface ClientOptions {
202202
}
203203

204204
/** Base configuration options for every SDK. */
205-
export interface Options extends Omit<Partial<ClientOptions>, 'integrations' | 'transport' | 'stackParser'> {
205+
export interface Options<TO extends BaseTransportOptions = BaseTransportOptions>
206+
extends Omit<Partial<ClientOptions<TO>>, 'integrations' | 'transport' | 'stackParser'> {
206207
/**
207208
* If this is set to false, default integrations will not be added, otherwise this will internally be set to the
208209
* recommended default integrations.
@@ -220,7 +221,7 @@ export interface Options extends Omit<Partial<ClientOptions>, 'integrations' | '
220221
/**
221222
* Transport object that should be used to send events to Sentry
222223
*/
223-
transport?: TransportClass<Transport>;
224+
transport?: (transportOptions: TO) => NewTransport;
224225

225226
/**
226227
* A stack parser implementation or an array of stack line parsers

0 commit comments

Comments
 (0)