@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
9 lines (8 loc) • 507 B
TypeScript
import { KebabCase } from 'type-fest';
import * as icons from "@esri/calcite-ui-icons";
type ExtractBaseIcon<T> = T extends `${infer Base}${"16" | "24" | "32"}F` ? `${Base}F` : T extends `${infer Base}F` ? `${Base}F` : T extends `${infer Base}${"16" | "24" | "32"}` ? Base : never;
type CamelCaseIcons = ExtractBaseIcon<keyof typeof icons>;
type KebabCaseIcons = KebabCase<CamelCaseIcons>;
export type IconName = KebabCaseIcons | CamelCaseIcons;
export type IconNameOrString = IconName | string;
export {};