import { AttributeValue, Context, Span } from '@opentelemetry/api';
import { SpanOf, type Spans as DefinedSpans } from './spans/index';
export type Attributes = {
    [key: string]: AttributeValue;
};
export declare const HandledErrorProp = "$$HANDLED";
export declare function truncateAttributes(attributes: Attributes): Attributes;
export declare function addRemainingTimeAttribute(attributes: Attributes): void;
export declare function createTypedSpanWrapper<T extends DefinedSpans['name']>(s: any): any;
export interface DisposableSpan extends AsyncDisposable, Disposable, SpanWithContext {
}
export interface SpanWithContext extends Span {
    ctx: Context;
}
export interface TypedSpan<T extends DefinedSpans['name']> extends Omit<SpanWithContext, 'setAttributes' | 'setAttribute'> {
    setAttributes(attributes: Partial<SpanOf<T>['attributes']>): this;
    setAttribute<K extends keyof SpanOf<T>['attributes']>(key: K, value: SpanOf<T>['attributes'][K]): this;
    setAttribute(key: string, value: AttributeValue): this;
}
export declare function span<T extends DefinedSpans['name'], Output>(name: T, attributes: SpanOf<T>['attributes'], f: (span: TypedSpan<T>) => Promise<Output>): Promise<Output>;
export declare function span<T extends DefinedSpans['name'], Output>(name: T, attributes: SpanOf<T>['attributes'], options: {
    parentContext?: Context;
}, f: (span: TypedSpan<T>) => Promise<Output>): Promise<Output>;
/**
 * Create a typed span that can be manually controlled (not auto-ended)
 */
export declare const createSpan: <T extends DefinedSpans["name"]>(name: T, attributes: SpanOf<T>["attributes"], { parentContext }?: {
    parentContext?: Context;
}) => TypedSpan<T> & DisposableSpan;
//# sourceMappingURL=span-helpers.d.ts.map