-
Notifications
You must be signed in to change notification settings - Fork 138
/
types.ts
39 lines (34 loc) 路 1.65 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
39
/**
* @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, MaybeArray } from '@idux/cdk/utils'
import type { AvatarProps } from '@idux/components/avatar'
import type { DefineComponent, HTMLAttributes, PropType, VNodeChild } from 'vue'
export type HeaderSize = 'lg' | 'md' | 'sm'
export const headerProps = {
avatar: { type: [String, Object] as PropType<string | AvatarProps>, default: undefined },
description: { type: String, default: undefined },
disabled: { type: Boolean, default: false },
prefix: {
type: [String, Object, Function] as PropType<string | VNodeChild | (() => VNodeChild)>,
default: undefined,
},
size: { type: String as PropType<HeaderSize>, default: 'md' },
showBar: { type: Boolean, default: false },
subTitle: { type: String, default: undefined },
suffix: {
type: [String, Object, Function] as PropType<string | VNodeChild | (() => VNodeChild)>,
default: undefined,
},
title: { type: String, default: undefined },
// events
onPrefixClick: [Function, Array] as PropType<MaybeArray<(evt: MouseEvent) => void>>,
onSuffixClick: [Function, Array] as PropType<MaybeArray<(evt: MouseEvent) => void>>,
} as const
export type HeaderProps = ExtractInnerPropTypes<typeof headerProps>
export type HeaderPublicProps = ExtractPublicPropTypes<typeof headerProps>
export type HeaderComponent = DefineComponent<Omit<HTMLAttributes, keyof HeaderPublicProps> & HeaderPublicProps>
export type HeaderInstance = InstanceType<DefineComponent<HeaderProps>>