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 '@aspro-cloud/miniapp-jssdk'Types
ToastView
Toast view for the Toast class
| Value | Description |
|---|---|
'success' | Success notification |
'info' | Informational notification |
'warning' | Warning notification |
'error' | Error notification |
ToastOptions
Additional display options for the Toast.show() method
| Property | Type | Description |
|---|---|---|
timeOut | number | string | Auto-hide timeout in ms. Default is 3000 |
closeButton | boolean | Show close button. Default is true |
ToastParams
Constructor parameters for Toast
| Property | Type | Description |
|---|---|---|
view | ToastView | Notification view |
title | any | Notification title |
message | any | Notification message |
options | ToastOptions | Additional display options for the Toast.show() method |
events | EventCallbacks<ToastEventName> | Event handlers |
SwalView
Dialog view for the Swal class
| Value | Description |
|---|---|
'success' | Success dialog |
'info' | Informational dialog |
'warning' | Warning dialog |
'error' | Error dialog |
SwalPromptType
Input field type for the Swal.prompt() method
| Value | Description |
|---|---|
'input' | Single-line input field |
'textarea' | Multi-line input field |
'select' | Dropdown list |
SwalParams
Constructor parameters for Swal
| Property | Type | Description |
|---|---|---|
view | SwalView | Dialog view |
title | string | Dialog title |
message | string | Message text |
events | EventCallbacks<SwalEventName> | Event handlers |
SwalPromptOption
List item option for the 'select' type in the Swal.prompt() method
| Property | Type | Description |
|---|---|---|
value | string | number | Option value |
title | string | Displayed option text |
SwalPromptParams
Parameters for the Swal.prompt() method
| Property | Type | Description |
|---|---|---|
type | SwalPromptType | Input field type. Default is 'input' |
placeholder | string | Input field placeholder |
options | SwalPromptOption[] | List of options for the 'select' type |
ModalSize
Modal window size for the Modal class
| Value | Description |
|---|---|
'md' | Medium size |
'lg' | Large size |
ModalOptions
Additional display options for the Modal.show() method
| Property | Type | Description |
|---|---|---|
width | ModalSize | Modal window size. Default is 'md' |
post | boolean | Open URL via POST. Default is true |
ModalParams
Constructor parameters for Modal
| Property | Type | Description |
|---|---|---|
title | string | Modal window title |
url | string | URL of the page to open |
options | ModalOptions | Additional display options |
events | EventCallbacks<ModalEventName> | Event handlers |
SidepanelSize
Side panel size for the Sidepanel class
| Value | Description |
|---|---|
'sm' | Small size |
'md' | Medium size |
'lg' | Large size |
SidepanelOptions
Additional display options for the Sidepanel.show() method
| Property | Type | Description |
|---|---|---|
width | SidepanelSize | Side panel size. Default is 'md' |
post | boolean | Open URL via POST. Default is true |
SidepanelParams
Constructor parameters for Sidepanel
| Property | Type | Description |
|---|---|---|
title | string | Side panel title |
url | string | URL of the page to open |
options | SidepanelOptions | Additional display options |
events | EventCallbacks<SidepanelEventName> | Event handlers |