import { IconSet } from '../icon-set/index.js'; import { CleanupSVGOptions } from '../svg/cleanup.js'; import '@iconizza/types'; import '@iconizza/utils/lib/customisations/defaults'; import '@iconizza/utils/lib/icon-set/tree'; import '../svg/index.js'; import '../icon-set/types.js'; import '../svg/cleanup/bad-tags.js'; /** * Entry for file */ interface ImportDirectoryFileEntry { path: string; subdir: string; file: string; ext: string; } /** * Callback to get keyword for icon based on file name * * Returns: * - string for new keyword * - undefined to skip icon * * Callback can be asynchronous */ type ImportDirectoryKeywordCallbackResult = string | undefined; type Callback = (file: ImportDirectoryFileEntry, defaultKeyword: string, iconSet: IconSet) => T; type AsyncCallback = Callback>; type ImportDirectoryKeywordCallback = AsyncCallback; type ImportDirectoryKeywordSyncCallback = Callback; /** * Options */ interface ImportDirectoryOptions extends CleanupSVGOptions { prefix?: string; includeSubDirs?: boolean; keyword?: K; ignoreImportErrors?: boolean | 'warn'; } /** * Import all icons from directory */ declare function importDirectory(path: string, options?: ImportDirectoryOptions): Promise; /** * Import all icons from directory synchronously */ declare function importDirectorySync(path: string, options?: ImportDirectoryOptions): IconSet; export { ImportDirectoryFileEntry, ImportDirectoryKeywordCallback, ImportDirectoryKeywordSyncCallback, importDirectory, importDirectorySync };