@loickit/shared 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -9,4 +9,18 @@ declare class Like {
9
9
  play(x: number, y: number): void;
10
10
  }
11
11
 
12
- export { Like };
12
+ declare class IntervalFn {
13
+ timer: ReturnType<typeof setTimeout> | undefined;
14
+ fn: (...p: any[]) => any;
15
+ delay: number;
16
+ args: any[];
17
+ record: number;
18
+ maxRecord: number;
19
+ constructor(fn: (...p: any[]) => any, delay: number, ...args: any[]);
20
+ run(...otherArgs: any[]): void;
21
+ pause(): void;
22
+ reset(): void;
23
+ restart(...otherArgs: any[]): void;
24
+ }
25
+
26
+ export { IntervalFn, Like };
package/dist/index.d.ts CHANGED
@@ -9,4 +9,18 @@ declare class Like {
9
9
  play(x: number, y: number): void;
10
10
  }
11
11
 
12
- export { Like };
12
+ declare class IntervalFn {
13
+ timer: ReturnType<typeof setTimeout> | undefined;
14
+ fn: (...p: any[]) => any;
15
+ delay: number;
16
+ args: any[];
17
+ record: number;
18
+ maxRecord: number;
19
+ constructor(fn: (...p: any[]) => any, delay: number, ...args: any[]);
20
+ run(...otherArgs: any[]): void;
21
+ pause(): void;
22
+ reset(): void;
23
+ restart(...otherArgs: any[]): void;
24
+ }
25
+
26
+ export { IntervalFn, Like };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- class t{createElement;width;height;constructor(t,{width:e,height:i}){this.width=e,this.height=i,this.createElement=t}play(t,e){const i=this.createElement();i.style.position="fixed",i.style.width=this.width+"px",i.style.height=this.height+"px",i.style.left=t-parseInt(i.style.width)/2+"px",i.style.top=e-parseInt(i.style.height)-10+"px";const s=new KeyframeEffect(i,[{transform:"scale(1)",opacity:.5},{transform:`scale(1.5) translateY(-${this.height/2}px)`,opacity:.9},{transform:`scale(1.5) translateY(-${this.height/2+10}px)`,opacity:0}],{duration:600,iterations:1,easing:"linear"});document.body.appendChild(i);const h=new Animation(s,document.timeline);h.onfinish=()=>{i.remove()},h.play()}}export{t as Like};
1
+ class t{createElement;width;height;constructor(t,{width:e,height:i}){this.width=e,this.height=i,this.createElement=t}play(t,e){const i=this.createElement();i.style.position="fixed",i.style.width=this.width+"px",i.style.height=this.height+"px",i.style.left=t-parseInt(i.style.width)/2+"px",i.style.top=e-parseInt(i.style.height)-10+"px";const s=new KeyframeEffect(i,[{transform:"scale(1)",opacity:.5},{transform:`scale(1.5) translateY(-${this.height/2}px)`,opacity:.9},{transform:`scale(1.5) translateY(-${this.height/2+10}px)`,opacity:0}],{duration:600,iterations:1,easing:"linear"});document.body.appendChild(i);const h=new Animation(s,document.timeline);h.onfinish=()=>{i.remove()},h.play()}}class e{timer;fn;delay;args;record;maxRecord;constructor(t,e,...i){this.fn=t,this.delay=e,this.args=i,this.timer=void 0,this.record=0,this.maxRecord=1/0}run(...t){this.fn.apply(this,this.args.concat(t)),this.record++,this.record>=this.maxRecord&&this.pause.call(this),this.timer=setTimeout(this.run.bind(this),this.delay)}pause(){clearTimeout(this.timer),this.timer=void 0}reset(){this.pause.call(this),this.record=0}restart(...t){this.reset.call(this),this.run.apply(this,t)}}export{e as IntervalFn,t as Like};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loickit/shared",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "loickit shared lib",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {