Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PointerCircle.d.ts #1793

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
Loading