@tigorhutasuhut/telemetry-js - v0.7.3
    Preparing search index...

    Type Alias Carrier<T>

    Carrier: T extends object
        ? T & { baggage?: string; traceparent?: string; tracestate?: string }
        : T

    Type helper that adds W3C trace propagation fields to an object type.

    • If T extends object, the result is T & { traceparent: string; tracestate?: string; baggage?: string }.
    • Otherwise, T is returned as-is.

    Useful for typing workflow params or message payloads that carry trace context.

    Type Parameters

    • T
    interface MyParams { userId: string }

    // { userId: string; traceparent: string; tracestate?: string; baggage?: string }
    type MyCarrier = Carrier<MyParams>;

    // Non-object types pass through unchanged
    type Str = Carrier<string>; // string