UNPKG

@arshiash80/strapi-plugin-iconhub

Version:

Icon picker plugin for Strapi with Iconify integration — search, select, and store icons with raw SVG for high-performance rendering.

48 lines (47 loc) 1.78 kB
import type { IconifyInfo } from '@iconify/types'; export type IconifyIconSetList = Record<string, IconifyInfo>; interface IconifyAPIResponse<T> { data?: T; success: boolean; error?: { message: string; }; } type CollectionResponse = IconifyAPIResponse<{ prefix: string; total: number; title?: string; info?: IconifyInfo; uncategorized?: string[]; categories?: Record<string, string[]>; aliases?: Record<string, string>; hidden?: string[]; themes?: Record<string, string>; prefixes?: Record<string, string>; suffixes?: Record<string, string>; }>; export type IconifySearchOptions = { category?: string; palette?: 'all' | 'mono' | 'multicolor'; style?: 'any' | 'fill' | 'stroke'; }; type SearchIconResponse = IconifyAPIResponse<{ /** List of icons, including prefixes */ icons: string[]; /** Number of results. If same as `limit`, more results are available */ total: number; /** Number of results shown */ limit: number; /** Index of first result */ start: number; /** Info about icon sets */ collections: Record<string, IconifyInfo>; /** Copy of request, values are string */ request: Record<keyof SearchIconResponse, string>; }>; export declare const searchIcon: (query: string, start?: number, limit?: number, prefixes?: string[], options?: IconifySearchOptions) => Promise<SearchIconResponse>; type GetIconResponse = IconifyAPIResponse<IconifyIconSetList>; export declare const getIconSetByPrefixes: (prefixes?: string) => Promise<GetIconResponse>; export declare const getIconsInCollection: (prefix: string) => Promise<CollectionResponse>; export declare const preloadCollectionIcons: (prefix: string, icons: string[]) => Promise<void>; export {};