primevue-mirror/components/avatar/Avatar.d.ts

75 lines
1.8 KiB
TypeScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type AvatarSizeType = 'normal' | 'large' | 'xlarge' | undefined;
type AvatarShapeType = 'square' | 'circle' | undefined;
export interface AvatarProps {
/**
* Defines the text to display.
*/
label?: string | undefined;
/**
* Defines the icon to display.
*/
icon?: string | undefined;
/**
* Defines the image to display.
*/
image?: string | undefined;
/**
* Size of the element, valid options are 'normal', 'large' and 'xlarge'.
* @see AvatarSizeType
* Default value is 'normal'.
*/
size?: AvatarSizeType;
/**
* Shape of the element, valid options are 'square' and 'circle'.
* @see AvatarShapeType
* Default value is 'square'.
*/
shape?: AvatarShapeType;
2022-12-08 11:04:25 +00:00
/**
* Establishes a string value that labels the component.
*/
'aria-label'?: string | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
'aria-labelledby'?: string | undefined;
2022-09-06 12:03:37 +00:00
}
export interface AvatarSlots {
/**
* Content can easily be customized with the default slot instead of using the built-in modes.
*/
default: () => VNode[];
}
export declare type AvatarEmits = {
/**
* Triggered when an error occurs while loading an image file.
*/
error: () => void;
2022-09-14 11:26:01 +00:00
};
2022-09-06 12:03:37 +00:00
2022-09-14 11:26:01 +00:00
declare class Avatar extends ClassComponent<AvatarProps, AvatarSlots, AvatarEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Avatar: GlobalComponentConstructor<Avatar>;
2022-09-06 12:03:37 +00:00
}
}
/**
*
* Avatar represents people using icons, labels and images.
*
* Demos:
*
2022-09-14 11:26:01 +00:00
* - [Avatar](https://www.primefaces.org/primevue/avatar)
2022-09-06 12:03:37 +00:00
*
*/
export default Avatar;