@refraction-ui/react 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,229 @@
1
+ /** Severity levels, ordered low -> high. */
2
+ type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fatal';
3
+ /** Numeric ordering used for level threshold comparisons. */
4
+ declare const LEVEL_ORDER: Record<LogLevel, number>;
5
+ /** Bound key/value pairs attached to every record emitted by a logger. */
6
+ type LogContext = Record<string, unknown>;
7
+ /** A single structured log record handed to a sink. */
8
+ interface LogRecord {
9
+ level: LogLevel;
10
+ message: string;
11
+ timestamp: number;
12
+ app: string;
13
+ env: TelemetryEnv;
14
+ /** Merged bound context (child loggers) + per-call context, post-redaction. */
15
+ context: LogContext;
16
+ }
17
+ /** A span record handed to a sink when a span ends. */
18
+ interface SpanRecord {
19
+ name: string;
20
+ startTime: number;
21
+ endTime: number;
22
+ durationMs: number;
23
+ app: string;
24
+ env: TelemetryEnv;
25
+ /** Merged bound context + span attributes, post-redaction. */
26
+ context: LogContext;
27
+ /** 'ok' unless ended with an error. */
28
+ status: 'ok' | 'error';
29
+ error?: {
30
+ name: string;
31
+ message: string;
32
+ };
33
+ }
34
+ /**
35
+ * Vendor-neutral telemetry sink. Engines (console, Faro, custom) implement
36
+ * this — no vendor type ever leaks across this boundary.
37
+ */
38
+ interface TelemetrySink {
39
+ /** Engine name, for diagnostics. */
40
+ name: string;
41
+ /** Receive a log record. May buffer; honor flush(). */
42
+ log(record: LogRecord): void;
43
+ /** Receive a finished span. May buffer; honor flush(). */
44
+ span(record: SpanRecord): void;
45
+ /** Force-deliver any buffered records. Resolves once delivery is attempted. */
46
+ flush(): Promise<void>;
47
+ }
48
+ /** Telemetry environment — selects a behavior preset. */
49
+ type TelemetryEnv = 'development' | 'production';
50
+ /** Config for {@link createTelemetry} — mirrors `createAI`'s config shape. */
51
+ interface TelemetryConfig {
52
+ /** Logical app/service name attached to every record. */
53
+ app: string;
54
+ /** Environment preset selector. */
55
+ env: TelemetryEnv;
56
+ /**
57
+ * Remote collector endpoint. When omitted, telemetry stays console-only
58
+ * (no network engine is constructed).
59
+ */
60
+ endpoint?: string;
61
+ /**
62
+ * Master kill switch. When `false`, a tree-shakeable noop logger is
63
+ * returned and zero records are ever produced. Defaults to `true`.
64
+ */
65
+ enabled?: boolean;
66
+ /**
67
+ * Fraction of records kept, 0..1. Defaults to the preset value
68
+ * (1 in development, 0.25 in production). Records below the sample
69
+ * are dropped before reaching any sink.
70
+ */
71
+ sampleRate?: number;
72
+ /**
73
+ * Context keys to strip (deep) before a record is emitted. Use for
74
+ * PII / secrets, e.g. `['password', 'token', 'authorization']`.
75
+ */
76
+ redactKeys?: string[];
77
+ }
78
+ /** A logger bound to a context. Child loggers inherit + extend that context. */
79
+ interface Logger {
80
+ debug(message: string, context?: LogContext): void;
81
+ info(message: string, context?: LogContext): void;
82
+ warn(message: string, context?: LogContext): void;
83
+ error(message: string, context?: LogContext): void;
84
+ fatal(message: string, context?: LogContext): void;
85
+ /**
86
+ * Derive a logger with additional bound context (e.g.
87
+ * `{ sessionId, interviewId, turnId }`). Merges over the parent's context.
88
+ */
89
+ child(context: LogContext): Logger;
90
+ /** Begin a span. Call {@link Span.end} to record its duration. */
91
+ startSpan(name: string, attributes?: LogContext): Span;
92
+ /** Force-deliver buffered records on every sink. */
93
+ flush(): Promise<void>;
94
+ }
95
+ /** An in-flight span returned by {@link Logger.startSpan}. */
96
+ interface Span {
97
+ /** End the span and emit a {@link SpanRecord}. Optionally attach error/attrs. */
98
+ end(opts?: {
99
+ error?: unknown;
100
+ attributes?: LogContext;
101
+ }): void;
102
+ }
103
+ /** Return type of {@link createTelemetry}. */
104
+ interface Telemetry extends Logger {
105
+ /** Registered sink names, in insertion order. */
106
+ readonly sinks: string[];
107
+ /** Register an additional sink (e.g. a custom collector). */
108
+ addSink(sink: TelemetrySink): void;
109
+ /** Remove a sink by name. */
110
+ removeSink(name: string): void;
111
+ }
112
+
113
+ /**
114
+ * Behavior derived from {@link TelemetryConfig.env}. The manager reads these
115
+ * fields to decide level filtering, batching, sampling, and flush triggers.
116
+ */
117
+ interface TelemetryPreset {
118
+ /** Records strictly below this level are dropped. */
119
+ minLevel: LogLevel;
120
+ /** Buffer records and deliver in batches instead of synchronously. */
121
+ batch: boolean;
122
+ /** Batch size before an automatic flush (only when `batch`). */
123
+ batchSize: number;
124
+ /** Default sample rate when config omits `sampleRate`. */
125
+ sampleRate: number;
126
+ /** Pretty, single-line console output (vs. structured JSON). */
127
+ pretty: boolean;
128
+ /**
129
+ * Flush buffered records on `pagehide` + `visibilitychange` (hidden),
130
+ * using `navigator.sendBeacon` when available.
131
+ */
132
+ beaconFlush: boolean;
133
+ }
134
+ /**
135
+ * - development: sync, pretty, level=debug, no batching, sample everything.
136
+ * - production: batched + sampled, level>=warn, beacon flush on page exit.
137
+ */
138
+ declare const PRESETS: Record<TelemetryEnv, TelemetryPreset>;
139
+ /** Resolve the preset for an env (defensive copy so callers can't mutate it). */
140
+ declare function resolvePreset(env: TelemetryEnv): TelemetryPreset;
141
+
142
+ /**
143
+ * createTelemetry — creates a telemetry manager that fans records out to
144
+ * registered sinks. Manager/provider pattern, mirroring `createAI`.
145
+ *
146
+ * - `enabled: false` -> tree-shakeable noop (zero emissions, no engines).
147
+ * - no `endpoint` -> console-only transport.
148
+ * - `endpoint` set -> async Faro engine is registered when the optional
149
+ * peers exist; console stays as a safe fallback until then.
150
+ *
151
+ * The returned object IS a logger (root context = `{}`); `child()` derives
152
+ * loggers with bound context (sessionId / interviewId / turnId / ...).
153
+ */
154
+ declare function createTelemetry(config: TelemetryConfig): Telemetry;
155
+
156
+ interface ConsoleSinkOptions {
157
+ /** Single-line pretty output (vs. structured JSON). */
158
+ pretty?: boolean;
159
+ /** Console to write to (injectable for tests). Defaults to global console. */
160
+ console?: Pick<Console, 'debug' | 'info' | 'warn' | 'error'>;
161
+ }
162
+ /**
163
+ * Default zero-dependency transport. Used whenever no `endpoint` is set.
164
+ * Synchronous; `flush()` is a resolved no-op (nothing is buffered).
165
+ */
166
+ declare function createConsoleSink(opts?: ConsoleSinkOptions): TelemetrySink;
167
+
168
+ /**
169
+ * Faro-backed engine. `@grafana/faro-web-sdk` + `@grafana/faro-web-tracing`
170
+ * are **optional peerDependencies** — they are loaded dynamically and never
171
+ * referenced in this module's public types. If the peers are absent the
172
+ * factory resolves to `null` so the caller can fall back to console.
173
+ *
174
+ * For tests, a `transport` may be injected: an object with a `push(payload)`
175
+ * method. This bypasses Faro entirely (no network, no peer required).
176
+ */
177
+ /** Minimal structural shape of a Faro-ish transport. Not exported. */
178
+ interface FaroTransport {
179
+ push(payload: {
180
+ kind: 'log' | 'span';
181
+ record: LogRecord | SpanRecord;
182
+ }): void;
183
+ }
184
+ interface FaroEngineOptions {
185
+ app: string;
186
+ endpoint: string;
187
+ /**
188
+ * Test/override transport. When provided, the Faro peers are NOT loaded
189
+ * and records are forwarded straight to `transport.push`.
190
+ */
191
+ transport?: FaroTransport;
192
+ }
193
+ /**
194
+ * Construct the Faro engine. Returns `null` when the optional peers are not
195
+ * installed and no override transport was supplied — callers treat `null` as
196
+ * "fall back to console".
197
+ */
198
+ declare function createFaroSink(opts: FaroEngineOptions): Promise<TelemetrySink | null>;
199
+
200
+ /**
201
+ * Returned by {@link createTelemetry} when `enabled: false`. Every method is
202
+ * an empty stub, so a bundler can dead-code-eliminate call sites and the
203
+ * engines (console/Faro) are never imported at runtime. Zero emissions.
204
+ */
205
+ declare function createNoopTelemetry(): Telemetry;
206
+
207
+ /**
208
+ * Deep-strip any object key whose name (case-insensitive) is in `keys`.
209
+ * Arrays are walked; cycles are guarded; non-matching values pass through
210
+ * unchanged. Returns a new structure — the input is never mutated.
211
+ */
212
+ declare function redact(value: LogContext, keys: string[]): LogContext;
213
+
214
+ interface MockSinkExtended extends TelemetrySink {
215
+ /** Every log record received, in order. */
216
+ logs: LogRecord[];
217
+ /** Every span record received, in order. */
218
+ spans: SpanRecord[];
219
+ /** Number of times {@link TelemetrySink.flush} was called. */
220
+ flushCalls: number;
221
+ }
222
+ /**
223
+ * createMockSink — a {@link TelemetrySink} that records everything for
224
+ * assertions instead of doing I/O. Used to test the manager and the Faro
225
+ * engine without any network. Mirrors `createMockAIProvider` in `packages/ai`.
226
+ */
227
+ declare function createMockSink(name?: string): MockSinkExtended;
228
+
229
+ export { type ConsoleSinkOptions, type FaroEngineOptions, LEVEL_ORDER, type LogContext, type LogLevel, type LogRecord, type Logger, type MockSinkExtended, PRESETS, type Span, type SpanRecord, type Telemetry, type TelemetryConfig, type TelemetryEnv, type TelemetryPreset, type TelemetrySink, createConsoleSink, createFaroSink, createMockSink, createNoopTelemetry, createTelemetry, redact, resolvePreset };
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ import { Analytics, AnalyticsContext, AnalyticsProperties, CallOptions } from '../analytics/index.cjs';
3
+ export { Analytics, AnalyticsConfig, AnalyticsContext, AnalyticsEvent, AnalyticsEventType, AnalyticsProperties, AnalyticsSink, CallOptions, createAnalytics } from '../analytics/index.cjs';
4
+
5
+ interface AnalyticsProviderProps {
6
+ children: React.ReactNode;
7
+ /**
8
+ * The `Analytics` instance to expose. Construct it once with
9
+ * `createAnalytics(...)` from `@refraction-ui/analytics`.
10
+ */
11
+ value: Analytics;
12
+ }
13
+ /**
14
+ * AnalyticsProvider — wraps your app with analytics context.
15
+ *
16
+ * ```tsx
17
+ * <AnalyticsProvider value={createAnalytics({ app: 'my-app', env: 'production' })}>
18
+ * <App />
19
+ * </AnalyticsProvider>
20
+ * ```
21
+ */
22
+ declare function AnalyticsProvider({ children, value }: AnalyticsProviderProps): React.FunctionComponentElement<React.ProviderProps<Analytics | null>>;
23
+ interface UseAnalyticsOptions {
24
+ /** When set, returns a `with({ ...scope })` child bound to the context. */
25
+ scope?: Partial<AnalyticsContext>;
26
+ }
27
+ /**
28
+ * useAnalytics — access the `Analytics` instance from context.
29
+ *
30
+ * Pass `{ scope }` to receive a `with(...)` child whose context is merged
31
+ * into every event. Must be used within an `<AnalyticsProvider>`.
32
+ */
33
+ declare function useAnalytics(options?: UseAnalyticsOptions): Analytics;
34
+ /**
35
+ * useTrackEvent — a stable, bound `track` for the current context.
36
+ *
37
+ * ```tsx
38
+ * const track = useTrackEvent()
39
+ * track('Signup Clicked', { plan: 'pro' })
40
+ * ```
41
+ */
42
+ declare function useTrackEvent(options?: UseAnalyticsOptions): (event: string, properties?: AnalyticsProperties, opts?: CallOptions) => void;
43
+
44
+ export { AnalyticsProvider, type AnalyticsProviderProps, type UseAnalyticsOptions, useAnalytics, useTrackEvent };
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ import { Analytics, AnalyticsContext, AnalyticsProperties, CallOptions } from '../analytics/index.js';
3
+ export { Analytics, AnalyticsConfig, AnalyticsContext, AnalyticsEvent, AnalyticsEventType, AnalyticsProperties, AnalyticsSink, CallOptions, createAnalytics } from '../analytics/index.js';
4
+
5
+ interface AnalyticsProviderProps {
6
+ children: React.ReactNode;
7
+ /**
8
+ * The `Analytics` instance to expose. Construct it once with
9
+ * `createAnalytics(...)` from `@refraction-ui/analytics`.
10
+ */
11
+ value: Analytics;
12
+ }
13
+ /**
14
+ * AnalyticsProvider — wraps your app with analytics context.
15
+ *
16
+ * ```tsx
17
+ * <AnalyticsProvider value={createAnalytics({ app: 'my-app', env: 'production' })}>
18
+ * <App />
19
+ * </AnalyticsProvider>
20
+ * ```
21
+ */
22
+ declare function AnalyticsProvider({ children, value }: AnalyticsProviderProps): React.FunctionComponentElement<React.ProviderProps<Analytics | null>>;
23
+ interface UseAnalyticsOptions {
24
+ /** When set, returns a `with({ ...scope })` child bound to the context. */
25
+ scope?: Partial<AnalyticsContext>;
26
+ }
27
+ /**
28
+ * useAnalytics — access the `Analytics` instance from context.
29
+ *
30
+ * Pass `{ scope }` to receive a `with(...)` child whose context is merged
31
+ * into every event. Must be used within an `<AnalyticsProvider>`.
32
+ */
33
+ declare function useAnalytics(options?: UseAnalyticsOptions): Analytics;
34
+ /**
35
+ * useTrackEvent — a stable, bound `track` for the current context.
36
+ *
37
+ * ```tsx
38
+ * const track = useTrackEvent()
39
+ * track('Signup Clicked', { plan: 'pro' })
40
+ * ```
41
+ */
42
+ declare function useTrackEvent(options?: UseAnalyticsOptions): (event: string, properties?: AnalyticsProperties, opts?: CallOptions) => void;
43
+
44
+ export { AnalyticsProvider, type AnalyticsProviderProps, type UseAnalyticsOptions, useAnalytics, useTrackEvent };
@@ -0,0 +1,107 @@
1
+ import * as React from 'react';
2
+ import { Telemetry, TelemetryConfig, LogContext, Logger, Span } from '../logger/index.cjs';
3
+ export { LogContext, LogLevel, LogRecord, Logger, Span, SpanRecord, Telemetry, TelemetryConfig, TelemetryEnv, TelemetrySink } from '../logger/index.cjs';
4
+
5
+ interface TelemetryContextValue {
6
+ /** The root telemetry instance (a logger bound to the empty root context). */
7
+ telemetry: Telemetry;
8
+ }
9
+ interface TelemetryProviderProps extends TelemetryConfig {
10
+ children: React.ReactNode;
11
+ }
12
+ /**
13
+ * TelemetryProvider — wraps your app with telemetry context.
14
+ *
15
+ * ```tsx
16
+ * <TelemetryProvider app="interview-service" env="production">
17
+ * <App />
18
+ * </TelemetryProvider>
19
+ * ```
20
+ */
21
+ declare function TelemetryProvider({ children, ...config }: TelemetryProviderProps): React.FunctionComponentElement<React.ProviderProps<TelemetryContextValue | null>>;
22
+ /**
23
+ * useTelemetry — access the root telemetry instance.
24
+ * Must be used within <TelemetryProvider>.
25
+ */
26
+ declare function useTelemetry(): Telemetry;
27
+ /**
28
+ * useLogger — derive a scoped child logger with bound context (e.g.
29
+ * `{ sessionId, interviewId, turnId }`). The logger is memoized so it stays
30
+ * stable across renders for the same scope. With no scope, the root telemetry
31
+ * logger is returned.
32
+ *
33
+ * Must be used within <TelemetryProvider>.
34
+ */
35
+ declare function useLogger(scope?: LogContext): Logger;
36
+
37
+ interface UseSpanAPI {
38
+ /**
39
+ * Begin a span tied to the provider's telemetry instance. Returns the
40
+ * {@link Span}; call {@link Span.end} (or {@link UseSpanAPI.end}) to record
41
+ * its duration. Starting a new span while one is active ends the previous
42
+ * one first so a single hook owns at most one in-flight span.
43
+ */
44
+ start: (name: string, attributes?: LogContext) => Span;
45
+ /** End the active span (no-op if none is in flight). Idempotent per span. */
46
+ end: (opts?: {
47
+ error?: unknown;
48
+ attributes?: LogContext;
49
+ }) => void;
50
+ /** Whether a span started by this hook is currently in flight. */
51
+ isActive: boolean;
52
+ }
53
+ /**
54
+ * useSpan — start/end a telemetry span tied to the provider's telemetry
55
+ * instance. The active span is cleaned up automatically on unmount.
56
+ *
57
+ * ```tsx
58
+ * const span = useSpan()
59
+ * useEffect(() => {
60
+ * span.start('llm-call', { model: 'gpt' })
61
+ * return () => span.end()
62
+ * }, [])
63
+ * ```
64
+ *
65
+ * Must be used within <TelemetryProvider>.
66
+ */
67
+ declare function useSpan(): UseSpanAPI;
68
+
69
+ interface TelemetryErrorBoundaryProps {
70
+ children: React.ReactNode;
71
+ /**
72
+ * Fallback UI rendered after an error is caught. May be a node or a render
73
+ * function receiving the captured error and a reset callback.
74
+ */
75
+ fallback?: React.ReactNode | ((error: Error, reset: () => void) => React.ReactNode);
76
+ /** Extra bound context attached to the reported error record. */
77
+ context?: LogContext;
78
+ /** Invoked after the error has been reported to the telemetry sink. */
79
+ onError?: (error: Error, info: React.ErrorInfo) => void;
80
+ }
81
+ interface TelemetryErrorBoundaryState {
82
+ error: Error | null;
83
+ }
84
+ /**
85
+ * TelemetryErrorBoundary — a React error boundary that reports caught render
86
+ * errors to the provider's telemetry sink (at `error` level) before showing
87
+ * an optional fallback.
88
+ *
89
+ * ```tsx
90
+ * <TelemetryErrorBoundary fallback={<p>Something broke.</p>}>
91
+ * <App />
92
+ * </TelemetryErrorBoundary>
93
+ * ```
94
+ *
95
+ * Must be used within <TelemetryProvider>.
96
+ */
97
+ declare class TelemetryErrorBoundary extends React.Component<TelemetryErrorBoundaryProps, TelemetryErrorBoundaryState> {
98
+ static contextType: React.Context<TelemetryContextValue | null>;
99
+ context: TelemetryContextValue | null;
100
+ state: TelemetryErrorBoundaryState;
101
+ static getDerivedStateFromError(error: Error): TelemetryErrorBoundaryState;
102
+ componentDidCatch(error: Error, info: React.ErrorInfo): void;
103
+ reset: () => void;
104
+ render(): React.ReactNode;
105
+ }
106
+
107
+ export { type TelemetryContextValue, TelemetryErrorBoundary, type TelemetryErrorBoundaryProps, TelemetryProvider, type TelemetryProviderProps, type UseSpanAPI, useLogger, useSpan, useTelemetry };
@@ -0,0 +1,107 @@
1
+ import * as React from 'react';
2
+ import { Telemetry, TelemetryConfig, LogContext, Logger, Span } from '../logger/index.js';
3
+ export { LogContext, LogLevel, LogRecord, Logger, Span, SpanRecord, Telemetry, TelemetryConfig, TelemetryEnv, TelemetrySink } from '../logger/index.js';
4
+
5
+ interface TelemetryContextValue {
6
+ /** The root telemetry instance (a logger bound to the empty root context). */
7
+ telemetry: Telemetry;
8
+ }
9
+ interface TelemetryProviderProps extends TelemetryConfig {
10
+ children: React.ReactNode;
11
+ }
12
+ /**
13
+ * TelemetryProvider — wraps your app with telemetry context.
14
+ *
15
+ * ```tsx
16
+ * <TelemetryProvider app="interview-service" env="production">
17
+ * <App />
18
+ * </TelemetryProvider>
19
+ * ```
20
+ */
21
+ declare function TelemetryProvider({ children, ...config }: TelemetryProviderProps): React.FunctionComponentElement<React.ProviderProps<TelemetryContextValue | null>>;
22
+ /**
23
+ * useTelemetry — access the root telemetry instance.
24
+ * Must be used within <TelemetryProvider>.
25
+ */
26
+ declare function useTelemetry(): Telemetry;
27
+ /**
28
+ * useLogger — derive a scoped child logger with bound context (e.g.
29
+ * `{ sessionId, interviewId, turnId }`). The logger is memoized so it stays
30
+ * stable across renders for the same scope. With no scope, the root telemetry
31
+ * logger is returned.
32
+ *
33
+ * Must be used within <TelemetryProvider>.
34
+ */
35
+ declare function useLogger(scope?: LogContext): Logger;
36
+
37
+ interface UseSpanAPI {
38
+ /**
39
+ * Begin a span tied to the provider's telemetry instance. Returns the
40
+ * {@link Span}; call {@link Span.end} (or {@link UseSpanAPI.end}) to record
41
+ * its duration. Starting a new span while one is active ends the previous
42
+ * one first so a single hook owns at most one in-flight span.
43
+ */
44
+ start: (name: string, attributes?: LogContext) => Span;
45
+ /** End the active span (no-op if none is in flight). Idempotent per span. */
46
+ end: (opts?: {
47
+ error?: unknown;
48
+ attributes?: LogContext;
49
+ }) => void;
50
+ /** Whether a span started by this hook is currently in flight. */
51
+ isActive: boolean;
52
+ }
53
+ /**
54
+ * useSpan — start/end a telemetry span tied to the provider's telemetry
55
+ * instance. The active span is cleaned up automatically on unmount.
56
+ *
57
+ * ```tsx
58
+ * const span = useSpan()
59
+ * useEffect(() => {
60
+ * span.start('llm-call', { model: 'gpt' })
61
+ * return () => span.end()
62
+ * }, [])
63
+ * ```
64
+ *
65
+ * Must be used within <TelemetryProvider>.
66
+ */
67
+ declare function useSpan(): UseSpanAPI;
68
+
69
+ interface TelemetryErrorBoundaryProps {
70
+ children: React.ReactNode;
71
+ /**
72
+ * Fallback UI rendered after an error is caught. May be a node or a render
73
+ * function receiving the captured error and a reset callback.
74
+ */
75
+ fallback?: React.ReactNode | ((error: Error, reset: () => void) => React.ReactNode);
76
+ /** Extra bound context attached to the reported error record. */
77
+ context?: LogContext;
78
+ /** Invoked after the error has been reported to the telemetry sink. */
79
+ onError?: (error: Error, info: React.ErrorInfo) => void;
80
+ }
81
+ interface TelemetryErrorBoundaryState {
82
+ error: Error | null;
83
+ }
84
+ /**
85
+ * TelemetryErrorBoundary — a React error boundary that reports caught render
86
+ * errors to the provider's telemetry sink (at `error` level) before showing
87
+ * an optional fallback.
88
+ *
89
+ * ```tsx
90
+ * <TelemetryErrorBoundary fallback={<p>Something broke.</p>}>
91
+ * <App />
92
+ * </TelemetryErrorBoundary>
93
+ * ```
94
+ *
95
+ * Must be used within <TelemetryProvider>.
96
+ */
97
+ declare class TelemetryErrorBoundary extends React.Component<TelemetryErrorBoundaryProps, TelemetryErrorBoundaryState> {
98
+ static contextType: React.Context<TelemetryContextValue | null>;
99
+ context: TelemetryContextValue | null;
100
+ state: TelemetryErrorBoundaryState;
101
+ static getDerivedStateFromError(error: Error): TelemetryErrorBoundaryState;
102
+ componentDidCatch(error: Error, info: React.ErrorInfo): void;
103
+ reset: () => void;
104
+ render(): React.ReactNode;
105
+ }
106
+
107
+ export { type TelemetryContextValue, TelemetryErrorBoundary, type TelemetryErrorBoundaryProps, TelemetryProvider, type TelemetryProviderProps, type UseSpanAPI, useLogger, useSpan, useTelemetry };