Skip to content

Commit

Permalink
Merge pull request #1793 from paireks/develop/MissingTypesForPointerC…
Browse files Browse the repository at this point in the history
…ircle

Add PointerCircle.d.ts
  • Loading branch information
xeolabs authored Jan 27, 2025
2 parents 3e85f51 + 679a1ef commit 306f063
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/extras/PointerCircle/PointerCircle.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class PointerCircle {
}

/**
* Stop the shricking circle and hide it.
* Stop the shrinking circle and hide it.
*/
stop() {
if (this._destroyed) {
Expand Down
50 changes: 50 additions & 0 deletions types/extras/PointerCircle/PointerCircle.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import {Viewer} from "../../viewer";

/**
* A PointerCircle shows a circle, centered at the position of the
* mouse or touch pointer.
*/
export class PointerCircle {
/**
* Constructs a new PointerCircle.
* @param {Viewer} viewer The Viewer
* @param {Object} [cfg] PointerCircle configuration.
* @param {boolean} [cfg.active=true] Whether PointerCircle is active. The PointerCircle can only be shown when this is `true` (default).
*/
constructor(viewer: Viewer, cfg?: {
active?: boolean;
});

/**
* Show the circle at the given canvas coordinates and begin shrinking it.
*/
start(circlePos: number[]): void;

/**
* Stop the shrinking circle and hide it.
*/
stop(): void;

/**
* Sets the zoom factor for the lens.
*
* This is `2` by default.
*
* @param {number} durationMs
*/
set durationMs(durationMs: number);

/**
* Gets the zoom factor for the lens.
*
* This is `2` by default.
*
* @returns {number} Number
*/
get durationMs(): number;

/**
* Destroys this PointerCircle.
*/
destroy(): void;
}
1 change: 1 addition & 0 deletions types/extras/PointerCircle/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./PointerCircle";

0 comments on commit 306f063

Please sign in to comment.