EasyFM - v5.0.0-beta.1
    Preparing search index...

    Class Field<T>

    A class representing a field in a record.

    Type Parameters

    • T extends FieldValue

      The type of the field value.

    Index

    Constructors

    • Type Parameters

      • T extends FieldValue

        The type of the field value.

      Parameters

      • record: Parentable
      • id: string
      • originalContents: T

      Returns Field<T>

    Properties

    _value: T | null
    id: string
    parent: Parentable
    firstContainerDownload: Promise<any> | null = null

    Accessors

    • get edited(): boolean

      true if this field has changed since it was last loaded or saved.

      Returns boolean

    • get metadata(): {
          autoEnter: boolean;
          displayType: | "calendar"
          | "editText"
          | "popupList"
          | "checkBox"
          | "radioButtons"
          | "selectionList"
          | "secureText";
          fourDigitYear: boolean;
          global: boolean;
          maxCharacters: number;
          maxRepeat: number;
          name: string;
          notEmpty: boolean;
          numeric: boolean;
          repetitionEnd: number;
          repetitionStart: number;
          result: "number"
          | "time"
          | "container"
          | "text"
          | "date"
          | "timeStamp";
          timeOfDay: boolean;
          type: "normal" | "summary" | "calculation";
          valueList?: string;
      }

      Returns the FileMaker metadata for this field.

      Returns {
          autoEnter: boolean;
          displayType:
              | "calendar"
              | "editText"
              | "popupList"
              | "checkBox"
              | "radioButtons"
              | "selectionList"
              | "secureText";
          fourDigitYear: boolean;
          global: boolean;
          maxCharacters: number;
          maxRepeat: number;
          name: string;
          notEmpty: boolean;
          numeric: boolean;
          repetitionEnd: number;
          repetitionStart: number;
          result: "number"
          | "time"
          | "container"
          | "text"
          | "date"
          | "timeStamp";
          timeOfDay: boolean;
          type: "normal" | "summary" | "calculation";
          valueList?: string;
      }

    • get string(): string

      Returns this field value as a string. Throws if the value is not a string.

      Returns string

    Methods

    • Downloads the full container contents into memory.

      Returns Promise<{ data: ArrayBuffer; mime: string }>

    • Sets the value of the field.

      Parameters

      • content: T | null

        The new content value to be set. Can be either the type T or null.

      Returns void

      Cannot set container value using set(). Use upload() instead, if the result is a 'container'.

    • Returns Promise<{ data: Readable; mime: string }>

    • Resets the 'edited' state of this field, without changing its value

      Returns void

    • Uploads a file to the container field.

      Parameters

      • file: File

        The file content as a buffer.

      Returns Promise<void>

      • A promise that resolves when the file is successfully uploaded.
      • Cannot upload a file to the field if it's not a container field.
      • Upload failed with HTTP error.
    • Returns the container download as a Web Response.

      Parameters

      • options: StreamOptions

      Returns Promise<Response>