import type { AllTagsMapType, DatasourceTagsType } from '../common-types';
type Response = {
    ok: boolean;
    status: number;
    statusText: string;
    [key: string]: any;
};
/**
 * @description - transforms tags array into tags object to be consumed as payload for create and update REST calls.
 * @param tags - array of tags to apply for selected field-name and field-value pair
 * @returns Object - key is array-entry prefixed with 'tag.', value is array-entry
 */
export declare const getTagsHash: (tags: string[]) => Record<string, string>;
/**
 * Handle response from splunkd rest API
 *
 * @param {object} response - response from splunkd endpoint
 * @param {number} expectedStatus - the expected status if the request succeeds
 *
 * @return {Promise} Promise that resolves to the responseJSON or rejects with an Error
 */
export declare const handleResponse: (response: Response, expectedStatus?: number) => Promise<any>;
/**
 * Utilize fetch API to make a request to splunkd rest API
 *
 * @param {string} url - splunkd rest the endpoint to hit
 * @param {object} namespace - object with app and owner attributes. If omitted, /services/ endpoint used
 * @param {object} queryParams - url query params
 * @param {object} fetchParams - params to the fetch API
 * @param {number} responseCode - The expected response code of a successful request
 *
 * @return {Promise} Promise that resolves to the responseJSON or rejects with an Error
 */
export declare const fetchRESTURL: (url?: string, namespace?: {}, queryParams?: {}, fetchParams?: {}, responseCode?: number) => Promise<any>;
/**
 * @description - fetches list of tags available for selected field-name and field-value combination
 * @param fname - notable event field-name
 * @param fvalue - notable event field-value
 * @returns Promise - resolves with an array of tags
 * @example
 *      GET FVTags
 *      url - /servicesNS/nobody/SplunkEnterpriseSecuritySuite/saved/fvtags/annotations%3DT1546.009?output_mode=json
 *      method - GET
 */
export declare const fetchTags: (fname?: string, fvalue?: string) => Promise<string[]>;
/**
 * @description - fetch all tags
 * @returns Promise - resolves with a map of FVTags where name is the key and value is list of tags
 * @example
 *      GET All FVTags
 *      url - /services/saved/fvtags
 *      method - GET
 *      response code - 200
 *      request payload (query-params)
 *           output_mode: json
 */
export declare const fetchAllTags: () => Promise<AllTagsMapType>;
/**
 * @description - creates tags for selected field-name and field-value combination
 * @param fname - event field-name
 * @param fvalue - event field-value
 * @returns Promise - resolves with an array of tags
 * @example
 *      CREATE FVTags
 *      url - /servicesNS/admin/dashboard-enterprise-tester/saved/fvtags
 *      method - POST
 *      response code - 201
 *      request payload (post-body)
 *           output_mode: json
 *           name: index=_internal
 *           tag.tag1: tag1
 *           tag.tag2: tag2
 */
export declare const createTags: (fname?: string, fvalue?: string, tags?: any[]) => Promise<string[]>;
/**
 * @description - updates existing tags for selected field-name and field-value combination
 * @param fname - event field-name
 * @param fvalue - event field-value
 * @returns Promise - resolves with an array of tags
 * @example
 *      UPDATE FVTags
 *      url - /servicesNS/admin/dashboard-enterprise-tester/saved/fvtags/index%3D_internal
 *      method - POST
 *      response code - 200
 *      request payload (query-params)
 *           output_mode: json
 *           tag.test1: test1
 *           tag.test2: test2
 */
export declare const updateTags: (fname?: string, fvalue?: string, tags?: any[]) => Promise<string[]>;
export declare const deleteTags: (fname?: string, fvalue?: string) => Promise<string[]>;
/**
 * @description flattens tags received from datasource metadata
 * @param tags - tags object
 * @returns object - flattened tags
 * @example
 * converts
 * { host: { host1: ['tag1', 'tag2'], host2: [] } }
 * to
 * { "host=host1": ['tag1', 'tag2'], "host=host2": [] }
 */
export declare const flattenTagObject: (tags: DatasourceTagsType) => AllTagsMapType;
export {};
