Skip to content

Commit

Permalink
导出类型
Browse files Browse the repository at this point in the history
  • Loading branch information
hxg2050 committed Nov 21, 2023
1 parent b236530 commit fa936f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hease",
"private": false,
"version": "0.0.1",
"version": "0.0.2",
"repository": "https://github.com/hxg2050/hease.git",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand All @@ -28,5 +28,6 @@
"tslib": "^2.5.0",
"typescript": "^5.0.2",
"vite": "^4.4.9"
}
}
},
"dependencies": {}
}
11 changes: 10 additions & 1 deletion src/hease.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { EASE } from "./ease";

export interface Hease<T extends number | number[]> {
onComplete: (callback: Function) => this;
onUpdate: (callback: EasingUpdateFunc<T>) => this;
update: (progress: number | true) => void;
play: () => this
complete: () => this
stop: () => this
}

/**
* 简易刷新器
*/
Expand Down Expand Up @@ -44,7 +53,7 @@ export const hease = <T extends number | number[]>(from: T, to: T, duration = 10

let timeout: number | NodeJS.Timeout;

const actions = {
const actions: Hease<T> = {
/**
* 播放完成事件
*/
Expand Down

0 comments on commit fa936f5

Please sign in to comment.