Configures behaviour of watch method

Hierarchy

  • WatchOptions

Properties

anchor?: string

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

Default

undefined

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

Type declaration

    • (anchor): null | HTMLElement
    • 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

      Parameters

      • anchor: HTMLElement

      Returns null | HTMLElement

      Default

      Immediate <form> parent of anchor
      
immediate?: boolean

Whether to immediately invoke bind

Default

true

interval?: number

Set the periodicity of page checks in milliseconds

Default

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

Default

NOOP

onBind?: ((c) => void)

Type declaration

    • (c): void
    • Callback executed when an AddressFinder instance successfully binds

      Parameters

      Returns void

      Default

      NOOP

onBindAttempt?: OnBindAttempt

Callback executed each time bind is attempted

Default

NOOP

onError?: ((error) => void)

Type declaration

    • (error): void
    • Error callback. Executes when API Key check fails. Does not execute if API request succeeds but key is marked as unavailable

      Parameters

      • error: unknown

      Returns void

pageTest?: (() => boolean)

Type declaration

    • (): boolean
    • A function executed on every interval to determine whether binding should take place

      Returns boolean

      Default

      () => true