import { ITableMessage, IMessagesForCell, IColumnHook, IColumnHookInput, IColumnHookOutput, IRowHook, IRowHookInput, IRowHookOutput, IDeveloperField, IDeveloperSettings, IDeveloperStyleOverrides, IUser, IValidatorField, IRowHookOutputInternal, IResultMetadata, IReviewStepData, IStepHook, IUploadStepData, IRowDeleteHook, IBulkRowHook, IBeforeFinishCallback, IBeforeFinishOutput, IPositionSpec, IConnectionMethods, ISelectField, IImporterOptions, IAllHooks, IRowToAdd, IParseFileCallback, ICustomStepConfig, ICustomStepConnectionMethods, CustomStepInsertAfter, IUserEvent, IButtonClickPayload, IUserEventPayloadMap } from "./interfaces"; declare global { interface Window { DROMO_WIDGET_OVERRIDE?: string; } } export default class DromoUploader { constructor(licenseKey: string, fields: IDeveloperField[], settings: IDeveloperSettings, user: IUser); constructor(licenseKey: string, schemaId: string); initChild: () => Promise; addIFrameToWrapper: () => void; showIframe: () => void; showWrapper: () => void; /** * Function called by the developer to set a callback * * @param fieldName the key of the column for which we want to trigger the * callback * @param callback developer defined callback that is callback that is added * to a list of column hooks */ registerColumnHook: (fieldName: IColumnHook["fieldName"], callback: IColumnHook["callback"]) => void; /** * Function called by the developer to set a callback * * @param callback developer defined callback that is added to a list of row * hooks */ registerBulkRowHook: (bulkRowHook: IBulkRowHook) => void; /** * Function called by the developer to set a callback * * @param callback developer defined callback that is added to a list of row * hooks */ registerRowHook: (callback: IRowHook) => void; /** * Function called by the developer to set a callback * * @param callback developer defined callback that is called per step of the * import flow */ registerStepHook: (type: IStepHook["type"], callback: IStepHook["callback"]) => void; /** * Register a custom step to be injected into the Dromo import flow. * * @param step - Custom step configuration. Provide a `url` to have Dromo * render an iframe at that URL inside the standard modal chrome. The iframe * page drives navigation by posting `{ type: "DROMO_NEXT" }` or * `{ type: "DROMO_BACK" }` to `window.parent`, and can send arbitrary data * via `{ type: "DROMO_MESSAGE", payload: any }` which is forwarded to the * `onMessage` callback with the uploader instance. */ registerCustomStep: (step: ICustomStepConfig) => void; /** * Function called by the developer to set a row delete callback * * @param callback developer defined callback that is called per step of the * import flow */ registerRowDeleteHook: (callback: IRowDeleteHook) => void; /** * Function called by the developer to set the beforeFinish callback * * @param callback developer defined callback that is called when the user submits */ beforeFinish: (callback: IBeforeFinishCallback) => void; /** * Function called by the developer to set a custom file parser * * @param fileParser array of file extensions and parseFile callback */ registerFileParser: (fileParser: { extensions: string[]; parseFile: IParseFileCallback; }) => void; /** * Convenience function for setting all hooks at once. * * @param hooks object containing all hooks to register */ registerAllHooks: (hooks: IAllHooks) => void; /** * Function called by the developer to set a callback * * @param callback developer defined callback that is called when the import * flow completes */ onResults: (callback: (data: Record[], metadata: IResultMetadata) => Promise | void) => void; /** * Function called by the developer to set a callback * * @param callback developer defined callback that is called when the user * cancels the import */ onCancel: (callback: () => void) => void; onUserEvent: (callback: (event: IUserEvent) => void) => void; /** * Function called by the developer to set or reset the user information */ setUser: (user: IUser) => Promise; /** * Function called by the developer to add a field midway through the import * process */ addField: (field: IDeveloperField, position?: IPositionSpec) => Promise; /** * Function called by the developer to remove a field. The data won't appear * in the user interface nor in the result data. */ removeField: (fieldKey: string) => Promise; /** * Function called by the developer to add new table messages throughout the * import process */ updateInfoMessages: (messages: IMessagesForCell[]) => Promise; /** * Function called by the developer to change the matchingStep.headerRowOverride * setting from a step hook */ setHeaderRowOverride: (headerRowOverride: number | null) => Promise; /** * Function called by the developer to change the message displayed when the * user clicks 'Finish' on the review screen. Can optionally also override * the button text. */ setConfirmationMessage: (messageHTML: string, options?: { submitButtonText?: string; cancelButtonText?: string; }) => Promise; /** * Function called by developer called to open the iframe */ open: () => Promise; initInline: (wrapperIdOrElement: string | HTMLElement) => Promise; /** * Function called by the developer to add rows during the import */ addRows: (rows: IRowToAdd[]) => Promise; /** * Function called by the developer to remove rows */ removeRows: (rowIds: string[]) => Promise; /** * Function called by developer to close the iframe */ close: () => void; /** * Function called by the developer to set developmentMode */ setDevelopmentMode: (developmentMode: boolean) => Promise; } export { ITableMessage, IMessagesForCell, IColumnHook, IColumnHookInput, IColumnHookOutput, IRowHook, IRowHookInput, IRowHookOutput, IDeveloperField, IDeveloperSettings, IDeveloperStyleOverrides, IUser, IValidatorField, IRowHookOutputInternal, IResultMetadata, IReviewStepData, IStepHook, IUploadStepData, IRowDeleteHook, IBulkRowHook, IBeforeFinishCallback, IBeforeFinishOutput, IPositionSpec, IConnectionMethods, ISelectField, IImporterOptions, IAllHooks, IParseFileCallback, ICustomStepConfig, ICustomStepConnectionMethods, CustomStepInsertAfter, IUserEvent, IButtonClickPayload, IUserEventPayloadMap, };