-
Notifications
You must be signed in to change notification settings - Fork 138
/
types.ts
38 lines (34 loc) 路 1.49 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* @license
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE
*/
import type { ExtractInnerPropTypes, ExtractPublicPropTypes, VKey } from '@idux/cdk/utils'
import type { ButtonProps } from '@idux/components/button'
import type { ButtonHTMLAttributes, DefineComponent, HTMLAttributes, PropType, VNode, VNodeChild } from 'vue'
export interface FooterButtonProps extends ButtonHTMLAttributes, ButtonProps {
disabled?: boolean
key?: VKey
text?: string | VNode | (() => VNodeChild)
onClick?: (evt: Event) => void
}
export const footerProps = {
cancel: Function as PropType<(evt?: Event | unknown) => Promise<void> | void>,
cancelButton: Object as PropType<ButtonProps>,
cancelLoading: Boolean,
cancelText: String,
cancelVisible: {
type: Boolean,
default: true,
},
footer: [Boolean, Array, Object, Function] as PropType<boolean | FooterButtonProps[] | VNode | (() => VNodeChild)>,
ok: Function as PropType<(evt?: Event | unknown) => Promise<void> | void>,
okButton: Object as PropType<ButtonProps>,
okLoading: Boolean,
okText: String,
} as const
export type FooterProps = ExtractInnerPropTypes<typeof footerProps>
export type FooterPublicProps = ExtractPublicPropTypes<typeof footerProps>
export type FooterComponent = DefineComponent<Omit<HTMLAttributes, keyof FooterPublicProps> & FooterPublicProps>
export type FooterInstance = InstanceType<DefineComponent<FooterProps>>