Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FlatfileImporter

Hierarchy

  • EventEmitter
    • FlatfileImporter

Index

Constructors

constructor

Properties

$ready

$ready: Promise<any>

Promise that resolves when the handshake is completed between Flatfile.io and the adapter

Static Promise

Promise: PromiseConstructor = Promise

Static prefixed

prefixed: string | boolean

Methods

addListener

  • addListener(event: string | symbol, fn: ListenerFn, context?: any): this
  • Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns this

close

  • close(): void
  • Call close() from the parent window in order to hide the importer. You can do this after handling the import callback so your users don't have to click the confirmation button

    Returns void

displayError

  • displayError(msg: string): void
  • This will display a dialog inside of the importer with an error icon and the message you pass. The user will be able to acknowledge the error and be returned to the import data spreadsheet to ideally fix any issues or attempt submitting again.

    Parameters

    • msg: string

    Returns void

displayLoader

  • displayLoader(): void
  • This will display a progress indicator inside the importer if you anticipate that handling the output of the importer may take some time.

    Returns void

displaySuccess

  • displaySuccess(msg: string): void
  • This will display a dialog inside of the importer with a success icon and the message you pass.

    Parameters

    • msg: string

    Returns void

emit

  • emit(event: string | symbol, ...args: Array<any>): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol
    • Rest ...args: Array<any>

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<string | symbol>

getMeta

  • getMeta(): object
  • This will fetch the data from the importer

    Returns object

listenerCount

  • listenerCount(event: string | symbol): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Array<ListenerFn>
  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

    Returns Array<ListenerFn>

load

  • load(): Promise<Array<Object>>
  • Use load() when you want a promise returned. This is necessary if you want to use async/await for an es6 implementation

    deprecated

    Returns Promise<Array<Object>>

off

  • off(event: string | symbol, fn?: ListenerFn, context?: any, once?: undefined | true | false): this
  • Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: undefined | true | false

    Returns this

on

  • on(event: string | symbol, fn: ListenerFn, context?: any): this
  • Add a listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns this

once

  • once(event: string | symbol, fn: ListenerFn, context?: any): this
  • Add a one-time listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns this

open

  • open(options?: object): void
  • Call open() to activate the importer overlay dialog.

    Parameters

    • Default value options: object = {}

    Returns void

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, fn?: ListenerFn, context?: any, once?: undefined | true | false): this
  • Remove the listeners of a given event.

    Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: undefined | true | false

    Returns this

requestDataFromUser

  • Use requestDataFromUser() when you want a promise returned. This is necessary if you want to use async/await for an es6 implementation

    Parameters

    • Default value options: object = {}

    Returns Promise<FlatfileResults>

setCustomer

Static setMountUrl

  • setMountUrl(url: string): void
  • This will by default always be https://www.flatfile.io/importer/:key unless you are an enterprise customer that is self-hosting the application. In which case, this will be the URL of your enterprise installd Flatfile importer index page

    Parameters

    • url: string

    Returns void

Generated using TypeDoc