import type { EmptyObj } from "./types"; export declare function sanitizeUrl(url?: string): string; export declare function pubDateToTimestamp(pubDate: number | string | Date): number; export declare function pubDateToDate(pubDate: number | string | Date): Date | null; export declare function guessEnclosureType(url?: string): string; export declare function timeToSeconds(timeString: string): number; export declare function isNotUndefined(x: T | undefined): x is T; /** Returns the first value from an array, otherwise, passes the value through */ export declare function firstIfArray(maybeArr: T | T[]): T; export declare function firstWithValue(maybeArr: T | T[]): T | null; export declare function firstWithAttributes(maybeArr: T | T[], attrs: string[]): T | null; /** Will pass through the value if its an array, otherwise, will wrap the value as an array */ export declare function ensureArray(maybeArr: T | T[]): T[]; /** Gets the value of the XML node as text */ export declare function getText(node: { "#text": string; } | string, { sanitize }?: { sanitize?: boolean; }): string; export declare function sanitizeNewLines(text: string): string; export declare function sanitizeMultipleSpaces(text: string): string; export declare function sanitizeText(text: string): string; /** Gets the value of the XML node as a number */ export declare function getNumber(node: { "#text": number; } | number): number | null; /** Gets the attribute value from a give node. Returns null if the attribute does not exist */ export declare function getAttribute(node: { attr: Record; }, name: string): string | null; /** Gets the attribute value from a give node. Returns false if the attribute does not exist */ export declare function getBooleanAttribute(node: { attr: Record; }, name: string): boolean; /** Gets the attribute value from a give node. It will throw if the attribute does not exist */ export declare function getKnownAttribute(node: { attr: Record; }, name: string): string; export declare function extractOptionalStringAttribute(node: { attr: Record; }, attrName: string, key?: string): EmptyObj | { [key: string]: string; }; export declare function extractOptionalIntegerAttribute(node: { attr: Record; }, attrName: string, key?: string): EmptyObj | { [key: string]: number; }; declare type StringEnum = { [key: string]: any; }; export declare function lookup(stringEnum: E, s: string): E[keyof E] | undefined; export declare function knownLookup(stringEnum: E, s: string): E[keyof E]; export declare function extractOptionalFloatAttribute(node: { attr: Record; }, attrName: string, key?: string): EmptyObj | { [key: string]: number; }; export {};