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

Update to Typescript definitions. #721

Merged
merged 2 commits into from
Mar 19, 2024
Merged
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
19 changes: 15 additions & 4 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ declare module "two.js/src/matrix" {
* @description Multiply all components of the matrix against a single scalar value.
* @overloaded
*/
multiply(a: number): any;
/**
* @name Two.Matrix#multiply
* @function
Expand All @@ -866,6 +867,7 @@ declare module "two.js/src/matrix" {
* @description Multiply all components of a matrix against a 3 component vector.
* @overloaded
*/
multiply(a: number, b: number, c?: number): [x: number, y: number, z: number];
/**
* @name Two.Matrix#multiply
* @function
Expand Down Expand Up @@ -1460,7 +1462,7 @@ declare module "two.js/src/group" {
* @returns {Object} - Returns object with top, left, right, bottom, width, height attributes.
* @description Return an object with top, left, right, bottom, width, and height parameters of the group.
*/
getBoundingClientRect(shallow?: boolean): any;
getBoundingClientRect(shallow?: boolean): Two.BoundingBox;
/**
* @name Two.Group#noFill
* @function
Expand Down Expand Up @@ -2467,7 +2469,7 @@ declare module "two.js/src/path" {
* @returns {Object} - Returns object with top, left, right, bottom, width, height attributes.
* @description Return an object with top, left, right, bottom, width, and height parameters of the path.
*/
getBoundingClientRect(shallow?: boolean): any;
getBoundingClientRect(shallow?: boolean): Two.BoundingBox;
/**
* @name Two.Path#getPointAt
* @function
Expand Down Expand Up @@ -3176,7 +3178,7 @@ declare module "two.js/src/text" {
* @returns {Object} - Returns object with top, left, right, bottom, width, height attributes.
* @description Return an object with top, left, right, bottom, width, and height parameters of the text object.
*/
getBoundingClientRect(shallow?: boolean): any;
getBoundingClientRect(shallow?: boolean): Two.BoundingBox;
}
import { Shape } from "two.js/src/shape";
import { Gradient } from "two.js/src/effects/gradient";
Expand Down Expand Up @@ -3551,7 +3553,7 @@ declare module "two.js/src/shapes/points" {
* @returns {Object} - Returns object with top, left, right, bottom, width, height attributes.
* @description Return an object with top, left, right, bottom, width, and height parameters of the path.
*/
getBoundingClientRect: (shallow?: boolean) => any;
getBoundingClientRect: (shallow?: boolean) => Two.BoundingBox;
/**
* @name Two.Points#subdivide
* @function
Expand Down Expand Up @@ -4474,6 +4476,15 @@ declare module "two.js" {
import { Renderer as CanvasRenderer } from "two.js/src/renderers/canvas";
import { Renderer as SVGRenderer } from "two.js/src/renderers/svg";
import { Renderer as WebGLRenderer } from "two.js/src/renderers/webgl";

export type BoundingBox = {
top: number,
left: number,
right: number,
bottom: number,
width: number,
height: number
}
}
declare module "two.js/extras/jsm/zui" {
/**
Expand Down
Loading