image-in-browser
Version:
Package for encoding / decoding images, transforming images, applying filters, drawing primitives on images on the client side (no need for server Node.js)
93 lines (92 loc) • 2.86 kB
TypeScript
/** @format */
/**
* Represents a line segment in a 2D space.
*/
export declare class Line {
private _x1;
private _y1;
private _x2;
private _y2;
/**
* Gets the x-coordinate of the first point.
* @returns {number} The x-coordinate of the first point.
*/
get x1(): number;
/**
* Gets the y-coordinate of the first point.
* @returns {number} The y-coordinate of the first point.
*/
get y1(): number;
/**
* Gets the x-coordinate of the second point.
* @returns {number} The x-coordinate of the second point.
*/
get x2(): number;
/**
* Gets the y-coordinate of the second point.
* @returns {number} The y-coordinate of the second point.
*/
get y2(): number;
/**
* Gets the difference in x-coordinates between the two points.
* @returns {number} The difference in x-coordinates.
*/
get dx(): number;
/**
* Gets the difference in y-coordinates between the two points.
* @returns {number} The difference in y-coordinates.
*/
get dy(): number;
/**
* Creates an instance of Line.
* @param {number} x1 - The x-coordinate of the first point.
* @param {number} y1 - The y-coordinate of the first point.
* @param {number} x2 - The x-coordinate of the second point.
* @param {number} y2 - The y-coordinate of the second point.
*/
constructor(x1: number, y1: number, x2: number, y2: number);
/**
* Creates a new Line instance from an existing one.
* @param {Line} other - The existing Line instance.
* @returns {Line} A new Line instance.
*/
static from(other: Line): Line;
/**
* Moves the first point to a new location.
* @param {number} x - The new x-coordinate of the first point.
* @param {number} y - The new y-coordinate of the first point.
*/
movePoint1(x: number, y: number): void;
/**
* Moves the second point to a new location.
* @param {number} x - The new x-coordinate of the second point.
* @param {number} y - The new y-coordinate of the second point.
*/
movePoint2(x: number, y: number): void;
/**
* Swaps the x and y coordinates of the first point.
*/
swapXY1(): void;
/**
* Swaps the x and y coordinates of the second point.
*/
swapXY2(): void;
/**
* Flips the x-coordinates of the two points.
*/
flipX(): void;
/**
* Flips the y-coordinates of the two points.
*/
flipY(): void;
/**
* Creates a new Line instance that is a copy of the current instance.
* @returns {Line} A new Line instance.
*/
clone(): Line;
/**
* Returns a string representation of the Line instance.
* @returns {string} A string representation of the Line instance.
*/
toString(): string;
}