expose useful libs (#4489)

* expose useful libs
* Update UIPluginApi.md
This commit is contained in:
Raghavan
2024-02-06 05:59:01 +05:30
committed by GitHub
parent de2b28d3f9
commit 892d74c98b
2 changed files with 12 additions and 0 deletions

View File

@@ -12,6 +12,10 @@ An example using various aspects of `PluginApi` may be found in the source code
An instance of the React library.
### `ReactDOM`
An instance of the ReactDOM library.
### `GQL`
This namespace contains the generated graphql client interface. This is a low-level interface. In many cases, `StashService` should be used instead.
@@ -25,6 +29,8 @@ This namespace contains the generated graphql client interface. This is a low-le
- `Intl`
- `FontAwesomeRegular`
- `FontAwesomeSolid`
- `Mousetrap`
- `MousetrapPause`
### `register`

View File

@@ -1,5 +1,8 @@
import React from "react";
import ReactDOM from "react-dom";
import * as ReactRouterDOM from "react-router-dom";
import Mousetrap from "mousetrap";
import MousetrapPause from "mousetrap-pause";
import NavUtils from "./utils/navigation";
import { HoverPopover } from "./components/Shared/HoverPopover";
import { TagLink } from "./components/Shared/TagLink";
@@ -97,6 +100,7 @@ export function RegisterComponent(component: string, fn: Function) {
}
export const PluginApi = {
React,
ReactDOM,
GQL,
libraries: {
ReactRouterDOM,
@@ -105,6 +109,8 @@ export const PluginApi = {
Intl,
FontAwesomeRegular,
FontAwesomeSolid,
Mousetrap,
MousetrapPause,
},
register: {
// register a route to be added to the main router