import type { LonLat } from "./venues.geo.ts"; import type { Pt } from "./crowd.ts"; /** The metres one whole number of the mask's coordinates is. */ export declare const WALK_UNIT = 0.25; /** What a district's mask is made from, as `walk.data.ts` holds it: lines (`[width in tenths of a metre, first point, steps...]`) and areas (rings, the first the outside, in whole quarter-metres). */ export interface WalkData { /** The raw file the data was made from, and the day it was read and the time of OpenStreetMap's data. */ source: string; read: string; base: string; licence: "ODbL-1.0"; attribution: string; /** The venues the district was made for: the keys of `VENUES` and `STADIUMS` with the configuration, as a district names them. */ venues: readonly string[]; /** The `[longitude, latitude]` the metres are measured from. */ origin: LonLat; /** The box the data covers, `[west, south, east, north]` in metres from the origin. */ box: readonly [number, number, number, number]; walkLines: readonly (readonly number[])[]; walkAreas: readonly (readonly (readonly number[])[])[]; blockLines: readonly (readonly number[])[]; blockAreas: readonly (readonly (readonly number[])[])[]; } /** The side of a cell of the mask, in metres: half a metre, finer than the narrowest path and a person's width. */ export declare const WALK_CELL = 0.5; /** The grid of a mask: `cells[row * width + column]` is 1 where a person may stand. Cell `(0, 0)` has its corner at `(x0, y0)` metres east and north of `origin`. */ export interface WalkMask { id: string; origin: LonLat; cell: number; x0: number; y0: number; width: number; height: number; cells: Uint8Array; /** How many cells are walkable. */ walkable: number; } /** The districts there are masks for. */ export declare const WALK_IDS: readonly string[]; /** Hold districts' data for the drawing, under their keys: a later one with a key replaces the earlier. */ export declare function registerWalk(table: Readonly>): void; /** The data of a district, if it is held. */ export declare const heldWalk: (id: string) => WalkData | undefined; /** The data of a district, which a crowd outside is made from; throws, saying how to have it, where it is not held. */ export declare function walkDataOf(id: string): WalkData; /** A district's data, read from its own file the first time and held for the drawing after: asking again gives the same promise. A key that is not a district rejects, naming the ones there are. */ export declare function loadWalk(id: string): Promise; /** A path from its packed form: the first point, then the step to each next one, in metres. */ export declare function unpack(packed: readonly number[], from?: number): Pt[]; /** What a mask is given besides the data: rings in metres from the mask's origin that stop a crowd (the venues' own buildings), and rings whose surroundings are the venues' own ground. */ export interface WalkExtras { /** The outline of each venue's building: stops a crowd, and a band `apron` metres wide round it is ground a crowd may stand on. */ buildings: readonly (readonly Pt[])[]; /** The width of the venue's own ground round its building, in metres. */ apron: number; } /** * The mask of a district, rasterised from the district's data (`walk/.data.ts`, held by `loadOutside` or by the full table; and kept for the next call): the walkable areas and the paths at their width, the apron round each venue, then the carriageways, cycle tracks, railways, water and buildings cut out * of them, and the venues' own buildings last. A person stands in a cell with value 1, and nowhere else. */ export declare function walkMask(id: string, extras: WalkExtras): WalkMask; /** Whether a point (metres east and north of the mask's origin) is in a walkable cell. */ export declare function walkable(mask: WalkMask, x: number, y: number): boolean; /** The mask a set of venues stand on, if there is one: the first mask that names one of them (by id, whatever configuration). */ export declare const walkIdFor: (venueIds: readonly string[]) => string | undefined; /** * The walkable ground the crowd outside some venues stands on, read from its file and held for the drawing: await it before `planDistrict`, `drawDistrict`, `mountDistrict` or `mountDistrictTurn` of the lean district with `outside` asked for * (the district entry holds every district's data and needs no call), and the outline of each arena of the ground (the crowd keeps out of the buildings of the venues that are not shown too). It reads nothing for venues that no mask names, so a page may call it for every choice of venues; asking again reads nothing. * @example * ```ts * import { loadOutside, loadVenueDataFor, outsideCrowd, planDistrict } from "@johnmorrisdotca/kyogijo-stadiums/district-lean"; * const venues = ["bc-place:cfl", "rogers-arena"]; * await Promise.all([loadVenueDataFor(venues), loadOutside(venues)]); * console.log(outsideCrowd(planDistrict({ venues, outside: { level: 25 } }))?.venues.length); * // 2 * ``` */ export declare function loadOutside(venues: readonly string[]): Promise;