UNPKG

1.26 kBTypeScriptView Raw
1import Span from './span';
2import SpanContext from './span_context';
3/**
4 * Reference pairs a reference type constant (e.g., REFERENCE_CHILD_OF or
5 * REFERENCE_FOLLOWS_FROM) with the SpanContext it points to.
6 *
7 * See the exported childOf() and followsFrom() functions at the package level.
8 */
9export default class Reference {
10 protected _type: string;
11 protected _referencedContext: SpanContext;
12 /**
13 * @return {string} The Reference type (e.g., REFERENCE_CHILD_OF or
14 * REFERENCE_FOLLOWS_FROM).
15 */
16 type(): string;
17 /**
18 * @return {SpanContext} The SpanContext being referred to (e.g., the
19 * parent in a REFERENCE_CHILD_OF Reference).
20 */
21 referencedContext(): SpanContext;
22 /**
23 * Initialize a new Reference instance.
24 *
25 * @param {string} type - the Reference type constant (e.g.,
26 * REFERENCE_CHILD_OF or REFERENCE_FOLLOWS_FROM).
27 * @param {SpanContext} referencedContext - the SpanContext being referred
28 * to. As a convenience, a Span instance may be passed in instead
29 * (in which case its .context() is used here).
30 */
31 constructor(type: string, referencedContext: SpanContext | Span);
32}
33//# sourceMappingURL=reference.d.ts.map
\No newline at end of file