import { MetricAttributes } from '@opentelemetry/api'; import { InstrumentationScope } from '@opentelemetry/core'; export declare type Maybe = T | undefined; export declare function isNotNullish(item: Maybe): item is T; /** * Converting the unordered attributes into unique identifier string. * @param attributes user provided unordered MetricAttributes. */ export declare function hashAttributes(attributes: MetricAttributes): string; /** * Converting the instrumentation scope object to a unique identifier string. * @param instrumentationScope */ export declare function instrumentationScopeId(instrumentationScope: InstrumentationScope): string; /** * Error that is thrown on timeouts. */ export declare class TimeoutError extends Error { constructor(message?: string); } /** * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise * rejects, and resolves if the specified promise resolves. * *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. * * @param promise promise to use with timeout. * @param timeout the timeout in milliseconds until the returned promise is rejected. */ export declare function callWithTimeout(promise: Promise, timeout: number): Promise; export interface PromiseAllSettledFulfillResult { status: 'fulfilled'; value: T; } export interface PromiseAllSettledRejectionResult { status: 'rejected'; reason: unknown; } export declare type PromiseAllSettledResult = PromiseAllSettledFulfillResult | PromiseAllSettledRejectionResult; /** * Node.js v12.9 lower and browser compatible `Promise.allSettled`. */ export declare function PromiseAllSettled(promises: Promise[]): Promise[]>; export declare function isPromiseAllSettledRejectionResult(it: PromiseAllSettledResult): it is PromiseAllSettledRejectionResult; /** * Node.js v11.0 lower and browser compatible `Array.prototype.flatMap`. */ export declare function FlatMap(arr: T[], fn: (it: T) => R[]): R[]; export declare function setEquals(lhs: Set, rhs: Set): boolean; /** * Binary search the sorted array to the find lower bound for the value. * @param arr * @param value * @returns */ export declare function binarySearchLB(arr: number[], value: number): number; export declare function equalsCaseInsensitive(lhs: string, rhs: string): boolean; //# sourceMappingURL=utils.d.ts.map