UNPKG

1.42 kBTypeScriptView Raw
1import { SetupContext } from 'vue'
2import { VXEComponent, VxeComponentBase } from './component'
3
4/* eslint-disable no-use-before-define */
5
6/**
7 * 组件 - 图标
8 * @example import { VxeIcon } from 'vxe-table'
9 */
10export const VxeIcon: VXEComponent<{ [key: string]: any }>
11/**
12 * 组件 - 图标
13 */
14export const Icon: VXEComponent<{ [key: string]: any }>
15
16export interface VxeIconConstructor extends VxeComponentBase, VxeIconMethods {
17 props: VxeIconProps
18 context: SetupContext<VxeIconEmits>
19}
20
21export interface IconMethods {}
22
23export interface VxeIconMethods extends IconMethods { }
24
25export type VxeIconProps<D = any> = {
26 name?: VxeIconPropTypes.Name
27 roll?: VxeIconPropTypes.Roll
28 status?: VxeIconPropTypes.Status
29}
30
31export namespace VxeIconPropTypes {
32 export type Name = string
33 export type Roll = boolean
34 export type Status = string
35}
36
37export type VxeIconEmits = [
38 'click'
39]
40
41export namespace VxeIconDefines {
42 interface IconKeyboardEventParams {
43 $event: KeyboardEvent
44 }
45 export interface ClickParams {}
46 export interface ClickEventParams extends IconKeyboardEventParams, ClickParams { }
47}
48
49export type VxeIconEventProps = {
50 onClick?: VxeIconEvents.Click
51}
52
53export interface VxeIconListeners {
54 click?: VxeIconEvents.Click
55}
56
57export namespace VxeIconEvents {
58 export type Click = (params: VxeIconDefines.ClickEventParams) => void
59}