utility-css-library
Version:
Modern utility CSS library with intelligent theming, automatic contrast calculation, and seamless dark/light mode support
98 lines • 2.67 kB
TypeScript
/**
* Icon Utilities
* Helper functions and utilities for working with Material Design Icons
*/
import { Icon } from './Icon';
import { IconConfig, IconCategory } from './icon-registry';
/**
* Icon utility class with convenient methods
*/
export declare class IconUtils {
/**
* Render an icon into a DOM element
*/
static renderInto(container: HTMLElement, iconName: string, config?: IconConfig): Icon;
/**
* Replace all icon placeholders in a container
*/
static replacePlaceholders(container: HTMLElement): void;
/**
* Create an icon sprite for better performance
*/
static createSprite(iconNames: string[]): SVGElement;
/**
* Preload icons for better performance
*/
static preloadIcons(iconNames: string[]): Promise<void[]>;
/**
* Get icon suggestions based on search term
*/
static getSuggestions(searchTerm: string, limit?: number): string[];
/**
* Validate if an icon exists
*/
static iconExists(iconName: string): boolean;
/**
* Get random icons from a category
*/
static getRandomIcons(category?: IconCategory, count?: number): string[];
/**
* Create an icon picker interface
*/
static createIconPicker(container: HTMLElement, onSelect: (iconName: string) => void, options?: {
searchable?: boolean;
categories?: IconCategory[];
size?: number;
}): void;
}
/**
* Icon set manager for organizing related icons
*/
export declare class IconSet {
private icons;
private name;
constructor(name: string, iconNames?: string[]);
/**
* Add an icon to the set
*/
add(iconName: string, config?: IconConfig): void;
/**
* Get an icon from the set
*/
get(iconName: string): Icon | undefined;
/**
* Remove an icon from the set
*/
remove(iconName: string): boolean;
/**
* Get all icon names in the set
*/
getIconNames(): string[];
/**
* Get all icons in the set
*/
getIcons(): Icon[];
/**
* Create a sprite for this icon set
*/
createSprite(): SVGElement;
/**
* Export the icon set as CSS classes
*/
toCSSClasses(): string;
}
/**
* Predefined icon sets for common use cases
*/
export declare const ICON_SETS: {
NAVIGATION: IconSet;
ACTIONS: IconSet;
COMMUNICATION: IconSet;
MEDIA: IconSet;
FILES: IconSet;
STATUS: IconSet;
};
export type { IconConfig, IconCategory } from './icon-registry';
export { ICON_CATEGORIES, POPULAR_ICONS } from './icon-registry';
export { Icon, IconFactory } from './Icon';
//# sourceMappingURL=icon-utils.d.ts.map