import { IconizzaIcon, IconizzaJSON } from '@iconizza/types'; import { IconizzaIconName } from '@iconizza/utils/lib/icon/name'; /** * Interface for exported storage functions */ interface IconizzaStorageFunctions { /** * Check if icon data is available */ iconLoaded: (name: string) => boolean; /** * Older, badly named, version of iconLoaded() * * @deprecated */ iconExists: (name: string) => boolean; /** * Get icon data with all properties */ getIcon: (name: string) => Required | null; /** * List all available icons */ listIcons: (provider?: string, prefix?: string) => string[]; /** * Add icon to storage */ addIcon: (name: string, data: IconizzaIcon) => boolean; /** * Add icon set to storage */ addCollection: (data: IconizzaJSON, provider?: string) => boolean; } declare function allowSimpleNames(allow?: boolean): boolean; /** * Get icon data * * Returns: * - IconizzaIcon on success, object directly from storage so don't modify it * - null if icon is marked as missing (returned in `not_found` property from API, so don't bother sending API requests) * - undefined if icon is missing */ declare function getIconData(name: string | IconizzaIconName): IconizzaIcon | null | undefined; /** * Add one icon */ declare function addIcon(name: string, data: IconizzaIcon): boolean; /** * Add icon set */ declare function addCollection(data: IconizzaJSON, provider?: string): boolean; /** * Check if icon data is available */ declare function iconLoaded(name: string): boolean; /** * Get full icon */ declare function getIcon(name: string): Required | null; export { IconizzaStorageFunctions, addCollection, addIcon, allowSimpleNames, getIcon, getIconData, iconLoaded };