import type { DashboardJSON } from './DashboardJSON'; export type DashboardComponentType = Exclude; export interface TokenTraceEntry { componentId: string; componentType: DashboardComponentType; itemType?: string; } export interface TokenRelationRecord { setBy: TokenTraceEntry[]; unsetBy: TokenTraceEntry[]; resetBy: TokenTraceEntry[]; usedBy: TokenTraceEntry[]; } export interface TokenTraceState { traceData: { [namespace: string]: { [tokenName: string]: TokenRelationRecord; }; }; } interface TokenKeysPathConfig { /** * Path to the token namespace property in the definition. * If undefined or the path resolves to undefined, defaults to 'default' namespace. */ namespace?: string[]; /** * Path to the token name property in the definition. * This is required to identify which token is being set. */ name: string[]; /** * Optional suffix to append to the token name. * Useful for time range tokens like '.earliest' and '.latest' */ nameSuffix?: string[]; } interface TokenNamespacePathConfig { /** * Path to the token namespace property in the definition. * If undefined or the path resolves to undefined, defaults to 'default' namespace. */ namespace: string[]; /** * When true, traces apply to every token in the resolved namespaces. */ allTokensInNamespace: true; } interface TokenObjPathConfig { /** * Path to an object defining a token * When specified, this takes precedence over namespace and name paths. * Each object at this path will be parsed as a separate token relation. */ tokenObject: string[]; /** * Optional suffix to append to the token name. * Useful for time range tokens like '.earliest' and '.latest' */ nameSuffix?: string[]; /** * Optional property containing the name of the token within the object specified by the tokenObject array. * If not provided, `tokenName` is assumed to be the property name. */ nameProperty?: string; /** * Optional property containing the namespace of the token within the object specified by the tokenObject array. * If not provided, `tokenNamespace` is assumed to be the property name. */ namespaceProperty?: string; } export type TokenTracePathConfig = TokenKeysPathConfig | TokenNamespacePathConfig | TokenObjPathConfig; /** * Token trace configuration that can be attached to event handler classes. * This is the canonical definition used by both event handlers and token tracing logic. */ export interface TokenTraceConfig { setters?: TokenTracePathConfig[]; usage?: TokenTracePathConfig[]; resetters?: TokenTracePathConfig[]; unsetters?: TokenTracePathConfig[]; options?: { unsetAllTokensIfNoMatches?: boolean; resetAllTokensIfNoMatches?: boolean; }; } export type TokenTraceConfigs = Record; export {}; //# sourceMappingURL=TokenTrace.d.ts.map