|
| 1 | +import { DefineComponent } from './v3-define-component' |
| 2 | + |
| 3 | +type Hook<T = () => void> = T | T[] |
| 4 | + |
| 5 | +export interface TransitionProps { |
| 6 | + name?: string |
| 7 | + appear?: boolean |
| 8 | + css?: boolean |
| 9 | + mode?: 'in-out' | 'out-in' | 'default' |
| 10 | + type?: 'transition' | 'animation' |
| 11 | + |
| 12 | + duration?: |
| 13 | + | number |
| 14 | + | string |
| 15 | + | { |
| 16 | + enter: number |
| 17 | + leave: number |
| 18 | + } |
| 19 | + |
| 20 | + // classes |
| 21 | + enterClass?: string |
| 22 | + enterActiveClass?: string |
| 23 | + enterToClass?: string |
| 24 | + appearClass?: string |
| 25 | + appearActiveClass?: string |
| 26 | + appearToClass?: string |
| 27 | + leaveClass?: string |
| 28 | + leaveActiveClass?: string |
| 29 | + leaveToClass?: string |
| 30 | + |
| 31 | + // event hooks |
| 32 | + onBeforeEnter?: Hook<(el: Element) => void> |
| 33 | + onEnter?: Hook<(el: Element, done: () => void) => void> |
| 34 | + onAfterEnter?: Hook<(el: Element) => void> |
| 35 | + onEnterCancelled?: Hook<(el: Element) => void> |
| 36 | + onBeforeLeave?: Hook<(el: Element) => void> |
| 37 | + onLeave?: Hook<(el: Element, done: () => void) => void> |
| 38 | + onAfterLeave?: Hook<(el: Element) => void> |
| 39 | + onLeaveCancelled?: Hook<(el: Element) => void> |
| 40 | + onBeforeAppear?: Hook<(el: Element) => void> |
| 41 | + onAppear?: Hook<(el: Element, done: () => void) => void> |
| 42 | + onAfterAppear?: Hook<(el: Element) => void> |
| 43 | + onAppearCancelled?: Hook<(el: Element) => void> |
| 44 | +} |
| 45 | + |
| 46 | +export declare const Transition: DefineComponent<TransitionProps> |
| 47 | + |
| 48 | +export type TransitionGroupProps = Omit<TransitionProps, 'mode'> & { |
| 49 | + tag?: string |
| 50 | + moveClass?: string |
| 51 | +} |
| 52 | + |
| 53 | +export declare const TransitionGroup: DefineComponent<TransitionGroupProps> |
| 54 | + |
| 55 | +type MatchPattern = string | RegExp | (string | RegExp)[] |
| 56 | + |
| 57 | +export interface KeepAliveProps { |
| 58 | + include?: MatchPattern |
| 59 | + exclude?: MatchPattern |
| 60 | + max?: number | string |
| 61 | +} |
| 62 | + |
| 63 | +export declare const KeepAlive: DefineComponent<KeepAliveProps> |
0 commit comments