-
Notifications
You must be signed in to change notification settings - Fork 583
/
types.ts
114 lines (99 loc) · 3.4 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import * as React from "react";
import { Plugin } from "@webiny/plugins/types";
import { ApolloClient } from "apollo-client";
import { Menu, Item, Section } from "./plugins/Menu/Navigation/components";
type RenderParams = {
content: React.ReactNode;
};
export type AdminLayoutComponentPlugin = Plugin & {
type: "admin-layout-component";
render(params: RenderParams): React.ReactNode;
};
export type AdminGlobalSearchPlugin = Plugin & {
type: "admin-global-search";
label: string;
route: string;
search?: {
operator?: "and" | "or";
fields?: Array<string>;
};
};
export type AdminGlobalSearchPreventHotkeyPlugin = Plugin & {
type: "admin-global-search-prevent-hotkey";
preventOpen(e: React.KeyboardEvent): boolean | void;
};
export type AdminMenuLogoPlugin = Plugin & {
name: "admin-menu-logo";
type: "admin-menu-logo";
render(): React.ReactElement;
};
export type AdminHeaderUserMenuPlugin = Plugin & {
type: "admin-header-user-menu";
render(): React.ReactElement;
};
export type AdminHeaderUserMenuHandlePlugin = Plugin & {
name: "admin-header-user-menu-handle";
type: "admin-header-user-menu-handle";
render(): React.ReactElement;
};
export type AdminHeaderUserMenuUserInfoPlugin = Plugin & {
type: "admin-header-user-menu-user-info";
render(): React.ReactElement;
};
/**
* Enables adding custom menu sections and items in the main menu, located on the left side of the screen.
* @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-menu
*/
export type AdminMenuPlugin = Plugin & {
type: "admin-menu";
render(props: {
Menu: typeof Menu;
Section: typeof Section;
Item: typeof Item;
}): React.ReactNode;
order?: number;
};
/**
* Enables adding custom header elements to the left side of the top bar.
* @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-header-left
*/
export type AdminHeaderLeftPlugin = Plugin & {
type: "admin-header-left";
render(params: RenderParams): React.ReactNode;
};
/**
* Enables adding custom header elements to the right side of the top bar.
* @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-header-right
*/
export type AdminHeaderRightPlugin = Plugin & {
type: "admin-header-right";
render(params: RenderParams): React.ReactNode;
};
/**
* Enables adding custom header elements to the middle of the top bar.
* @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-header-middle
*/
export type AdminHeaderMiddlePlugin = Plugin & {
type: "admin-header-middle";
render(params: RenderParams): React.ReactNode;
};
export type AdminMenuSettingsPlugin = Plugin & {
type: "admin-menu-settings";
render(props: { Section: typeof Section; Item: typeof Item }): React.ReactNode;
};
export type AdminFileManagerFileTypePlugin = Plugin & {
type: "admin-file-manager-file-type";
types?: string[];
render({ file }): React.ReactNode;
fileDetails?: {
actions: Array<React.FunctionComponent | React.Component>;
};
};
export type AdminInstallationPlugin = Plugin & {
type: "admin-installation";
isInstalled(params: { client: ApolloClient<object> }): Promise<boolean>;
title: string;
dependencies?: string[];
secure: boolean;
render({ onInstalled }): React.ReactNode;
};