import type { PrintLayoutTemplate, PrintFileFormat } from "../../rest/support/types.js";

export interface TemplateInfo<ValueType> {
  /** A list of supported layouts. */
  choiceList: ValueType[];
  /** The default layout selected by the print service. */
  defaultValue: ValueType;
}

export interface TemplatesInfo {
  /** Metadata about the available output formats. */
  format: TemplateInfo<PrintFileFormat>;
  /** Metadata about the available page layouts. */
  layout: TemplateInfo<PrintLayoutTemplate>;
}

export type Layout = string;

export type Layouts = "all" | Layout[];

export type Format = string;

export type Formats = "all" | Format[];

export type State = "ready" | "initializing" | "disabled" | "error";

export type CustomTextElement = Record<string, string>;

export type TemplateCustomTextElements = Record<string, CustomTextElement[]>;

export interface MapSurroundInfo {}

export interface LayoutTemplateInfo {
  /** Defines the layout elements. */
  layoutOptions: LayoutTemplateInfoLayoutOptions;
  /** The default page size(s) to be used. */
  pageSize: [
      number,
      number
  ];
  /** The unit type of the page size(s) to be used. */
  pageUnits: string;
}

export interface LayoutTemplateInfoLayoutOptions {
  /** The CustomTextElements in layoutOptions. */
  customTextElements: CustomTextElement[];
  /** Author text in layoutOptions. */
  hasAuthorText: boolean;
  /** Copyright text in layoutOptions. */
  hasCopyrightText: boolean;
  /** Legend in layoutOptions. */
  hasLegend: boolean;
  /** Title text in layoutOptions. */
  hasTitleText: boolean;
  /** The MapSurroundInfos in layoutOptions. */
  mapSurroundInfos: MapSurroundInfo[];
}