Skip to content

Commit d1819c7

Browse files
authored
Make all relevant types public (#4315)
Make types that users can use when configuring the SDK public. Accompaniyng docs update: getsentry/sentry-docs#13437 Fixes #4127
1 parent 11e2648 commit d1819c7

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

sentry_sdk/_types.py

+6
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ class SDKInfo(TypedDict):
220220
tuple[None, None, None],
221221
]
222222

223+
# TODO: Make a proper type definition for this (PRs welcome!)
223224
Hint = Dict[str, Any]
225+
224226
Log = TypedDict(
225227
"Log",
226228
{
@@ -233,9 +235,13 @@ class SDKInfo(TypedDict):
233235
},
234236
)
235237

238+
# TODO: Make a proper type definition for this (PRs welcome!)
236239
Breadcrumb = Dict[str, Any]
240+
241+
# TODO: Make a proper type definition for this (PRs welcome!)
237242
BreadcrumbHint = Dict[str, Any]
238243

244+
# TODO: Make a proper type definition for this (PRs welcome!)
239245
SamplingContext = Dict[str, Any]
240246

241247
EventProcessor = Callable[[Event, Hint], Optional[Event]]

sentry_sdk/types.py

+26-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,39 @@
1111
from typing import TYPE_CHECKING
1212

1313
if TYPE_CHECKING:
14-
from sentry_sdk._types import Event, EventDataCategory, Hint, Log
14+
# Re-export types to make them available in the public API
15+
from sentry_sdk._types import (
16+
Breadcrumb,
17+
BreadcrumbHint,
18+
Event,
19+
EventDataCategory,
20+
Hint,
21+
Log,
22+
MonitorConfig,
23+
SamplingContext,
24+
)
1525
else:
1626
from typing import Any
1727

1828
# The lines below allow the types to be imported from outside `if TYPE_CHECKING`
1929
# guards. The types in this module are only intended to be used for type hints.
30+
Breadcrumb = Any
31+
BreadcrumbHint = Any
2032
Event = Any
2133
EventDataCategory = Any
2234
Hint = Any
2335
Log = Any
36+
MonitorConfig = Any
37+
SamplingContext = Any
2438

25-
__all__ = ("Event", "EventDataCategory", "Hint", "Log")
39+
40+
__all__ = (
41+
"Breadcrumb",
42+
"BreadcrumbHint",
43+
"Event",
44+
"EventDataCategory",
45+
"Hint",
46+
"Log",
47+
"MonitorConfig",
48+
"SamplingContext",
49+
)

0 commit comments

Comments
 (0)