/// <reference types="node" />
/// <reference types="mocha" />
import * as loggerTypes from '../../common/types';
import * as configTypes from '../config/types';
import { Propagation } from '../propagation/types';
import * as samplerTypes from '../sampler/types';
import * as types from './types';
/**
 * This class represent a tracer.
 */
export declare class CoreTracer implements types.Tracer {
    /** Indicates if the tracer is active */
    private activeLocal;
    /** Manage context automatic propagation */
    private contextManager;
    /** A configuration for starting the tracer */
    private config;
    /** A list of end span event listeners */
    private eventListenersLocal;
    /** A list of ended root spans */
    private endedTraces;
    /** Bit to represent whether trace is sampled or not. */
    private readonly IS_SAMPLED;
    /** A sampler used to make sample decisions */
    sampler: samplerTypes.Sampler;
    /** A configuration for starting the tracer */
    logger: loggerTypes.Logger;
    /** Constructs a new TraceImpl instance. */
    constructor();
    /** Gets the current root span. */
    /** Sets the current root span. */
    currentRootSpan: types.RootSpan;
    /** A propagation instance */
    readonly propagation: Propagation;
    /**
     * Starts a tracer.
     * @param config A tracer configuration object to start a tracer.
     */
    start(config: configTypes.TracerConfig): types.Tracer;
    /** Stops the tracer. */
    stop(): types.Tracer;
    /** Gets the list of event listeners. */
    readonly eventListeners: types.SpanEventListener[];
    /** Indicates if the tracer is active or not. */
    readonly active: boolean;
    /**
     * Starts a root span.
     * @param options A TraceOptions object to start a root span.
     * @param fn A callback function to run after starting a root span.
     */
    startRootSpan<T>(options: types.TraceOptions, fn: (root: types.RootSpan) => T): T;
    onStartSpan(root: types.RootSpan): void;
    /**
     * Is called when a span is ended.
     * @param root The ended span.
     */
    onEndSpan(root: types.RootSpan): void;
    /**
     * Registers an end span event listener.
     * @param listener The listener to register.
     */
    registerSpanEventListener(listener: types.SpanEventListener): void;
    /**
     * Unregisters an end span event listener.
     * @param listener The listener to unregister.
     */
    unregisterSpanEventListener(listener: types.SpanEventListener): void;
    private notifyStartSpan(root);
    private notifyEndSpan(root);
    /** Clears the current root span. */
    clearCurrentTrace(): void;
    /**
     * Starts a span.
     * @param name The span name.
     * @param type The span type.
     * @param parentSpanId The parent span ID.
     */
    startChildSpan(name?: string, type?: string): types.Span;
    /**
     * Binds the trace context to the given function.
     * This is necessary in order to create child spans correctly in functions
     * that are called asynchronously (for example, in a network response
     * handler).
     * @param fn A function to which to bind the trace context.
     */
    wrap<T>(fn: types.Func<T>): types.Func<T>;
    /**
     * Binds the trace context to the given event emitter.
     * This is necessary in order to create child spans correctly in event
     * handlers.
     * @param emitter An event emitter whose handlers should have
     * the trace context binded to them.
     */
    wrapEmitter(emitter: NodeJS.EventEmitter): void;
}
