UNPKG

mindee

Version:

Mindee Client Library for Node.js

47 lines (46 loc) 1.81 kB
import { MinMax } from "./minMax"; import { Point } from "./point"; /** * 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: Array<Point>): 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: Array<Point>): 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: Array<Point>): 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: Array<Point>): number; export declare function getMinYCoordinate(polygon: Array<Point>): number; export declare function getMinXCoordinate(polygon: Array<Point>): number; export declare function compareOnY(polygon1: Array<Point>, polygon2: Array<Point>): number; export declare function compareOnX(polygon1: Array<Point>, polygon2: Array<Point>): number;