Overview

This list is always up to date and has the latest methods, If you are missing any method checkout the Deprecations page to see the replacement for it.

The Plugin-API contains more methods than the listed ones below, you can check them out by logging the Plugin object to console, these un-listed methods are deprecated and we don't recommend using them

Here is a list of what can you get from Plugin-API object:

// import DashboardPlugin from 'Dashboard/plugin'
// cosnt Plugin = new DashboardPlugin('@plugin_bundle')

import { Plugin } from '@root'

Plugin === {
    React, // instance of react
    Component, // instance of react Component
    
    GUI, // A GUI lib components
    ViewUtil, // A ViewUtil GUI lib components
    
    CopyToClipboard,  // instance of 'react-copy-to-clipboard'
    
    Modal, // Modal base component
    Agent, // Agent base component
    Health, // Health base component
    Widget, // Widget base component
    Settings, // Settings base component
    Portal, // Portal base component
    Application, // Application base component
    PopoutComponent, // Popout base component
    
    Popout, // Component to popout the rendered children to a new browser window
    Sheet, // Component to render animated sheet-layout
    Standalone, // Helper class contains methods to work with Standalone Dashboard
    
    moment, // instance of moment.js
    MODALSIZE, // Object contains modal sizes to be set in Modal component
    
    createUUID, // a helper function will return a random UUID v4
    getLanguage, // a helper function will return the current Dashboard locale that the user set the Dashboard language to
    getTextDirection, // a helper function will return css rule for the passed value depending on the language of the text
    getTimeFormat, // a helper function will return '24h' || '12h' dependent on the current user settings
    getKeyCharFromCode, // a helper function will return the char value of the keyCode
    getKeyCodeFromChar, // a helper function will return the keyCode value of the key char
    event, // a function to create events dispatcher
    
    Logger, // a helper logger to print output to the console.
    
    buildRouteUrlWithDispatchableEvent, // **experimental** a helper function to build a routed Dashboard url with a dispatcher event
    
    getUser, // a function will returns user object.
    getAction, // a helper function to return the registerd action in Dashboard
    getPortal, // a helper function to return the registerd portal in Dashboard
    getConfig, // a function will returns plugin's config object.
    getLocalize, // a helper function  will return the plugin localization object
    getAvailableActions, // a helper function to return all the available registerd actions in Dashboard
    getAvailablePortals, // a helper function to return all the available registerd portals in Dashboard
    
    cache, // a helper instance to store/load data to/from locale storage
    store, // a helper instance to store/load data to/from persistent storage
    
    encrypt, // a helper function to encrypt a custom payload
    decrypt, // a helper function to decrypt an encrypted data with encrypt method
    
    request, // a helper function to do a proxy requests 
    
    setHealth, // a helper function to set the health status for a plugin that register Health component
    
    openModal, // a helper function to open modals in Dashboard
    closeModal, // a helper function to close modals in Dashboard
    
    confirmOnLeave, // a helper function to display a confim on leaving application.
    
    confirm: { // add/remove confirm notifications
        add,
        remove
    },
    
    notifications: { // add/remove notifications
        add,
        remove
    },
    
    withUser, // a HOC will pass user object to the composed component as a prop
    
    useModal, // a hook will returns modal component context-api
    useSheet, // a hook will returns sheet component  context-api
    useUser, // a hook will returns user object
    useConfig, // a hook will returns the plugin config
    useLocalize, // a hook will returns the plugin localization object
    useMappings, // a hook will returns the plugin mappings config
    useApplication, // a hook will returns the application context
    
    hasPermission, // a function to check for loggedIn permissions.
    
    register // a method to register plugin in Dashboard
}

Last updated