import { type ViewController } from "@johnmorrisdotca/kazoku-ui/view-controls"; import { type RouteLeg } from "./route.ts"; import type { OverlayHost } from "./markers/layer.ts"; import { type SeaNamesStats } from "./sea-names/host.ts"; import type { GeoPoint, GlobeView } from "./types.ts"; /** * The `` custom element: the line globe, drawn as SVG in its shadow root. Importing this entry point registers the tag once. It takes the attributes `size` (pixels, 320 by default), `center` (`"lon,lat"`; wins over the browser's location), `look` (`line` or `thick`; `style` is the older name for it, and a framework that reads `style` as CSS cannot use it) and `graticule`, and a shared view controller's camera through `setView`. * It carries kazoku-ui's controls itself: a drag turns it, two fingers pinch, Ctrl and the wheel zoom (a plain wheel at Fit scrolls the page) and the arrow keys, + and - work once it is focused, from a tenth of Fit to 20 times. `controls="none"` turns them off; `zoom-min` and `zoom-max` change the range. A `` on the element takes the hands over, and the page applies its events with `setView`. * * @example * ```ts no-run * import type { ChikyuEarth } from "@johnmorrisdotca/chikyu-earth/element"; * * const earth = document.createElement("chikyu-earth") as ChikyuEarth; * earth.setAttribute("center", "139.7,35.7"); * earth.setAttribute("look", "thick"); * document.body.append(earth); * ``` */ export declare class ChikyuEarth extends HTMLElement { #private; static observedAttributes: string[]; /** The controller behind the element's own hands (`play`, `set`, `fit`, `state`), while it is in a page. */ get controller(): ViewController | undefined; /** Where the view is centred now: the `center` attribute, else 0,0. The element never asks the browser where the reader is. */ get centre(): GeoPoint; /** * A route between two places (the attribute `route`, `lon,lat,lon,lat`). Null, the default, draws none. The line is the WGS84 geodesic, split at the date line. * Setting the property writes the attribute. Nothing is drawn again at rest: the line is part of the picture, which is drawn when the view or the route changes. */ get route(): { from: GeoPoint; to: GeoPoint; } | null; set route(value: { from: GeoPoint; to: GeoPoint; } | null); /** * Names of oceans, seas and continents (the attribute `sea-names`). Off unless set: a bare attribute is on. Oceans and continents from far out, seas once the Earth is large on the screen. Nothing is drawn again at rest. * * @example * ```ts no-run * import type { ChikyuEarth } from "@johnmorrisdotca/chikyu-earth/element"; * * const earth = document.querySelector("chikyu-earth") as ChikyuEarth; * earth.seaNames = true; * console.log(earth.seaNames); * earth.seaNames = false; * ``` */ get seaNames(): boolean; set seaNames(value: boolean); /** * Whether `sea-names` is on, the Earth's radius on the screen, the names shown, and how many times they were laid out. * * @example * ```ts no-run * import type { ChikyuEarth } from "@johnmorrisdotca/chikyu-earth/element"; * * const earth = document.querySelector("chikyu-earth") as ChikyuEarth; * console.log(earth.stats.seaNames.on); * ``` */ get stats(): { seaNames: SeaNamesStats; }; /** The distance, bearings and flight-time estimate for `route`, or null when none is set. The flight time assumes 900 km/h. */ get routeInfo(): RouteLeg | null; /** A box laid over the globe for markers (see `@johnmorrisdotca/chikyu-earth/markers`): where it is, the pose of the last drawing, and a way to hear the next. */ get overlay(): OverlayHost; disconnectedCallback(): void; connectedCallback(): void; attributeChangedCallback(name: string, _old: string | null, value: string | null): void; /** * Apply a shared controller's camera. Every event updates the state; `final: false` makes only the cheap * relative transform, and `final: true` redraws the orthographic projection. `live: true` says a hand is on the view (a drag, a pinch, a key held): * the projection is then also redrawn while it turns, at most 30 times a second, so the globe follows the pointer instead of jumping when it is let go. * The automatic turn leaves `live` off and is drawn about once a second. */ setView(view: GlobeView, final?: boolean, live?: boolean): void; } declare global { interface HTMLElementTagNameMap { "chikyu-earth": ChikyuEarth; } }