@ideal-postcodes/address-finder
    Preparing search index...

    Interface WatchOptions

    Configures behaviour of watch method

    interface WatchOptions {
        anchor?: string;
        getScope?: (anchor: HTMLElement) => HTMLElement | null;
        immediate?: boolean;
        interval?: number;
        marker?: string;
        onAnchorFound?: OnAnchorFound;
        onBind?: (c: Controller) => void;
        onBindAttempt?: OnBindAttempt;
        onError?: (error: unknown) => void;
        pageTest?: () => boolean;
    }
    Index

    Properties

    anchor?: string

    Custom anchor. Set this if you do not wish to anchor the watch method using inputField or outputFields.line_1

    undefined

    getScope?: (anchor: HTMLElement) => HTMLElement | null

    Sets the scope in which the AddressFinder can operate. Set to null to mark the whole page as in scope

    A function which provides the anchor as the first argument. The operable scope must be returned. By default the parent <form> element is returned

    Immediate <form> parent of anchor
    
    immediate?: boolean

    Whether to immediately invoke bind

    true

    interval?: number

    Set the periodicity of page checks in milliseconds

    1000

    marker?: string

    Configure marker for solution is attached to specific context/anchor in DOM

    onAnchorFound?: OnAnchorFound

    Callback executed when anchor and its scope is detected

    NOOP

    onBind?: (c: Controller) => void

    Callback executed when an AddressFinder instance successfully binds

    NOOP

    onBindAttempt?: OnBindAttempt

    Callback executed each time bind is attempted

    NOOP

    onError?: (error: unknown) => void

    Error callback. Executes when API Key check fails. Does not execute if API request succeeds but key is marked as unavailable

    pageTest?: () => boolean

    A function executed on every interval to determine whether binding should take place

    () => true