/**
* Types for FileIcon / FolderIcon components.
*
* @module @mks2508/mks-ui/react/ui/FileIcon
*/
import type { SlotOverrides } from '../../../core/types';
import type { FileIconSlot, FolderIconSlot } from './FileIcon.styles';
/**
* Function that resolves a filename to an icon asset identifier.
*
* Return value is the filename of the SVG (e.g. `"typescript.svg"`)
* which is appended to `basePath` to form the full URL.
*
* Defaults (when `vscode-material-icon-theme-js` is available as an
* optional peer) use the Material Icon Theme resolver. Consumers may
* pass their own to support custom icon sets.
*/
export type FileIconResolver = (filename: string) => string;
/**
* Function that resolves a folder name (and open state) to an icon asset.
*/
export type FolderIconResolver = (name: string, open: boolean) => string;
/**
* Props for FileIcon.
*
* @see {@link FileIconSlot} for available slot names
*/
export interface IFileIconProps {
/** Filename (e.g. `"App.tsx"`, `"package.json"`, `".gitignore"`). */
filename: string;
/** Icon size in pixels. Default 16. */
size?: number;
/** Optional CSS class merged onto the root. */
className?: string;
/** Whether this entry is a submodule (renders a GitFork glyph). */
isSubmodule?: boolean;
/**
* Base path prefix where icon SVGs are hosted. Default `"/file-icons/"`.
* Consumers must serve the matching SVGs (same contract as Material Icon Theme).
*/
basePath?: string;
/**
* Custom resolver to translate filename → SVG basename.
* Falls back to Material Icon Theme resolver if available at runtime.
*/
resolve?: FileIconResolver;
/**
* Override default Tailwind classes for specific visual regions.
*
* @example
* ```tsx
*
* ```
*/
slots?: SlotOverrides;
}
/**
* Props for FolderIcon.
*
* @see {@link FolderIconSlot} for available slot names
*/
export interface IFolderIconProps {
/** Folder name (e.g. `"src"`, `"components"`, `"node_modules"`). */
name: string;
/** Whether the folder is open/expanded. Default false. */
open?: boolean;
/** Icon size in pixels. Default 16. */
size?: number;
/** Optional CSS class merged onto the root. */
className?: string;
/**
* Base path prefix where icon SVGs are hosted. Default `"/file-icons/"`.
*/
basePath?: string;
/**
* Custom resolver (closed + open). Falls back to Material Icon Theme if available.
*/
resolve?: FolderIconResolver;
/**
* Override default Tailwind classes for specific visual regions.
*
* @example
* ```tsx
*
* ```
*/
slots?: SlotOverrides;
}
//# sourceMappingURL=FileIcon.types.d.ts.map