Add some typehints to the models

This commit is contained in:
Pieter Vander Vennet 2022-01-31 00:39:54 +01:00
parent 046902a139
commit 3679814664
6 changed files with 343 additions and 7 deletions

View file

@ -141,6 +141,8 @@ export interface LayerConfigJson {
* If not specified, the OsmLink and wikipedia links will be used by default.
* Use an empty array to hide them.
* Note that "defaults" will insert all the default titleIcons (which are added automatically)
*
* Type: icon[]
*/
titleIcons?: (string | TagRenderingConfigJson)[] | ["defaults"];

View file

@ -32,7 +32,7 @@ export interface LayoutConfigJson {
credits?: string;
/**
* Who does maintian this preset?
* Who does maintain this preset?
*/
maintainer: string;
@ -74,13 +74,17 @@ export interface LayoutConfigJson {
* The icon representing this theme.
* Used as logo in the more-screen and (for official themes) as favicon, webmanifest logo, ...
* Either a URL or a base64 encoded value (which should include 'data:image/svg+xml;base64)
*
* Type: icon
*/
icon: string;
/**
* Link to a 'social image' which is included as og:image-tag on official themes.
* Useful to share the theme on social media.
* See https://www.h3xed.com/web-and-internet/how-to-use-og-image-meta-tag-facebook-reddit for more information
* See https://www.h3xed.com/web-and-internet/how-to-use-og-image-meta-tag-facebook-reddit for more information$
*
* Type: image
*/
socialImage?: string;

View file

@ -26,7 +26,8 @@ export default interface PointRenderingConfigJson {
* As a result, on could use a generic pin, then overlay it with a specific icon.
* To make things even more practical, one can use all SVG's from the folder "assets/svg" and _substitute the color_ in it.
* E.g. to draw a red pin, use "pin:#f00", to have a green circle with your icon on top, use `circle:#0f0;<path to my icon.svg>`
*
* Type: icon
*/
icon?: string | TagRenderingConfigJson;
@ -36,7 +37,13 @@ export default interface PointRenderingConfigJson {
*
* Note: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle
*/
iconBadges?: { if: string | AndOrTagConfigJson, then: string | TagRenderingConfigJson }[]
iconBadges?: { if: string | AndOrTagConfigJson,
/**
* Badge to show
* Type: icon
*/
then: string | TagRenderingConfigJson
}[]
/**

View file

@ -108,6 +108,7 @@ export interface TagRenderingConfigJson {
then: string | any,
/**
* An icon supporting this mapping; typically shown pretty small
* Type: icon
*/
icon?: string
/**