2
0
mirror of https://github.com/iconify/iconify.git synced 2024-10-24 09:32:02 +00:00
iconify/packages/vue2/src/props.ts

52 lines
1.2 KiB
TypeScript
Raw Normal View History

import { IconifyIcon } from '@iconify/types';
import { IconifyIconCustomisations as RawIconCustomisations } from '@iconify/core/lib/customisations';
export { RawIconCustomisations };
// Allow rotation to be string
/**
* Icon customisations
*/
export type IconifyIconCustomisations = RawIconCustomisations & {
rotate?: string | number;
};
/**
* Callback for when icon has been loaded (only triggered for icons loaded from API)
*/
export type IconifyIconOnLoad = (name: string) => void;
/**
* Icon properties
*/
export interface IconifyIconProps extends IconifyIconCustomisations {
// Icon object
icon: IconifyIcon | string;
// Style
color?: string;
// Shorthand properties
flip?: string;
align?: 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?: unknown;
// Callback to call when icon data has been loaded. Used only for icons loaded from API
onLoad?: IconifyIconOnLoad;
}
/**
* Mix of icon properties and HTMLElement properties
*/
export type IconProps = IconifyElementProps & IconifyIconProps;