Skip to content

Commit

Permalink
typing easing
Browse files Browse the repository at this point in the history
  • Loading branch information
stc1988 authored and mkellner committed Mar 5, 2024
1 parent 924be02 commit dd55984
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 36 deletions.
11 changes: 10 additions & 1 deletion modules/base/easing/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@
"modules": {
"*": "./easing"
},
"preload": "easing"
"preload": "easing",
"typescript": {
"tsconfig": {
"compilerOptions": {
"types": [
"$(MODDABLE)/typings/easing"
]
}
}
}
}
34 changes: 34 additions & 0 deletions typings/easing.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
type EasingFunction = (value: number) => number;

interface Math {
backEaseIn: EasingFunction,
backEaseInOut: EasingFunction,
backEaseOut: EasingFunction,
bounceEaseIn: EasingFunction,
bounceEaseInOut: EasingFunction,
bounceEaseOut: EasingFunction,
circularEaseIn: EasingFunction,
circularEaseInOut: EasingFunction,
circularEaseOut: EasingFunction,
cubicEaseIn: EasingFunction,
cubicEaseInOut: EasingFunction,
cubicEaseOut: EasingFunction,
elasticEaseIn: EasingFunction,
elasticEaseInOut: EasingFunction,
elasticEaseOut: EasingFunction,
exponentialEaseIn: EasingFunction,
exponentialEaseInOut: EasingFunction,
exponentialEaseOut: EasingFunction,
quadEaseIn: EasingFunction,
quadEaseInOut: EasingFunction,
quadEaseOut: EasingFunction,
quartEaseIn: EasingFunction,
quartEaseInOut: EasingFunction,
quartEaseOut: EasingFunction,
quintEaseIn: EasingFunction,
quintEaseInOut: EasingFunction,
quintEaseOut: EasingFunction,
sineEaseIn: EasingFunction,
sineEaseInOut: EasingFunction,
sineEaseOut: EasingFunction
}
35 changes: 0 additions & 35 deletions typings/piu/MC.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,38 +543,3 @@ declare module "piu/MC" {
const rgba: rgba
}
}

type PiuInterpolator = (value: number) => number;

interface Math {
backEaseIn: PiuInterpolator,
backEaseInOut: PiuInterpolator,
backEaseOut: PiuInterpolator,
bounceEaseIn: PiuInterpolator,
bounceEaseInOut: PiuInterpolator,
bounceEaseOut: PiuInterpolator,
circularEaseIn: PiuInterpolator,
circularEaseInOut: PiuInterpolator,
circularEaseOut: PiuInterpolator,
cubicEaseIn: PiuInterpolator,
cubicEaseInOut: PiuInterpolator,
cubicEaseOut: PiuInterpolator,
elasticEaseIn: PiuInterpolator,
elasticEaseInOut: PiuInterpolator,
elasticEaseOut: PiuInterpolator,
exponentialEaseIn: PiuInterpolator,
exponentialEaseInOut: PiuInterpolator,
exponentialEaseOut: PiuInterpolator,
quadEaseIn: PiuInterpolator,
quadEaseInOut: PiuInterpolator,
quadEaseOut: PiuInterpolator,
quartEaseIn: PiuInterpolator,
quartEaseInOut: PiuInterpolator,
quartEaseOut: PiuInterpolator,
quintEaseIn: PiuInterpolator,
quintEaseInOut: PiuInterpolator,
quintEaseOut: PiuInterpolator,
sineEaseIn: PiuInterpolator,
sineEaseInOut: PiuInterpolator,
sineEaseOut: PiuInterpolator
}

0 comments on commit dd55984

Please sign in to comment.