Skip to content

Commit

Permalink
fix: Parameters with default values are optional (sveltejs#5083)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfanger authored and taylorzane committed Dec 17, 2020
1 parent 53b9fd2 commit 9e00336
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
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

0 comments on commit 9e00336

Please sign in to comment.