FieldClassifier interface exported

Last updated: 2026-03-01T23:35:47.796Z

Metrics

LOC: 8 Complexity: 1 Params: 0

Signature

interface FieldClassifier

Summary

FieldClassifier extends the base Detector contract. detect(field) attempts to classify the field and returns null (or a result with type "unknown") to pass control to the next classifier in the pipeline. Optionally, a classifier may implement detectAsync for strategies that require async I/O (e.g. Chrome Language AI). runAsync in DetectionPipeline will prefer detectAsync when present.

Source Code

export interface FieldClassifier extends Detector<
  FormField,
  ClassifierResult | null
> {
  readonly name: DetectionMethod;
  /** Optional async variant — used by DetectionPipeline.runAsync(). */
  detectAsync?(field: FormField): Promise<ClassifierResult | null>;
}

Members

Name Kind Visibility Status Signature
detectAsync method - detectAsync(field: FormField): : Promise<ClassifierResult | null>

No outgoing dependencies.

Impact (Incoming)

graph LR FieldClassifier["FieldClassifier"] FieldProcessingChain["FieldProcessingChain"] getActiveClassifiers["getActiveClassifiers"] createField["createField"] makeField["makeField"] getContextHtml["getContextHtml"] detect["detect"] normalize["normalize"] PretrainedState["PretrainedState"] FieldProcessingChain -->|uses| FieldClassifier getActiveClassifiers -->|uses| FieldClassifier createField -->|uses| FieldClassifier makeField -->|uses| FieldClassifier getContextHtml -->|uses| FieldClassifier detect -->|uses| FieldClassifier detect -->|uses| FieldClassifier normalize -->|uses| FieldClassifier PretrainedState -->|uses| FieldClassifier style FieldClassifier fill:#dbeafe,stroke:#2563eb,stroke-width:2px click FieldClassifier "a9d6eb547441b869.html" click FieldProcessingChain "100ca2148a515e25.html" click getActiveClassifiers "94c3286cfdb569c3.html" click createField "e0ae28ee278495ad.html" click makeField "40cb7e5a6354eaea.html" click getContextHtml "765515d6b3d443b6.html" click detect "4a2f1cf65982398c.html" click normalize "87c87498f93bf3ff.html" click PretrainedState "5cefc72e50bf5399.html"