Skip to content

Commit 3942c93

Browse files
committed
feat: add set fps jsdoc
feat: add set fps jsdoc
1 parent 37dfd4d commit 3942c93

File tree

9 files changed

+47
-11
lines changed

9 files changed

+47
-11
lines changed

build/proton.d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,16 @@ declare class Proton$1 {
147147
integrator: Integration;
148148
_fps: string;
149149
_interval: number;
150-
set fps(fps: string);
151-
get fps(): string;
150+
/**
151+
* Sets the frames per second (FPS) for the Proton system.
152+
* @param {number|string} fps - The desired FPS. Use "auto" for default behavior, or a number for a specific FPS.
153+
*/
154+
set fps(fps: number | string);
155+
/**
156+
* Gets the current frames per second (FPS) setting.
157+
* @returns {number|string} The current FPS setting. Returns "auto" if set to default, or a number representing the specific FPS.
158+
*/
159+
get fps(): number | string;
152160
/**
153161
* add a type of Renderer
154162
*

build/proton.js

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/proton.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/proton.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/proton.web.js

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/proton.web.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/proton.web.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "proton-engine",
3-
"version": "7.1.0",
3+
"version": "7.1.1",
44
"description": "Proton is a simple and powerful javascript particle animation engine.",
55
"keywords": [
66
"particle",

src/core/Proton.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,19 @@ export default class Proton {
6262
this._interval = Proton.DEFAULT_INTERVAL;
6363
}
6464

65+
/**
66+
* Sets the frames per second (FPS) for the Proton system.
67+
* @param {number|string} fps - The desired FPS. Use "auto" for default behavior, or a number for a specific FPS.
68+
*/
6569
set fps(fps) {
6670
this._fps = fps;
6771
this._interval = fps === "auto" ? Proton.DEFAULT_INTERVAL : MathUtil.floor(1 / fps, 7);
6872
}
6973

74+
/**
75+
* Gets the current frames per second (FPS) setting.
76+
* @returns {number|string} The current FPS setting. Returns "auto" if set to default, or a number representing the specific FPS.
77+
*/
7078
get fps() {
7179
return this._fps;
7280
}

0 commit comments

Comments
 (0)