/** * [WHO]: Public exports from this file (see implementation below). * [FROM]: See the import block immediately after this header. * [TO]: sparkdesign package consumers; output of CLI `add` when applicable. * [HERE]: src/icons/context.tsx — Spark Design source; keep aligned with the main library. * * [PROTOCOL]: * 1. Keep this P3 header in sync when the public contract changes. * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change. * 3. Follow design tokens and explicit type exports. */ import { type ReactNode } from 'react'; import type { IconKey, IconComponent } from './types'; export interface IconsContextValue { /** 语义化图标映射,未提供时组件内使用占位 */ icons: Partial>; /** 可选:按文件名返回文件类型图标,未提供时 file-icon 使用通用占位 */ getFileIcon?: (filename: string, className?: string) => ReactNode; } export interface IconsProviderProps { value: IconsContextValue; children: ReactNode; } export declare function IconsProvider({ value, children }: IconsProviderProps): import("react/jsx-runtime").JSX.Element; export declare function useIcons(): IconsContextValue; /** 渲染语义化图标:有则用传入的 Icon,无则返回 undefined,便于调用方用 ?? 走内置 SVG fallback */ export declare function useIcon(key: IconKey, className?: string): ReactNode;