-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): provide types for built-in components
close #13002
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { DefineComponent } from './v3-define-component' | ||
|
||
type Hook<T = () => void> = T | T[] | ||
|
||
export interface TransitionProps { | ||
name?: string | ||
appear?: boolean | ||
css?: boolean | ||
mode?: 'in-out' | 'out-in' | 'default' | ||
type?: 'transition' | 'animation' | ||
|
||
duration?: | ||
| number | ||
| string | ||
| { | ||
enter: number | ||
leave: number | ||
} | ||
|
||
// classes | ||
enterClass?: string | ||
enterActiveClass?: string | ||
enterToClass?: string | ||
appearClass?: string | ||
appearActiveClass?: string | ||
appearToClass?: string | ||
leaveClass?: string | ||
leaveActiveClass?: string | ||
leaveToClass?: string | ||
|
||
// event hooks | ||
onBeforeEnter?: Hook<(el: Element) => void> | ||
onEnter?: Hook<(el: Element, done: () => void) => void> | ||
onAfterEnter?: Hook<(el: Element) => void> | ||
onEnterCancelled?: Hook<(el: Element) => void> | ||
onBeforeLeave?: Hook<(el: Element) => void> | ||
onLeave?: Hook<(el: Element, done: () => void) => void> | ||
onAfterLeave?: Hook<(el: Element) => void> | ||
onLeaveCancelled?: Hook<(el: Element) => void> | ||
onBeforeAppear?: Hook<(el: Element) => void> | ||
onAppear?: Hook<(el: Element, done: () => void) => void> | ||
onAfterAppear?: Hook<(el: Element) => void> | ||
onAppearCancelled?: Hook<(el: Element) => void> | ||
} | ||
|
||
export declare const Transition: DefineComponent<TransitionProps> | ||
|
||
export type TransitionGroupProps = Omit<TransitionProps, 'mode'> & { | ||
tag?: string | ||
moveClass?: string | ||
} | ||
|
||
export declare const TransitionGroup: DefineComponent<TransitionGroupProps> | ||
|
||
type MatchPattern = string | RegExp | (string | RegExp)[] | ||
|
||
export interface KeepAliveProps { | ||
include?: MatchPattern | ||
exclude?: MatchPattern | ||
max?: number | string | ||
} | ||
|
||
export declare const KeepAlive: DefineComponent<KeepAliveProps> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,3 +71,5 @@ export { | |
FunctionDirective, | ||
Directive | ||
} from './v3-directive' | ||
|
||
export * from './built-in-components' |