import { type AxiosResponseHeaders, type RawAxiosResponseHeaders } from 'axios'; /** * Check to see if the given URL is 'secure'. This assumes: * * - `https` URLs are always secure * - `http` URLS are allowed for localhost * - And also for '`svc.cluster.local` and `.internal` URLs * * Note that this does not resolve the URL, so it is possible this could * resolve to some other internal URL, and may return `false` on non-fully * qualified internal URLs. * * @param url remote service to validate * @returns the url is local or `https` */ export declare function validateSecureUrl(url: string): boolean; export declare function padSlashToUrl(u: string): string; /** * Checks that `testUrl` is prefixed with one of the given origin + path fragment URIs in urlPrefixes. * * Note this doesn't do anything special to queries or fragments and will fail to work properly if those are present on the prefixes * @param urlPrefixes a list of origin parts of urls, possibly including some path fragment as well * @param testUrl a url to see if it is prefixed by one or more of the `urlPrefixes` values * @throws Error when testUrl is not present */ export declare const safeUrlCheck: (urlPrefixes: string[], testUrl: string) => void | never; export declare function isBrowser(): boolean; export declare const isFirefox: () => boolean; export declare const rstrip: (str: string, suffix?: string) => string; /** * Rough estimate of number of seconds to add to the current system clock time * to get the clock time on the given server, or origin if not specified * @param server a server to compute skew with * @returns the number of seconds to add to the current local system clock time * to get an rough guess of the time on the given server */ export declare const estimateSkew: (serverEndpoint?: string) => Promise; export type AnyHeaders = AxiosResponseHeaders | RawAxiosResponseHeaders | Headers; /** * Rough estimate of number of seconds to add to the curren time to get * the clock time on the server that responded with the headers object. * @param headers A set of headers, which must include the `date` header * @param dateNowBefore time before initiating the request, usually by calling * `Date.now()`. Note this is in milliseconds since the epoch, while the * estimate is given in seconds. * @returns the number of seconds to add to the current local system clock time * to get an rough guess of the time on the server that was used */ export declare const estimateSkewFromHeaders: (headers: AnyHeaders, dateNowBefore?: number) => number; //# sourceMappingURL=utils.d.ts.map