UNPKG

mindee

Version:

Mindee Client Library for Node.js

48 lines (47 loc) 1.8 kB
import { MinMax } from "./minMax"; import { Point } from "./point"; import { Polygon } from "./polygon"; /** * Get the central point (centroid) given a list of points. */ export declare function getCentroid(vertices: Array<Point>): Point; /** * Determine if a Point is within two Y coordinates. */ export declare function isPointInY(centroid: Point, yMin: number, yMax: number): boolean; /** * Get the maximum and minimum Y coordinates in a given list of Points. */ export declare function getMinMaxY(vertices: Array<Point>): MinMax; /** * Determine if a Point is within a Polygon's Y axis. */ export declare function isPointInPolygonY(centroid: Point, polygon: Polygon): boolean; /** * Calculate the relative Y position of a Polygon. * * Can be used to order (sort) words in the same column. */ export declare function relativeY(polygon: Polygon): number; /** * Determine if a Point is within two X coordinates. */ export declare function isPointInX(centroid: Point, xMin: number, xMax: number): boolean; /** * Get the maximum and minimum X coordinates in a given list of Points. */ export declare function getMinMaxX(vertices: Array<Point>): MinMax; /** * Determine if a Point is within a Polygon's X axis. */ export declare function isPointInPolygonX(centroid: Point, polygon: Polygon): boolean; /** * Calculate the relative X position of a Polygon. * * Can be used to order (sort) words in the same line. */ export declare function relativeX(polygon: Polygon): number; export declare function getMinYCoordinate(polygon: Polygon): number; export declare function getMinXCoordinate(polygon: Polygon): number; export declare function compareOnY(polygon1: Polygon, polygon2: Polygon): number; export declare function compareOnX(polygon1: Polygon, polygon2: Polygon): number;