fix: Parameters with default values are optional (#5083)

pull/5130/head
Bob Fanger 4 years ago committed by GitHub
parent 3f99e51a6f
commit 3dfb178739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,9 +11,9 @@ export interface AnimationConfig {
} }
interface FlipParams { interface FlipParams {
delay: number; delay?: number;
duration: number | ((len: number) => number); duration?: number | ((len: number) => number);
easing: (t: number) => number; easing?: (t: number) => number;
} }
export function flip(node: Element, animation: { from: DOMRect; to: DOMRect }, params: FlipParams): AnimationConfig { export function flip(node: Element, animation: { from: DOMRect; to: DOMRect }, params: FlipParams): AnimationConfig {

@ -12,11 +12,11 @@ export interface TransitionConfig {
} }
interface BlurParams { interface BlurParams {
delay: number; delay?: number;
duration: number; duration?: number;
easing?: EasingFunction; easing?: EasingFunction;
amount: number; amount?: number;
opacity: number; opacity?: number;
} }
export function blur(node: Element, { export function blur(node: Element, {
@ -41,9 +41,9 @@ export function blur(node: Element, {
} }
interface FadeParams { interface FadeParams {
delay: number; delay?: number;
duration: number; duration?: number;
easing: EasingFunction; easing?: EasingFunction;
} }
export function fade(node: Element, { export function fade(node: Element, {
@ -62,12 +62,12 @@ export function fade(node: Element, {
} }
interface FlyParams { interface FlyParams {
delay: number; delay?: number;
duration: number; duration?: number;
easing: EasingFunction; easing?: EasingFunction;
x: number; x?: number;
y: number; y?: number;
opacity: number; opacity?: number;
} }
export function fly(node: Element, { export function fly(node: Element, {
@ -95,9 +95,9 @@ export function fly(node: Element, {
} }
interface SlideParams { interface SlideParams {
delay: number; delay?: number;
duration: number; duration?: number;
easing: EasingFunction; easing?: EasingFunction;
} }
export function slide(node: Element, { export function slide(node: Element, {
@ -133,11 +133,11 @@ export function slide(node: Element, {
} }
interface ScaleParams { interface ScaleParams {
delay: number; delay?: number;
duration: number; duration?: number;
easing: EasingFunction; easing?: EasingFunction;
start: number; start?: number;
opacity: number; opacity?: number;
} }
export function scale(node: Element, { export function scale(node: Element, {
@ -166,10 +166,10 @@ export function scale(node: Element, {
} }
interface DrawParams { interface DrawParams {
delay: number; delay?: number;
speed: number; speed?: number;
duration: number | ((len: number) => number); duration?: number | ((len: number) => number);
easing: EasingFunction; easing?: EasingFunction;
} }
export function draw(node: SVGElement & { getTotalLength(): number }, { export function draw(node: SVGElement & { getTotalLength(): number }, {
@ -199,9 +199,9 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
} }
interface CrossfadeParams { interface CrossfadeParams {
delay: number; delay?: number;
duration: number | ((len: number) => number); duration?: number | ((len: number) => number);
easing: EasingFunction; easing?: EasingFunction;
} }
type ClientRectMap = Map<any, { rect: ClientRect }>; type ClientRectMap = Map<any, { rect: ClientRect }>;

Loading…
Cancel
Save