{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { AttributeValue } from '@opentelemetry/api';\nimport type { ResourceDetectionConfig } from './config';\n\n/**\n * Interface for a Resource Detector.\n * A resource detector returns a set of detected resource attributes.\n * A detected resource attribute may be an {@link AttributeValue} or a Promise of an AttributeValue.\n */\nexport interface ResourceDetector {\n  /**\n   * Detect resource attributes.\n   *\n   * @returns a {@link DetectedResource} object containing detected resource attributes\n   */\n  detect(config?: ResourceDetectionConfig): DetectedResource;\n}\n\nexport type DetectedResource = {\n  /**\n   * Detected resource attributes.\n   */\n  attributes?: DetectedResourceAttributes;\n};\n\n/**\n * An object representing detected resource attributes.\n * Value may be {@link AttributeValue}s, a promise to an {@link AttributeValue}, or undefined.\n */\ntype DetectedResourceAttributeValue = MaybePromise<AttributeValue | undefined>;\n\n/**\n * An object representing detected resource attributes.\n * Values may be {@link AttributeValue}s or a promise to an {@link AttributeValue}.\n */\nexport type DetectedResourceAttributes = Record<\n  string,\n  DetectedResourceAttributeValue\n>;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type RawResourceAttribute = [\n  string,\n  MaybePromise<AttributeValue | undefined>,\n];\n\n/**\n * Options for creating a {@link Resource}.\n */\nexport type ResourceOptions = {\n  schemaUrl?: string;\n};\n"]}