Detector interface exported

Last updated: 2026-02-24T19:46:21.769Z

Metrics

LOC: 7 Complexity: 1 Params: 0

Signature

interface Detector

Summary

Detector Interface Base contract shared by every detector in this module. TInput — what the detector receives as input. Use void for page-level scanners that operate on the global document. TResult — what the detector returns. All detectors expose the same two members: name — unique, human-readable identifier (used for logging and pipeline ordering) detect — the detection function Examples of concrete implementations: htmlTypeDetector : Detector<HTMLElement, BasicTypeResult> labelDetector : Detector<HTMLElement, LabelResult | undefined> signalsBuilder : Detector<Partial, string> selectorBuilder : Detector<Element, string> FieldClassifier : Detector<FormField, ClassifierResult | null> (sub-interface) interactiveFieldDetector : Detector<void, InteractiveField[]> customSelectDetector : Detector<void, CustomSelectField[]>

Source Code

export interface Detector<TInput, TResult> {
  /** Unique identifier for this detector. */
  readonly name: string;

  /** Run the detection logic and return the result. */
  detect(input: TInput): TResult;
}

Members

Name Kind Visibility Status Signature
detect method - detect(input: TInput): : TResult

No outgoing dependencies.

Impact (Incoming)

graph LR Detector["Detector"] BasicTypeResult["BasicTypeResult"] ClassifierResult["ClassifierResult"] BasicTypeResult -->|uses| Detector ClassifierResult -->|uses| Detector style Detector fill:#dbeafe,stroke:#2563eb,stroke-width:2px click Detector "d3d41ff4d1c344de.html" click BasicTypeResult "b356128577d744c8.html" click ClassifierResult "8df4f2837098044e.html"
SourceType
BasicTypeResult uses
ClassifierResult uses