@rickosborne/hexgrid
Version:
Rick Osborne's collection of hexagonal grid-related code.
83 lines • 2.44 kB
TypeScript
import type { Axial } from "./hex-system.js";
import type { BareQRSPoint, QRSPoint } from "./qrs.js";
/**
* Axial coordinates don't store the `s` coordinate, as it
* can always be calculated via `q + r + s = 0`.
*/
export type AxialPoint = QRSPoint<Axial>;
export declare const AXIAL_FLAT_SE: Readonly<{
readonly q: 1;
readonly r: 0;
readonly system: "axial";
}>;
export declare const AXIAL_FLAT_NE: Readonly<{
readonly q: 1;
readonly r: -1;
readonly system: "axial";
}>;
export declare const AXIAL_FLAT_N: Readonly<{
readonly q: 0;
readonly r: -1;
readonly system: "axial";
}>;
export declare const AXIAL_FLAT_NW: Readonly<{
readonly q: -1;
readonly r: 0;
readonly system: "axial";
}>;
export declare const AXIAL_FLAT_SW: Readonly<{
readonly q: -1;
readonly r: 1;
readonly system: "axial";
}>;
export declare const AXIAL_FLAT_S: Readonly<{
readonly q: 0;
readonly r: 1;
readonly system: "axial";
}>;
export declare const AXIAL_POINTY_E: Readonly<{
readonly q: 1;
readonly r: 0;
readonly system: "axial";
}>;
export declare const AXIAL_POINTY_NE: Readonly<{
readonly q: 1;
readonly r: -1;
readonly system: "axial";
}>;
export declare const AXIAL_POINTY_NW: Readonly<{
readonly q: 0;
readonly r: -1;
readonly system: "axial";
}>;
export declare const AXIAL_POINTY_W: Readonly<{
readonly q: -1;
readonly r: 0;
readonly system: "axial";
}>;
export declare const AXIAL_POINTY_SW: Readonly<{
readonly q: -1;
readonly r: 1;
readonly system: "axial";
}>;
export declare const AXIAL_POINTY_SE: Readonly<{
readonly q: 0;
readonly r: 1;
readonly system: "axial";
}>;
export type AxialDirection = typeof AXIAL_POINTY_E | typeof AXIAL_POINTY_NE | typeof AXIAL_POINTY_NW | typeof AXIAL_POINTY_W | typeof AXIAL_POINTY_SW | typeof AXIAL_POINTY_SE;
export declare const AXIAL_DIRECTIONS: Readonly<AxialDirection[]>;
export declare const axialFromQR: (q: number, r: number) => AxialPoint;
export declare const stringifyAxial: ({ q, r }: AxialPoint | BareQRSPoint) => string;
export type AxialTuple = [q: number, r: number];
export declare const AXIAL_ORIGIN: Readonly<{
readonly q: 0;
readonly r: 0;
readonly system: "axial";
}>;
export declare const AXIAL_EPSILON: Readonly<{
readonly q: 0.000001;
readonly r: 0.000001;
readonly system: "axial";
}>;
//# sourceMappingURL=axial.d.ts.map