mirror of
https://github.com/iconify/iconify.git
synced 2024-12-14 14:38:25 +00:00
63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import type { IconifyIcon } from '@iconify/types';
|
|
import type { IconifyIconCustomisations as RawIconifyIconCustomisations } from '@iconify/utils/lib/customisations/defaults';
|
|
import { defaultIconCustomisations } from '@iconify/utils/lib/customisations/defaults';
|
|
|
|
/**
|
|
* Icon render mode
|
|
*
|
|
* 'style' = 'bg' or 'mask', depending on icon content
|
|
* 'bg' = <span> with style using `background`
|
|
* 'mask' = <span> with style using `mask`
|
|
* 'svg' = <svg>
|
|
*/
|
|
export type IconifyRenderMode = 'style' | 'bg' | 'mask' | 'svg';
|
|
|
|
/**
|
|
* Icon customisations
|
|
*/
|
|
export type IconifyIconCustomisations = RawIconifyIconCustomisations & {
|
|
// Allow rotation to be string
|
|
rotate?: string | number;
|
|
|
|
// Inline mode
|
|
inline?: boolean;
|
|
};
|
|
|
|
export const defaultExtendedIconCustomisations = {
|
|
...defaultIconCustomisations,
|
|
inline: false,
|
|
};
|
|
|
|
/**
|
|
* Icon properties
|
|
*/
|
|
export interface IconifyIconProps extends IconifyIconCustomisations {
|
|
// Icon object
|
|
icon: IconifyIcon | string;
|
|
|
|
// Render mode
|
|
mode?: IconifyRenderMode;
|
|
|
|
// Style
|
|
color?: string;
|
|
|
|
// Flip shorthand
|
|
flip?: string;
|
|
}
|
|
|
|
/**
|
|
* Properties for element that are mentioned in render.ts
|
|
*/
|
|
interface IconifyElementProps {
|
|
// Unique id, used as base for ids for shapes. Use it to get consistent ids for server side rendering
|
|
id?: string;
|
|
|
|
// Style
|
|
style?: string;
|
|
}
|
|
|
|
/**
|
|
* Mix of icon properties and HTMLElement properties
|
|
*/
|
|
export type IconProps = IconifyElementProps & IconifyIconProps;
|