Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Parameters with default values are optional #5083

Merged
merged 1 commit into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/runtime/animate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export interface AnimationConfig {
}

interface FlipParams {
delay: number;
duration: number | ((len: number) => number);
easing: (t: number) => number;
delay?: number;
duration?: number | ((len: number) => number);
easing?: (t: number) => number;
}

export function flip(node: Element, animation: { from: DOMRect; to: DOMRect }, params: FlipParams): AnimationConfig {
Expand Down
56 changes: 28 additions & 28 deletions src/runtime/transition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export interface TransitionConfig {
}

interface BlurParams {
delay: number;
duration: number;
delay?: number;
duration?: number;
easing?: EasingFunction;
amount: number;
opacity: number;
amount?: number;
opacity?: number;
}

export function blur(node: Element, {
Expand All @@ -41,9 +41,9 @@ export function blur(node: Element, {
}

interface FadeParams {
delay: number;
duration: number;
easing: EasingFunction;
delay?: number;
duration?: number;
easing?: EasingFunction;
}

export function fade(node: Element, {
Expand All @@ -62,12 +62,12 @@ export function fade(node: Element, {
}

interface FlyParams {
delay: number;
duration: number;
easing: EasingFunction;
x: number;
y: number;
opacity: number;
delay?: number;
duration?: number;
easing?: EasingFunction;
x?: number;
y?: number;
opacity?: number;
}

export function fly(node: Element, {
Expand Down Expand Up @@ -95,9 +95,9 @@ export function fly(node: Element, {
}

interface SlideParams {
delay: number;
duration: number;
easing: EasingFunction;
delay?: number;
duration?: number;
easing?: EasingFunction;
}

export function slide(node: Element, {
Expand Down Expand Up @@ -133,11 +133,11 @@ export function slide(node: Element, {
}

interface ScaleParams {
delay: number;
duration: number;
easing: EasingFunction;
start: number;
opacity: number;
delay?: number;
duration?: number;
easing?: EasingFunction;
start?: number;
opacity?: number;
}

export function scale(node: Element, {
Expand Down Expand Up @@ -166,10 +166,10 @@ export function scale(node: Element, {
}

interface DrawParams {
delay: number;
speed: number;
duration: number | ((len: number) => number);
easing: EasingFunction;
delay?: number;
speed?: number;
duration?: number | ((len: number) => number);
easing?: EasingFunction;
}

export function draw(node: SVGElement & { getTotalLength(): number }, {
Expand Down Expand Up @@ -199,9 +199,9 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
}

interface CrossfadeParams {
delay: number;
duration: number | ((len: number) => number);
easing: EasingFunction;
delay?: number;
duration?: number | ((len: number) => number);
easing?: EasingFunction;
}

type ClientRectMap = Map<any, { rect: ClientRect }>;
Expand Down