Skip to content
Snippets Groups Projects
unit.ts 3.27 KiB
Newer Older
  • Learn to ignore specific revisions
  • export interface Unit {
    
      veronaModuleVersion: string;
    
      pages: UnitPage[];
    }
    
    export interface UnitPage {
    
      [index: string]: string | number | boolean | undefined | UnitPageSection[];
    
      id: string;
    
      sections: UnitPageSection[];
    
      hasMaxWidth: boolean;
      maxWidth: number;
    
    rhenck's avatar
    rhenck committed
      margin: number;
    
      backgroundColor: string;
    
    rhenck's avatar
    rhenck committed
      alwaysVisible: boolean;
    
      alwaysVisiblePagePosition: 'left' | 'right' | 'top' | 'bottom';
    
      alwaysVisibleAspectRatio: number;
    
    }
    
    export interface UnitPageSection {
    
      [index: string]: string | number | boolean | undefined | UnitUIElement[];
    
      elements: UnitUIElement[];
      height: number;
      backgroundColor: string;
    
      dynamicPositioning: boolean;
      gridColumnSizes: string;
    
      gridRowSizes: string;
    
    }
    
    export interface UnitUIElement {
    
    rhenck's avatar
    rhenck committed
      [index: string]: string | number | boolean | string[] | undefined;
    
    rhenck's avatar
    rhenck committed
      type: 'text' | 'button' | 'text-field' | 'text-area' | 'checkbox'
      | 'dropdown' | 'radio' | 'image' | 'audio' | 'video';
    
      id: string;
    
      zIndex: number
    
      width: number;
      height: number;
    
      dynamicPositioning: boolean;
      xPosition: number;
      yPosition: number;
      gridColumnStart: number;
      gridColumnEnd: number;
      gridRowStart: number;
      gridRowEnd: number;
    
      marginLeft: number;
      marginRight: number;
      marginTop: number;
      marginBottom: number;
    
    rhenck's avatar
    rhenck committed
    }
    
    export interface TextUIElement extends UnitUIElement {
    
      fontColor: string;
      font: string;
      fontSize: number;
      bold: boolean;
      italic: boolean;
      underline: boolean;
    }
    
    
    rhenck's avatar
    rhenck committed
    export interface InputUIElement extends UnitUIElement {
    
      label: string;
      value: string | number | boolean | undefined;
    
      requiredWarnMessage: string;
    
    rhenck's avatar
    rhenck committed
    export interface SurfaceUIElement extends UnitUIElement {
    
    rhenck's avatar
    rhenck committed
      backgroundColor: string;
    }
    
    
    export interface TextElement extends SurfaceUIElement {
    
      text: string;
    
      fontColor: string;
      font: string;
      bold: boolean;
      italic: boolean;
      underline: boolean;
    
      highlightable: boolean
    
    rhenck's avatar
    rhenck committed
    export interface ButtonElement extends TextUIElement, SurfaceUIElement {
    
      label: string;
    
      imageSrc?: string;
    
      borderRadius?: number;
    
      action: undefined | 'previous' | 'next' | 'end';
    
    export interface TextFieldElement extends InputUIElement, TextUIElement, SurfaceUIElement {
    
      value: string;
    
      appearance: 'standard' | 'legacy' | 'fill' | 'outline';
    
      minLength: number | undefined;
    
      minLengthWarnMessage: string;
    
      maxLength: number | undefined;
    
      maxLengthWarnMessage: string;
    
      pattern: string;
      patternWarnMessage: string;
    
    export interface TextAreaElement extends InputUIElement, TextUIElement, SurfaceUIElement {
    
      value: string;
    
      appearance: 'standard' | 'legacy' | 'fill' | 'outline';
    
      resizeEnabled: boolean;
    
    export interface CheckboxElement extends InputUIElement, TextUIElement, SurfaceUIElement {
    
      value: boolean;
    
    rhenck's avatar
    rhenck committed
    export interface DropdownElement extends InputUIElement, TextUIElement, SurfaceUIElement {
    
      label: string;
      options: string[];
    
      value: string | undefined;
    
      allowUnset: boolean;
    
    rhenck's avatar
    rhenck committed
    export interface RadioButtonGroupElement extends InputUIElement, TextUIElement, SurfaceUIElement {
    
    rhenck's avatar
    rhenck committed
      label: string;
    
      options: string[];
      alignment: 'row' | 'column';
    
      value: string | undefined;
    
    }
    
    export interface ImageElement extends UnitUIElement {
      src: string;
    }
    
    export interface AudioElement extends UnitUIElement {
      src: string;
    }
    
    export interface VideoElement extends UnitUIElement {
      src: string;
    }