import type { Domains } from "./codes"; import * as errors from "./errors"; import { KuzzleError } from "./errors"; /** * Construct and return the corresponding error * * @param domains - Domains object with subDomains and error names * @param domain - Domain (eg: 'external') * @param subdomain - Subdomain (eg: 'elasticsearch') * @param error - Error name: (eg: 'index_not_found') * @param placeholders - Placeholders value to inject in error message * @param options - Last param can be additional options { message } */ export declare function rawGet(domains: Domains, domain: string, subdomain: string, error: string, ...placeholders: any[]): KuzzleError; /** * Returns a promise rejected with the corresponding error * * @param domains - Domains object with subDomains and error names * @param domain - Domain (eg: 'external') * @param subdomain - Subdomain (eg: 'elasticsearch') * @param error - Error name: (eg: 'index_not_found') * @param placeholders - Placeholders value to inject in error message */ export declare function rawReject(domains: Domains, domain: string, subdomain: string, error: string, ...placeholders: any[]): Promise; /** * Construct and return the corresponding error, with its stack * trace derivated from a provided source error * * @param domains - Domains object with subDomains and error names * @param source - Original error * @param domain - Domain (eg: 'external') * @param subdomain - Subdomain (eg: 'elasticsearch') * @param error - Error name: (eg: 'index_not_found') * @param placeholders - Placeholders value to inject in error message */ export declare function rawGetFrom(domains: Domains, source: Error, domain: string, subdomain: string, error: string, ...placeholders: any[]): KuzzleError; /** * Wrap error functions with the provided domain and subdomain. */ export declare function rawWrap(domains: Domains, domain: string, subdomain: string): { get: (error: any, ...placeholders: any[]) => errors.KuzzleError; getFrom: (source: any, error: any, ...placeholders: any[]) => errors.KuzzleError; reject: (error: any, ...placeholders: any[]) => Promise; }; /** * Construct and return the corresponding error * * @param domain - Domain (eg: 'external') * @param subdomain - Subdomain (eg: 'elasticsearch') * @param error - Error name: (eg: 'index_not_found') * @param placeholders - Placeholders value to inject in error message * @param options - Last param can be additional options { message } */ export declare function get(domain: string, subdomain: string, error: string, ...placeholders: any[]): KuzzleError; /** * Returns a promise rejected with the corresponding error * * @param domain - Domain (eg: 'external') * @param subdomain - Subdomain (eg: 'elasticsearch') * @param error - Error name: (eg: 'index_not_found') * @param placeholders - Placeholders value to inject in error message */ export declare function reject(domain: string, subdomain: string, error: string, ...placeholders: any[]): Promise; /** * Construct and return the corresponding error, with its stack * trace derivated from a provided source error * * @param source - Original error * @param domain - Domain (eg: 'external') * @param subdomain - Subdomain (eg: 'elasticsearch') * @param error - Error name: (eg: 'index_not_found') * @param placeholders - Placeholders value to inject in error message */ export declare function getFrom(source: Error, domain: string, subdomain: string, error: string, ...placeholders: any[]): KuzzleError; /** * Wrap error functions with the provided domain and subdomain. */ export declare function wrap(domain: string, subdomain: string): { get: (error: any, ...placeholders: any[]) => errors.KuzzleError; getFrom: (source: any, error: any, ...placeholders: any[]) => errors.KuzzleError; reject: (error: any, ...placeholders: any[]) => Promise; };