import { RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1'; import { Label } from '../matchers/types'; import { LabelMatchDetails } from '../matchers/utils'; import { Route, RouteWithID } from './types'; export declare const INHERITABLE_KEYS: readonly ["receiver", "group_by", "group_wait", "group_interval", "repeat_interval"]; export type InheritableKeys = typeof INHERITABLE_KEYS; export type InheritableProperties = Pick; export type RouteMatchInfo = { route: T; matchDetails: LabelMatchDetails[]; matched: boolean; }; export interface RouteMatchResult { route: T; labels: Label[]; matchingJourney: Array>; } /** * This function performs a depth-first left-to-right search through the route tree and returns the matching routing nodes. * * If the current node is not a match, return nothing * Normalization should have happened earlier in the code */ export declare function findMatchingRoutes(route: T, labels: Label[], matchingJourney?: Array>): Array>; /** * This function will compute the full tree with inherited properties – this is mostly used for search and filtering */ export declare function computeInheritedTree(parent: T): T; export declare function getInheritedProperties(parentRoute: T, childRoute: T, propertiesParentInherited?: InheritableProperties): InheritableProperties; export declare function addUniqueIdentifier(route: Route): RouteWithID; export type TreeMatch = { expandedTree: RouteWithID; matchedPolicies: Map>>; }; /** * This function will return what notification policies would match a set of labels. * * ⚠️ This function is rather CPU intensive depending on both the size of the labels list and the size of the notification policy tree. * When using this function, consider wrapping it in a web-worker to offload this from the main JavaScript thread. * * @param instances - A set of labels for which you want to determine the matching policies * @param routingTree - A notification policy tree (or subtree) */ export declare function matchInstancesToRoute(rootRoute: Route, instances: Label[][]): TreeMatch; /** * Converts a RoutingTree to a Route by merging defaults with routes. * * @param routingTree - The RoutingTree from the API * @returns A Route that can be used with the matching functions */ export declare function convertRoutingTreeToRoute(routingTree: RoutingTree): Route;