FormField interface exported

Last updated: 2026-03-05T10:53:28.867Z

Metrics

LOC: 60 Complexity: 1 Params: 0

Signature

interface FormField

Summary

Represents a detected form field on the page

Source Code

export interface FormField {
  element:
    | HTMLInputElement
    | HTMLSelectElement
    | HTMLTextAreaElement
    | HTMLElement;
  selector: string;

  // Final result
  category: FieldCategory;
  fieldType: FieldType;
  contextualType?: FieldType;

  // Custom component adapter
  /** Name of the adapter that detected this field (undefined for native elements). */
  adapterName?: string;

  // Raw DOM metadata
  label?: string;
  name?: string;
  id?: string;
  placeholder?: string;
  autocomplete?: string;
  inputType?: string;
  required: boolean;
  pattern?: string;
  maxLength?: number;
  minLength?: number;
  options?: Array<{ value: string; text: string }>; // for selects
  checkboxValue?: string; // for checkboxes/radios
  checkboxChecked?: boolean; // for checkboxes/radios

  // Interactive widgets
  isInteractive?: boolean;
  interactiveType?: InteractiveFieldType;

  // Structured signals
  signals?: FieldSignals;

  languageDetected?: "pt" | "en" | "es" | "unknown";

  /** Which method produced fieldType */
  detectionMethod?: DetectionMethod;
  /** Confidence score 0–1 from TF.js or AI (1.0 for keyword/html-type) */
  detectionConfidence?: number;
  /** Normalised signals string used for classification (name+id+label+placeholder) */
  contextSignals?: string;

  /** Time taken by the detection pipeline for this field (ms) */
  detectionDurationMs?: number;
  timings?: Array<{
    strategy: string;
    durationMs: number;
  }>;
  predictions?: Array<{
    type: FieldType;
    confidence: number;
  }>;
  decisionTrace?: string[];
}

No outgoing dependencies.

Impact (Incoming)

graph LR FormField["FormField"] FillableElement["FillableElement"] isAvailableViaProxy["isAvailableViaProxy"] getLanguageModelApi["getLanguageModelApi"] generateWithTensorFlow["generateWithTensorFlow"] buildKeywordsFromDictionary["buildKeywordsFromDictionary"] resolveActionType["resolveActionType"] handleRuleButtonClick["handleRuleButtonClick"] isFillableField["isFillableField"] initFieldIcon["initFieldIcon"] detectFormFields["detectFormFields"] setNativeValue["setNativeValue"] ProgressNotification["ProgressNotification"] generateDateForField["generateDateForField"] StructuredSignals["StructuredSignals"] makeSendMessage["makeSendMessage"] buildField["buildField"] makeField["makeField"] makeInput["makeInput"] getAdapterMap["getAdapterMap"] AdapterName["AdapterName"] FieldProcessingChain["FieldProcessingChain"] buildSignals["buildSignals"] getActiveClassifiers["getActiveClassifiers"] NativeElement["NativeElement"] ClassifierResult["ClassifierResult"] createField["createField"] makeAdapter["makeAdapter"] matches["matches"] classifierNames["classifierNames"] getContextHtml["getContextHtml"] normalize["normalize"] PretrainedState["PretrainedState"] resetModelMock["resetModelMock"] FillableElement -->|uses| FormField isAvailableViaProxy -->|uses| FormField getLanguageModelApi -->|uses| FormField generateWithTensorFlow -->|uses| FormField buildKeywordsFromDictionary -->|uses| FormField resolveActionType -->|uses| FormField handleRuleButtonClick -->|uses| FormField isFillableField -->|uses| FormField initFieldIcon -->|uses| FormField detectFormFields -->|uses| FormField setNativeValue -->|uses| FormField ProgressNotification -->|uses| FormField generateDateForField -->|uses| FormField StructuredSignals -->|uses| FormField makeSendMessage -->|uses| FormField buildField -->|uses| FormField makeField -->|uses| FormField makeField -->|uses| FormField makeField -->|uses| FormField makeInput -->|uses| FormField makeField -->|uses| FormField getAdapterMap -->|uses| FormField AdapterName -->|uses| FormField FieldProcessingChain -->|uses| FormField buildSignals -->|uses| FormField getActiveClassifiers -->|uses| FormField NativeElement -->|uses| FormField ClassifierResult -->|uses| FormField createField -->|uses| FormField makeAdapter -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField matches -->|uses| FormField createField -->|uses| FormField matches -->|uses| FormField classifierNames -->|uses| FormField makeField -->|uses| FormField getContextHtml -->|uses| FormField normalize -->|uses| FormField PretrainedState -->|uses| FormField makeField -->|uses| FormField makeField -->|uses| FormField resetModelMock -->|uses| FormField style FormField fill:#dbeafe,stroke:#2563eb,stroke-width:2px click FormField "85cdbded927c91b0.html" click FillableElement "2ecf5aaac3f668a8.html" click isAvailableViaProxy "50fafb201d8fc13e.html" click getLanguageModelApi "a1b8e74a0381b891.html" click generateWithTensorFlow "49e69a4b304badea.html" click buildKeywordsFromDictionary "dfb7d9bfef2aba38.html" click resolveActionType "9f60cb4a9139571d.html" click handleRuleButtonClick "302ac6e6209ebb8e.html" click isFillableField "a14a36f7857211ba.html" click initFieldIcon "fcc910dd0c6d49b0.html" click detectFormFields "f533b30bd49ac06c.html" click setNativeValue "334bd99609d7c37c.html" click ProgressNotification "945c3ad3e492ce5e.html" click generateDateForField "a214011e5ced5989.html" click StructuredSignals "1cdbeb8df086b53c.html" click makeSendMessage "93db8b24f480f034.html" click buildField "eaacc5a9fff2497b.html" click makeField "ae72134e0e8cd3e2.html" click makeInput "3b463c3c3297bb7c.html" click getAdapterMap "9972c116451a41d5.html" click AdapterName "0d92b308ac346887.html" click FieldProcessingChain "100ca2148a515e25.html" click buildSignals "fdbba0db0d498eca.html" click getActiveClassifiers "94c3286cfdb569c3.html" click NativeElement "8fb34e112c670c35.html" click ClassifierResult "8df4f2837098044e.html" click createField "13879e2aa13736be.html" click makeAdapter "7cbe03be6bdb4b2d.html" click matches "19835198bf6ff31b.html" click classifierNames "a00f1b67db4c0c6d.html" click getContextHtml "765515d6b3d443b6.html" click normalize "87c87498f93bf3ff.html" click PretrainedState "5cefc72e50bf5399.html" click resetModelMock "4ef72c19f1c89871.html"