import Context from '../context/context'; import Segment from '../context/segment'; import SegmentRef from '../context/segmentRef'; import ContextCarrier from '../context/contextCarrier'; import { Tag } from '../tag'; import { SpanLayer, SpanType, Component } from '../constants'; export declare type SpanCtorOptions = { context: Context; operation: string; id?: string; parentId?: string; peer?: string; layer?: SpanLayer; component?: Component; }; export declare type Log = { Timestamp: number; Data: { event: string; message: string | undefined; error_kind: string; stack: string; }; }; export default abstract class Span { readonly context: Context; readonly type: SpanType; readonly tags: Tag[]; readonly logs: Log[]; readonly refs: SegmentRef[]; id: string; parentId: string; peer: string; operation: string; layer: SpanLayer; component: Component; inherit?: Component; startTime: number; endTime: number; errored: boolean; lastError: Error | null; _tenantCode: string; _userCode: string; _serviceVersion: string; constructor(options: SpanCtorOptions & { type: SpanType; }); start(): void; stop(): void; async(): void; resync(): void; finish(segment: Segment): boolean; inject(): ContextCarrier; extract(carrier: ContextCarrier): this; hasTag(key: string): boolean; tag(tag: Tag): this; log(event: string, stack?: any, error_kind?: string, message?: string): this; error(error: any): this; refer(ref: SegmentRef): this; }