UNPKG

@brendonhudnell/react-hexgrid

Version:

Interactive hexagon grids with React bindings

37 lines (36 loc) 1.44 kB
import { LayoutParams } from './Layout'; import Hex from './models/Hex'; import Point from './models/Point'; declare function equals(a: Hex, b: Hex): boolean; declare function add(a: Hex, b: Hex): Hex; declare function subtract(a: Hex, b: Hex): Hex; declare function multiply(a: Hex, k: number): Hex; declare function lengths(hex: Hex): number; declare function distance(a: Hex, b: Hex): number; declare function getDirection(direction: number): Hex; declare function neighbour(hex: Hex, direction: number): Hex; declare function neighbours(hex: Hex): Hex[]; declare function round(hex: Hex): Hex; declare function hexToPixel(hex: Hex, layout: LayoutParams): Point; declare function pixelToHex(point: Point, layout: LayoutParams): Hex; declare function lerp(a: number, b: number, t: number): number; declare function hexLerp(a: Hex, b: Hex, t: number): Hex; declare function getID(hex: Hex): string; declare const HexUtils: { equals: typeof equals; add: typeof add; subtract: typeof subtract; multiply: typeof multiply; lengths: typeof lengths; distance: typeof distance; direction: typeof getDirection; neighbour: typeof neighbour; neighbours: typeof neighbours; round: typeof round; hexToPixel: typeof hexToPixel; pixelToHex: typeof pixelToHex; lerp: typeof lerp; hexLerp: typeof hexLerp; getID: typeof getID; }; export default HexUtils;