@redocly/theme
Version:
Shared UI components lib
29 lines (28 loc) • 787 B
TypeScript
export type ResolvedIcon = {
type: 'link';
value: string;
} | {
type: 'font-awesome';
name: string;
style: string;
} | {
type: 'invalid';
reason: string;
};
/**
* Resolves an icon value from configuration into a structured object.
*
* Supports:
* - URLs (absolute or relative paths to image files)
* - Font Awesome icons in formats:
* - "solid camera" (style + name)
* - "camera" (name only, default style: 'regular')
*
* @param icon - The icon string from config.
* @returns A structured object describing the icon:
* - type: 'url' | 'font-awesome' | 'invalid'
* - value: for URLs
* - name and style: for Font Awesome icons
* - reason: for invalid entries
*/
export declare function resolveIcon(icon?: string): ResolvedIcon;