import { Vector3Like } from "@here/harp-geoutils/lib/math/Vector3Like" ; import { JsonExpr , JsonValue } from "./Expr" ; import { InterpolatedPropertyDefinition } from "./InterpolatedPropertyDefs" ; import { BaseTechniqueParams , BasicExtrudedLineTechniqueParams , ExtrudedPolygonTechniqueParams , FillTechniqueParams , LineTechniqueParams , MarkerTechniqueParams , Pickability , PointTechniqueParams , SegmentsTechniqueParams , ShaderTechniqueParams , SolidLineTechniqueParams , StandardExtrudedLineTechniqueParams , StandardTechniqueParams , TerrainTechniqueParams , TextTechniqueParams } from "./TechniqueParams" ; /**
 * Map theme is used to define what features are shown and how the map is styled, for example
 * which lightning is used or whether fog should be displayed.
 */ export interface Theme { /**
     * The URI of the JSON schema describing themes.
     */ $schema ? : string ; remarks extends ? : string | Theme | FlatTheme | Array < string | Theme | FlatTheme > ; /**
     * Actual URL the theme has been loaded from.
     */ url ? : string ; format clearColor ? : string ; format clearAlpha ? : number ; /**
     * Define the default text style for styling labels and texts.
     */ defaultTextStyle ? : TextStyleDefinition ; /**
     * Define the lightning available on the three.js scene.
     */ lights ? : Light [ ] ; /**
     * Define the style of the sky presented in the map scene.
     */ sky ? : Sky ; /**
     * Define the fog used in the map scene.
     */ fog ? : Fog ; /**
     * The definitions exported by these theme.
     */ definitions ? : Definitions ; /**
     * Map styles available for datasources used to render the map.
     */ styles ? : Styles ; /**
     * Define the style to render different types of text used on the map.
     */ textStyles ? : TextStyleDefinition [ ] ; /**
     * List available fonts to be used while rendering text.
     */ fontCatalogs ? : FontCatalogConfig [ ] ; /**
     * Optional images to be rendered on the map view.
     */ images ? : ImageDefinitions ; /**
     * Image textures to be used while rendering geometries on the map view.
     */ imageTextures ? : ImageTexture [ ] ; /**
     * Optional list of [[ThemePoiTableDef]]s.
     */ poiTables ? : PoiTableRef [ ] ; /**
     * Optional list of symbolic priorities for the object
     * created using this  Theme .
     *
     *  remarks The attribute `styleSet` and `category` of the [[Technique]]
     * are used together with [[Theme.priorities]] to sort
     * the objects created using this  Theme , for example:
     *
     *
     * ```json
     * {
     *      "priorities": [
     *          { "group": "tilezen", "category": "outline-1" }
     *      ],
     *      "styles": [
     *          {
     *              "technique": "solid-line",
     *              "styleSet": "tilezen",
     *              "category": "outline-1"
     *          }
     *      ]
     * }
     * ```
      priorities ? : StylePriority [ ] ; remarks labelPriorities ? : string [ ] ; } /**
 * A type representing symbolic render orders.
 */ export interface StylePriority { /**
     * The group of this `StylePriority`.
     */ group : string ; /**
     * The category of this `StylePriority`.
     */ category ? : string ; } internal This type will merge with  Theme .
  export type FlatTheme = Omit < Theme , "styles" > & { /**
     * The style rules used to render the map.
     */ styles ? : StyleSet ; } ; /**
 * Value definition commons.
 */ export type Definition = JsonValue | InterpolatedPropertyDefinition < JsonValue > ; deprecated export interface VerboseDefinition { /**
     * The type of the definition.
     */ type ? : "selector" | "boolean" | "number" | "string" | "color" ; /**
     * The value of the definition.
     */ value : Definition ; /**
     * The description of the definition.
     */ description ? : string ; } /**
 * This is to distinguish between definition types at runtime, to be deprecated with
 *  VerboseDefinition deprecated param definition returns `true` if the Definition is of the deprecated  VerboseDefinition type
  export function isVerboseDefinition ( definition ) { return ( definition as VerboseDefinition ) ?. value !== undefined ; } /**
 * This is a utility function to retrive a definitions value until  VerboseDefinition is fully
 * deprecated
 *  deprecated param definition returns export function getDefinitionValue ( definition ) { return isVerboseDefinition ( definition ) ? ( definition as VerboseDefinition ) . value : ( definition as Definition ) ; } export interface Definitions { [ name ] : Definition | VerboseDefinition ; } export type JsonExprReference = [ "ref" , string ] ; param value export function isJsonExprReference ( value ) { return ( Array . isArray ( value ) && value . length === 2 && value [ 0 ] === "ref" && typeof value [ 1 ] === "string" ) ; } /**
 * An array of  Style s that are used together to define how a
 *  {@link @here/harp-mapview#DataSource} should be rendered.
 *
 *  remarks `StyleSet`s are applied to sources providing vector tiles via their method
 * `setStyleSet`. This is also handle internally when a whole theme is passed to a
 *  {@link @here/harp-mapview#MapView} via  {@link @here/harp-mapview#MapViewtheme} .
  export type StyleSet = Style [ ] ; /**
 * The object that defines what way an item of a  {@link @here/harp-mapview#DataSource} * should be decoded to assemble a tile.
 *
 *  remarks Style is describing which features are shown on a map and in what way they are being
 * shown.
  export type BaseStyle < Technique , Params > = StyleAttributes < Technique , Params > & Partial < Params > ; /**
 * The common attributes of a  Style .
  export interface StyleAttributes < Technique , Params > { /**
     * Unique identifier associated with this `Style`.
     */ id ? : string ; /**
     * Reference to the identifier of an existing `Style` to extend.
     */ extends ? : string ; remarks Condition that is applied to feature properties to check if given  Style this feature
     * should emit geometry of this style.
      when ? : string | JsonExpr ; /**
     * The layer containing the carto features processed by this style rule.
     */ layer ? : string ; /**
     * Optional. If `true`, no more matching styles will be evaluated.
     */ final ? : boolean ; /**
     * Human readable description.
     */ description ? : string ; /**
     * The style set referenced by this styling rule.
     */ styleSet ? : string ; /**
     * The category of this style.
     */ category ? : string | JsonExpr ; remarks technique : Technique ; remarks default renderOrder ? : number | JsonExpr ; /**
     * Minimal zoom level. If the current zoom level is smaller, the technique will not be used.
     */ minZoomLevel ? : number | JsonExpr ; /**
     * Maximum zoom level. If the current zoom level is larger, the technique will not be used.
     */ maxZoomLevel ? : number | JsonExpr ; defaultValue transient ? : boolean | Pickability ; /**
     * Optional: If `true`, the objects with matching `when` statement will be printed to the
     * console.
     */ debug ? : boolean ; deprecated attr ? : Partial < Params > ; } export type Style = SquaresStyle | CirclesStyle | PoiStyle | LineMarkerStyle | LineStyle | SegmentsStyle | SolidLineStyle | LabelRejectionLineStyle | FillStyle | StandardStyle | BasicExtrudedLineStyle | StandardExtrudedLineStyle | ExtrudedPolygonStyle | ShaderStyle | TerrainStyle | TextTechniqueStyle | NoneStyle ; /**
 * A dictionary of  StyleSet s.
  export interface Styles { [ styleSetName ] : StyleSet ; } remarks /**
 * The attributes of a technique.
 */ export type Attr < T > = { [ P in keyof T ] ? : T [ P ] | JsonExpr ; } ; see PointTechniqueParams .
  export type SquaresStyle = BaseStyle < "squares" , PointTechniqueParams > ; see PointTechniqueParams .
  export type CirclesStyle = BaseStyle < "circles" , PointTechniqueParams > ; see export type PoiStyle = BaseStyle < "labeled-icon" , MarkerTechniqueParams > ; see export type LineMarkerStyle = BaseStyle < "line-marker" , MarkerTechniqueParams > ; /**
 * Render feature as line.
 */ export type LineStyle = BaseStyle < "line" , LineTechniqueParams > ; /**
 * Render feature as segments.
 */ export type SegmentsStyle = BaseStyle < "segments" , SegmentsTechniqueParams > ; export type SolidLineStyle = BaseStyle < "solid-line" | "dashed-line" , SolidLineTechniqueParams > ; export type LabelRejectionLineStyle = BaseStyle < "label-rejection-line" , BaseTechniqueParams > ; export type FillStyle = BaseStyle < "fill" , FillTechniqueParams > ; export type StandardStyle = BaseStyle < "standard" , StandardTechniqueParams > ; export type TerrainStyle = BaseStyle < "terrain" , TerrainTechniqueParams > ; export type BasicExtrudedLineStyle = BaseStyle < "extruded-line" , BasicExtrudedLineTechniqueParams > ; export type StandardExtrudedLineStyle = BaseStyle < "extruded-line" , StandardExtrudedLineTechniqueParams > ; /**
 * Style used to draw a geometry as an extruded polygon, for example extruded buildings.
 */ export type ExtrudedPolygonStyle = BaseStyle < "extruded-polygon" , ExtrudedPolygonTechniqueParams > ; export type ShaderStyle = BaseStyle < "shader" , ShaderTechniqueParams > ; export type TextTechniqueStyle = BaseStyle < "text" , TextTechniqueParams > ; export interface NoneStyle extends BaseStyle < "none" , { [ name ] : any ; } > { [ name ] : any ; } /**
 * Possible lights used for light the map.
 */ export type Light = AmbientLight | DirectionalLight ; export interface BaseLight { type : string ; name : string ; } /**
 * Ambient light
 */ export interface AmbientLight extends BaseLight { /**
     * The type of the light.
     */ type : "ambient" ; /**
     * The color of this ambient light.
     */ color : string ; /**
     * The intensity of this ambient light.
     */ intensity ? : number ; } /**
 * Directional light.
 */ export interface DirectionalLight extends BaseLight { /**
     * The type of the light.
     */ type : "directional" ; /**
     * The color of this directional light.
     */ color : string ; /**
     * The intensity of this directional light.
     */ intensity : number ; /**
     * The direction of this directional light.
     */ direction : Vector3Like ; defaultValue castShadow ? : boolean ; } /**
 * Various text styles used with labels and texts.
 */ export interface TextStyleDefinition { name ? : string ; fontCatalogName ? : string ; fontName ? : string ; size ? : number ; backgroundSize ? : number ; fontStyle ? : "Regular" | "Bold" | "Italic" | "BoldItalic" ; fontVariant ? : "Regular" | "AllCaps" | "SmallCaps" ; rotation ? : number ; format color ? : string ; format backgroundColor ? : string ; opacity ? : number ; backgroundOpacity ? : number ; tracking ? : number ; leading ? : number ; maxLines ? : number ; lineWidth ? : number ; canvasRotation ? : number ; lineRotation ? : number ; wrappingMode ? : "None" | "Character" | "Word" ; hAlignment ? : "Left" | "Center" | "Right" ; vAlignment ? : "Above" | "Center" | "Below" ; format see placements ? : string ; } /**
 * Interface that defines a procedural gradient sky.
 */ export interface GradientSky { /** Sky type. */ type : "gradient" ; format topColor : string ; format bottomColor : string ; format groundColor : string ; /** Texture's gradient power. */ monomialPower ? : number ; } /**
 * Interface that defines a cubemap sky.
 */ export interface CubemapSky { /** Sky type. */ type : "cubemap" ; /** Positive X cube map face. */ positiveX : string ; /** Negative X cube map face. */ negativeX : string ; /** Positive Y cube map face. */ positiveY : string ; /** Negative Y cube map face. */ negativeY : string ; /** Positive Z cube map face. */ positiveZ : string ; /** Negative Z cube map face. */ negativeZ : string ; } /**
 * Interface that defines the options to configure the sky.
 */ export type Sky = GradientSky | CubemapSky ; /**
 * Interface that defines the options to configure fog.
 */ export interface Fog { /** Fog's color. */ color : string ; /** Distance ratio to far plane at which the linear fog begins. */ startRatio : number ; } /**
 * Define an image (e.g. icon).
 */ export interface ImageDefinition { /** Url to load content from. */ url : string ; /** `true` to start loading at init tile, `false` to lazily wait until required. */ preload : boolean ; /** Url of JSON file containing the texture atlas */ atlas ? : string ; } export interface ImageDefinitions { /** Name of Image. */ [ name ] : ImageDefinition ; } /**
 * Can be used to create a texture atlas.
 */ export interface ImageTexture { /** Name of ImageTexture. Used to reference texture in the styles. */ name : string ; /** Name of ImageDefinition to use. */ image : string ; /** Origin of image, defaults to "topleft" */ origin ? : string ; /** Specify sub-region: Defaults to 0. */ xOffset ? : number ; /** Specify sub-region: Defaults to 0. */ yOffset ? : number ; /** Specify sub-region:  Defaults to 0, meaning width is taken from loaded image. */ width ? : number ; /** Specify sub-region:  Defaults to 0, meaning height is taken from loaded image. */ height ? : number ; /** Defaults to false. */ flipH ? : boolean ; /** Defaults to false. */ flipV ? : boolean ; /** Defaults to 1. */ opacity ? : number ; } /**
 * Definition for a [[PoiTable]] reference as part of the  Theme object.
  export interface PoiTableRef { /** Required name of the [[PoiTable]] for later reference. */ name : string ; /**
     * Required URL from where to load [[PoiTable]].
     *
     * Should refer to JSON that is matched [[PoiTableDef]] interface.
     */ url : string ; /**
     * If set to `true`, the list of values in the field "altNames" will be used as names for this
     * POI.
     */ useAltNamesForKey : boolean ; } /**
 * Interface for the JSON description of the [[PoiTable]]. It is being implemented in [[PoiTable]].
 */ export interface PoiTableDef { /** Name of the `PoiTable`. Must be unique. */ name ? : string ; /**
     * Stores the list of  PoiTableEntryDef s.
      poiList ? : PoiTableEntryDef [ ] ; } /**
 * Interface descrining POI entries.
 */ export interface PoiTableEntryDef { /** Default name of the POI as the key for looking it up. */ name ? : string ; /** Alternative names of the POI. */ altNames ? : string [ ] ; /** Visibility of the POI. If `false`, the POI will not be rendered. */ visible ? : boolean ; /** Name of the icon, defined in the the texture atlases. */ iconName ? : string ; /** Stacking mode of the POI. For future use. */ stackMode ? : string ; /**
     * Priority of the POI to select the visible set in case there are more POIs than can be
     * handled.
     */ priority ? : number ; /** Minimum zoom level to render the icon on. */ iconMinLevel ? : number ; /** Maximum zoom level to render the icon on. */ iconMaxLevel ? : number ; /** Minimum zoom level to render the text label on. */ textMinLevel ? : number ; /** Maximum zoom level to render the text label on. */ textMaxLevel ? : number ; } /**
 * Fonts used for all text related rendering.
 */ export interface FontCatalogConfig { url : string ; name : string ; }