Skip to content

UI ​

SDK exports types for UI components:

ts
import type {
  ToastView,
  ToastOptions,
  ToastParams,
  SwalView,
  SwalPromptType,
  SwalParams,
  SwalPromptOption,
  SwalPromptParams,
  ModalSize,
  ModalOptions,
  ModalParams,
  SidepanelSize,
  SidepanelOptions,
  SidepanelParams
} from '@flowlu/miniapp-jssdk'

Types ​

ToastView ​

Toast view for the Toast class

ValueDescription
'success'Success notification
'info'Informational notification
'warning'Warning notification
'error'Error notification

ToastOptions ​

Additional display options for the Toast.show() method

PropertyTypeDescription
timeOutnumber | stringAuto-hide timeout in ms. Default is 3000
closeButtonbooleanShow close button. Default is true

ToastParams ​

Constructor parameters for Toast

PropertyTypeDescription
viewToastViewNotification view
titleanyNotification title
messageanyNotification message
optionsToastOptionsAdditional display options for the Toast.show() method
eventsEventCallbacks<ToastEventName>Event handlers

SwalView ​

Dialog view for the Swal class

ValueDescription
'success'Success dialog
'info'Informational dialog
'warning'Warning dialog
'error'Error dialog

SwalPromptType ​

Input field type for the Swal.prompt() method

ValueDescription
'input'Single-line input field
'textarea'Multi-line input field
'select'Dropdown list

SwalParams ​

Constructor parameters for Swal

PropertyTypeDescription
viewSwalViewDialog view
titlestringDialog title
messagestringMessage text
eventsEventCallbacks<SwalEventName>Event handlers

SwalPromptOption ​

List item option for the 'select' type in the Swal.prompt() method

PropertyTypeDescription
valuestring | numberOption value
titlestringDisplayed option text

SwalPromptParams ​

Parameters for the Swal.prompt() method

PropertyTypeDescription
typeSwalPromptTypeInput field type. Default is 'input'
placeholderstringInput field placeholder
optionsSwalPromptOption[]List of options for the 'select' type

ModalSize ​

Modal window size for the Modal class

ValueDescription
'md'Medium size
'lg'Large size

ModalOptions ​

Additional display options for the Modal.show() method

PropertyTypeDescription
widthModalSizeModal window size. Default is 'md'
postbooleanOpen URL via POST. Default is true

ModalParams ​

Constructor parameters for Modal

PropertyTypeDescription
titlestringModal window title
urlstringURL of the page to open
optionsModalOptionsAdditional display options
eventsEventCallbacks<ModalEventName>Event handlers

SidepanelSize ​

Side panel size for the Sidepanel class

ValueDescription
'sm'Small size
'md'Medium size
'lg'Large size

SidepanelOptions ​

Additional display options for the Sidepanel.show() method

PropertyTypeDescription
widthSidepanelSizeSide panel size. Default is 'md'
postbooleanOpen URL via POST. Default is true

SidepanelParams ​

Constructor parameters for Sidepanel

PropertyTypeDescription
titlestringSide panel title
urlstringURL of the page to open
optionsSidepanelOptionsAdditional display options
eventsEventCallbacks<SidepanelEventName>Event handlers

Published under the MIT license.