Skip to content

Commit

Permalink
Adds default argument for animation controller typing
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-schroeder committed Jan 26, 2023
1 parent 3c1e614 commit 7af2a2a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ interface Coordinates {
/**
* Allows start/stop control of the animation
*/
export interface AnimationController<P> {
export interface AnimationController<P = unknown> {
/**
* The original animation parent.
*/
readonly parent: Element;
readonly parent: Element
/**
* A function that enables future animations.
*/
enable: () => void;
enable: () => void
/**
* A function that disables future animations.
*/
disable: () => void;
disable: () => void
/**
* A function that returns true if the animations are currently enabled.
*/
isEnabled: () => boolean;
isEnabled: () => boolean
/**
* (Svelte Specific) A function that runs if the parameters are changed.
*/
update?: (newParams: P) => void;
/**
* (Svelte Specific) A function that runs when the componnet is removed from the DOM.
*/
destroy?: () => void;
update?: (newParams: P) => void
/**
* (Svelte Specific) A function that runs when the componnet is removed from the DOM.
*/
destroy?: () => void
}

/**
Expand Down

1 comment on commit 7af2a2a

@vercel
Copy link

@vercel vercel bot commented on 7af2a2a Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.