diff --git a/.changeset/old-otters-tan.md b/.changeset/old-otters-tan.md new file mode 100644 index 0000000..aa232fb --- /dev/null +++ b/.changeset/old-otters-tan.md @@ -0,0 +1,5 @@ +--- +"@navigraph/charts": patch +--- + +Updated the `Chart` types & associated documentation to better aid developers. Also added information about the newly introduced additional bounding boxes: `profile`, `minimums` and `header`. diff --git a/packages/charts/src/public-types.ts b/packages/charts/src/public-types.ts index a5a4f28..f937e47 100644 --- a/packages/charts/src/public-types.ts +++ b/packages/charts/src/public-types.ts @@ -1,3 +1,9 @@ +/** + * A bounding box representation in pixels from the origin (top left) of the chart. + * + * **Note:** The first coordinate is the *bottom left* corner, the second + * coordinate is the *top right* corner. + */ export interface Pixels { x1: number; y1: number; @@ -5,6 +11,7 @@ export interface Pixels { y2: number; } +/** The same as {@link Pixels}, but with geographical coordinates instead. */ export interface Latlng { lng1: number; lat1: number; @@ -12,6 +19,10 @@ export interface Latlng { lat2: number; } +/** + * World references for the "Map" part of the chart, containing the top-down route. + * Can be used to accurately show the ownship location. + */ export interface Planview { pixels: Pixels; latlng: Latlng; @@ -21,17 +32,31 @@ export interface Inset { pixels: Pixels; } +/** + * A list of bounding boxes available for the chart. Can be used to make the chart + * more interactive by exclusively showing certain features. + * + * **Note:** To the extent that it is possible, always keep the disclaimer + * text visible - regardless of which bounding box is active. + */ export interface BoundingBoxes { planview: Planview; insets: Inset[]; + profile?: Inset; + minimums?: Inset; + header?: Inset; } export type ChartCategory = "APT" | "REF" | "ARR" | "DEP" | "APP"; export type Chart = { + /** @deprecated Use {@link Chart.image_day_url|image_day_url} instead */ image_day: string; + /** @deprecated Use {@link Chart.image_night_url|image_night_url} instead */ image_night: string; + /** @deprecated Use {@link Chart.thumb_day_url|thumb_day_url} instead */ thumb_day: string; + /** @deprecated Use {@link Chart.thumb_night_url|thumb_night_url} instead */ thumb_night: string; icao_airport_identifier: string; id: string; @@ -42,7 +67,9 @@ export type Chart = { revision_date: string; width: number; height: number; + /** The procedures, if any, that is associated with this chart. */ procedures: string[]; + /** The runways, if any, that is associated with this chart. */ runways: string[]; image_day_url: string; image_night_url: string;