@omniviewdev/runtime 0.0.0-nightly.20260225
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/dist/Client-DGdSmmVk.js +585 -0
- package/dist/Client-ES-O5dCV.cjs +1 -0
- package/dist/api.cjs +1 -0
- package/dist/api.d.ts +13 -0
- package/dist/api.js +120 -0
- package/dist/context/drawer/BottomDrawerContext.d.ts +20 -0
- package/dist/context/drawer/RightDrawerContext.d.ts +15 -0
- package/dist/context/drawer/index.d.ts +3 -0
- package/dist/context/drawer/types.d.ts +222 -0
- package/dist/context/index.d.ts +5 -0
- package/dist/context/modal/ConfirmationModalContext.d.ts +12 -0
- package/dist/context/modal/index.d.ts +1 -0
- package/dist/context/operations/OperationsContext.d.ts +27 -0
- package/dist/context/plugins/PluginContext.d.ts +9 -0
- package/dist/context/plugins/PluginContextProvider.d.ts +5 -0
- package/dist/context/plugins/index.d.ts +3 -0
- package/dist/context/plugins/usePluginContext.d.ts +3 -0
- package/dist/context/settings/SettingsContext.d.ts +9 -0
- package/dist/context/settings/index.d.ts +1 -0
- package/dist/errors/index.d.ts +3 -0
- package/dist/errors/parseAppError.d.ts +51 -0
- package/dist/errors/parseAppError.test.d.ts +1 -0
- package/dist/errors/types.d.ts +40 -0
- package/dist/extensions/index.d.ts +2 -0
- package/dist/extensions/points/resource/helpers.d.ts +19 -0
- package/dist/extensions/points/resource/types.d.ts +6 -0
- package/dist/extensions/provider.d.ts +18 -0
- package/dist/extensions/registry.d.ts +30 -0
- package/dist/extensions/utils.d.ts +4 -0
- package/dist/hooks/connection/index.d.ts +4 -0
- package/dist/hooks/connection/useConnection.d.ts +37 -0
- package/dist/hooks/connection/useConnectionNamespaces.d.ts +20 -0
- package/dist/hooks/connection/useConnectionStatus.d.ts +29 -0
- package/dist/hooks/connection/useConnections.d.ts +18 -0
- package/dist/hooks/data/index.d.ts +1 -0
- package/dist/hooks/data/usePluginData.d.ts +11 -0
- package/dist/hooks/drawer/index.d.ts +2 -0
- package/dist/hooks/drawer/useBottomDrawer.d.ts +1 -0
- package/dist/hooks/drawer/useRightDrawer.d.ts +5 -0
- package/dist/hooks/exec/index.d.ts +1 -0
- package/dist/hooks/exec/useExecSession.d.ts +21 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/logs/index.d.ts +1 -0
- package/dist/hooks/logs/useLogSession.d.ts +21 -0
- package/dist/hooks/metric/index.d.ts +3 -0
- package/dist/hooks/metric/useMetricProviders.d.ts +9 -0
- package/dist/hooks/metric/useMetricStream.d.ts +40 -0
- package/dist/hooks/metric/useResourceMetrics.d.ts +46 -0
- package/dist/hooks/modal/index.d.ts +1 -0
- package/dist/hooks/modal/useConfirmationModal.d.ts +5 -0
- package/dist/hooks/networker/index.d.ts +3 -0
- package/dist/hooks/networker/types.d.ts +50 -0
- package/dist/hooks/networker/usePortForwardSessions.d.ts +13 -0
- package/dist/hooks/networker/useResourcePortForwarder.d.ts +21 -0
- package/dist/hooks/operations/useOperations.d.ts +1 -0
- package/dist/hooks/resource/index.d.ts +13 -0
- package/dist/hooks/resource/useActiveSyncs.d.ts +16 -0
- package/dist/hooks/resource/useEditorSchemas.d.ts +22 -0
- package/dist/hooks/resource/useInformerState.d.ts +24 -0
- package/dist/hooks/resource/useResource.d.ts +74 -0
- package/dist/hooks/resource/useResourceActions.d.ts +69 -0
- package/dist/hooks/resource/useResourceAreaComponent.d.ts +9 -0
- package/dist/hooks/resource/useResourceGroups.d.ts +22 -0
- package/dist/hooks/resource/useResourceMutations.d.ts +58 -0
- package/dist/hooks/resource/useResourceSearch.d.ts +36 -0
- package/dist/hooks/resource/useResourceType.d.ts +22 -0
- package/dist/hooks/resource/useResourceTypes.d.ts +22 -0
- package/dist/hooks/resource/useResources.d.ts +73 -0
- package/dist/hooks/resource/useStreamAction.d.ts +21 -0
- package/dist/hooks/settings/index.d.ts +1 -0
- package/dist/hooks/settings/useSettings.d.ts +2 -0
- package/dist/hooks/snackbar/index.d.ts +1 -0
- package/dist/hooks/snackbar/useSnackbar.d.ts +24 -0
- package/dist/hooks/useResolvedPluginId.d.ts +8 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2593 -0
- package/dist/models.cjs +1 -0
- package/dist/models.d.ts +1 -0
- package/dist/models.js +1915 -0
- package/dist/router/Link.d.ts +24 -0
- package/dist/router/index.d.ts +11 -0
- package/dist/router/usePluginRouter.d.ts +40 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +215 -0
- package/dist/types/app.d.ts +73 -0
- package/dist/types/extensions.d.ts +186 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/informer.d.ts +49 -0
- package/dist/types/plugin.d.ts +5 -0
- package/dist/utils/activeSyncAggregator.d.ts +29 -0
- package/dist/utils/activeSyncAggregator.test.d.ts +1 -0
- package/dist/wailsjs/go/data/Client.d.ts +10 -0
- package/dist/wailsjs/go/devserver/DevServerManager.d.ts +22 -0
- package/dist/wailsjs/go/diagnostics/DiagnosticsClient.d.ts +18 -0
- package/dist/wailsjs/go/exec/Client.d.ts +26 -0
- package/dist/wailsjs/go/logs/Client.d.ts +16 -0
- package/dist/wailsjs/go/main/App.d.ts +8 -0
- package/dist/wailsjs/go/metric/Client.d.ts +12 -0
- package/dist/wailsjs/go/models.d.ts +894 -0
- package/dist/wailsjs/go/networker/Client.d.ts +14 -0
- package/dist/wailsjs/go/plugin/pluginManager.d.ts +52 -0
- package/dist/wailsjs/go/resource/Client.d.ts +68 -0
- package/dist/wailsjs/go/settings/Client.d.ts +14 -0
- package/dist/wailsjs/go/settings/provider.d.ts +46 -0
- package/dist/wailsjs/go/ui/Client.d.ts +6 -0
- package/dist/wailsjs/go/utils/Client.d.ts +2 -0
- package/dist/wailsjs/runtime/runtime.d.ts +249 -0
- package/package.json +68 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LinkProps as OriginalLinkProps } from 'react-router-dom';
|
|
3
|
+
type LinkProps = {
|
|
4
|
+
/** The path to link to */
|
|
5
|
+
to: string;
|
|
6
|
+
/** Navigate within the current context */
|
|
7
|
+
withinContext?: boolean;
|
|
8
|
+
} & Omit<OriginalLinkProps, 'to'>;
|
|
9
|
+
/**
|
|
10
|
+
* Renders a history-aware link to a route. If `withinContext` is true, the link is resolved
|
|
11
|
+
* within the current context, appending the link to the current plugin and contextID path.
|
|
12
|
+
* Otherwise, it navigates to the specified `to` path.
|
|
13
|
+
*
|
|
14
|
+
* If `withinContext` is true and the current contextID is not available, the link will be
|
|
15
|
+
* resolved as if `withinContext` was false.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import { Link } from '@omniviewdev/runtime/router';
|
|
19
|
+
*
|
|
20
|
+
* <Link to="/servers" withinContext>Go to Servers</Link>
|
|
21
|
+
* <Link to="/dashboard">Go to Dashboard</Link>
|
|
22
|
+
*/
|
|
23
|
+
declare const Link: React.FC<LinkProps>;
|
|
24
|
+
export default Link;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as Link } from './Link';
|
|
2
|
+
import { default as usePluginRouter } from './usePluginRouter';
|
|
3
|
+
export { Link, usePluginRouter };
|
|
4
|
+
declare const _default: {
|
|
5
|
+
Link: import('react').FC<{
|
|
6
|
+
to: string;
|
|
7
|
+
withinContext?: boolean;
|
|
8
|
+
} & Omit<import('react-router-dom').LinkProps, "to">>;
|
|
9
|
+
usePluginRouter: typeof usePluginRouter;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for customizing navigation behavior
|
|
3
|
+
*/
|
|
4
|
+
type PluginNavigateOptions = {
|
|
5
|
+
/** Replace the current entry in the history stack */
|
|
6
|
+
replace?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Programatically route within a plugin.
|
|
10
|
+
*
|
|
11
|
+
* Navigation behavior:
|
|
12
|
+
* - Absolute paths (starting with `/`) are resolved relative to the plugin root.
|
|
13
|
+
* e.g. `navigate('/cluster/abc')` → `/_plugin/{pluginId}/cluster/abc`
|
|
14
|
+
* - Relative paths (no leading `/`) use react-router's native relative resolution,
|
|
15
|
+
* navigating relative to the current matched route.
|
|
16
|
+
* e.g. `navigate('metrics')` → sibling route `metrics`
|
|
17
|
+
* e.g. `navigate('.')` → current route (index)
|
|
18
|
+
* e.g. `navigate('..')` → parent route
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```
|
|
22
|
+
* import { usePluginRouter } from '@omniviewdev/runtime';
|
|
23
|
+
*
|
|
24
|
+
* export const MyComponent = () => {
|
|
25
|
+
* const { navigate, pluginPath } = usePluginRouter();
|
|
26
|
+
*
|
|
27
|
+
* // Absolute plugin-relative navigation
|
|
28
|
+
* navigate('/cluster/abc/resources');
|
|
29
|
+
*
|
|
30
|
+
* // Relative navigation (to sibling route)
|
|
31
|
+
* navigate('metrics');
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare function usePluginRouter(): {
|
|
36
|
+
location: import('react-router-dom').Location<any>;
|
|
37
|
+
navigate: (path: string, opts?: PluginNavigateOptions) => void;
|
|
38
|
+
pluginPath: string;
|
|
39
|
+
};
|
|
40
|
+
export default usePluginRouter;
|
package/dist/runtime.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function w(n){window.runtime.LogPrint(n)}function d(n){window.runtime.LogTrace(n)}function r(n){window.runtime.LogDebug(n)}function u(n){window.runtime.LogInfo(n)}function m(n){window.runtime.LogWarning(n)}function l(n){window.runtime.LogError(n)}function s(n){window.runtime.LogFatal(n)}function o(n,i,e){return window.runtime.EventsOnMultiple(n,i,e)}function W(n,i){return o(n,i,-1)}function f(n,...i){return window.runtime.EventsOff(n,...i)}function c(){return window.runtime.EventsOffAll()}function a(n,i){return o(n,i,1)}function S(n){let i=[n].slice.call(arguments);return window.runtime.EventsEmit.apply(null,i)}function g(){window.runtime.WindowReload()}function p(){window.runtime.WindowReloadApp()}function O(n){window.runtime.WindowSetAlwaysOnTop(n)}function T(){window.runtime.WindowSetSystemDefaultTheme()}function L(){window.runtime.WindowSetLightTheme()}function v(){window.runtime.WindowSetDarkTheme()}function E(){window.runtime.WindowCenter()}function M(n){window.runtime.WindowSetTitle(n)}function h(){window.runtime.WindowFullscreen()}function x(){window.runtime.WindowUnfullscreen()}function F(){return window.runtime.WindowIsFullscreen()}function P(){return window.runtime.WindowGetSize()}function C(n,i){window.runtime.WindowSetSize(n,i)}function D(n,i){window.runtime.WindowSetMaxSize(n,i)}function I(n,i){window.runtime.WindowSetMinSize(n,i)}function R(n,i){window.runtime.WindowSetPosition(n,i)}function z(){return window.runtime.WindowGetPosition()}function A(){window.runtime.WindowHide()}function G(){window.runtime.WindowShow()}function U(){window.runtime.WindowMaximise()}function b(){window.runtime.WindowToggleMaximise()}function y(){window.runtime.WindowUnmaximise()}function k(){return window.runtime.WindowIsMaximised()}function B(){window.runtime.WindowMinimise()}function H(){window.runtime.WindowUnminimise()}function N(n,i,e,t){window.runtime.WindowSetBackgroundColour(n,i,e,t)}function Q(){return window.runtime.ScreenGetAll()}function j(){return window.runtime.WindowIsMinimised()}function q(){return window.runtime.WindowIsNormal()}function J(n){window.runtime.BrowserOpenURL(n)}function K(){return window.runtime.Environment()}function V(){window.runtime.Quit()}function X(){window.runtime.Hide()}function Y(){window.runtime.Show()}function Z(){return window.runtime.ClipboardGetText()}function _(n){return window.runtime.ClipboardSetText(n)}function $(n,i){return window.runtime.OnFileDrop(n,i)}function nn(){return window.runtime.OnFileDropOff()}function en(){return window.runtime.CanResolveFilePaths()}function on(n){return window.runtime.ResolveFilePaths(n)}exports.BrowserOpenURL=J;exports.CanResolveFilePaths=en;exports.ClipboardGetText=Z;exports.ClipboardSetText=_;exports.Environment=K;exports.EventsEmit=S;exports.EventsOff=f;exports.EventsOffAll=c;exports.EventsOn=W;exports.EventsOnMultiple=o;exports.EventsOnce=a;exports.Hide=X;exports.LogDebug=r;exports.LogError=l;exports.LogFatal=s;exports.LogInfo=u;exports.LogPrint=w;exports.LogTrace=d;exports.LogWarning=m;exports.OnFileDrop=$;exports.OnFileDropOff=nn;exports.Quit=V;exports.ResolveFilePaths=on;exports.ScreenGetAll=Q;exports.Show=Y;exports.WindowCenter=E;exports.WindowFullscreen=h;exports.WindowGetPosition=z;exports.WindowGetSize=P;exports.WindowHide=A;exports.WindowIsFullscreen=F;exports.WindowIsMaximised=k;exports.WindowIsMinimised=j;exports.WindowIsNormal=q;exports.WindowMaximise=U;exports.WindowMinimise=B;exports.WindowReload=g;exports.WindowReloadApp=p;exports.WindowSetAlwaysOnTop=O;exports.WindowSetBackgroundColour=N;exports.WindowSetDarkTheme=v;exports.WindowSetLightTheme=L;exports.WindowSetMaxSize=D;exports.WindowSetMinSize=I;exports.WindowSetPosition=R;exports.WindowSetSize=C;exports.WindowSetSystemDefaultTheme=T;exports.WindowSetTitle=M;exports.WindowShow=G;exports.WindowToggleMaximise=b;exports.WindowUnfullscreen=x;exports.WindowUnmaximise=y;exports.WindowUnminimise=H;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './wailsjs/runtime/runtime';
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
function w(n) {
|
|
2
|
+
window.runtime.LogPrint(n);
|
|
3
|
+
}
|
|
4
|
+
function u(n) {
|
|
5
|
+
window.runtime.LogTrace(n);
|
|
6
|
+
}
|
|
7
|
+
function r(n) {
|
|
8
|
+
window.runtime.LogDebug(n);
|
|
9
|
+
}
|
|
10
|
+
function d(n) {
|
|
11
|
+
window.runtime.LogInfo(n);
|
|
12
|
+
}
|
|
13
|
+
function m(n) {
|
|
14
|
+
window.runtime.LogWarning(n);
|
|
15
|
+
}
|
|
16
|
+
function f(n) {
|
|
17
|
+
window.runtime.LogError(n);
|
|
18
|
+
}
|
|
19
|
+
function c(n) {
|
|
20
|
+
window.runtime.LogFatal(n);
|
|
21
|
+
}
|
|
22
|
+
function e(n, i, o) {
|
|
23
|
+
return window.runtime.EventsOnMultiple(n, i, o);
|
|
24
|
+
}
|
|
25
|
+
function l(n, i) {
|
|
26
|
+
return e(n, i, -1);
|
|
27
|
+
}
|
|
28
|
+
function s(n, ...i) {
|
|
29
|
+
return window.runtime.EventsOff(n, ...i);
|
|
30
|
+
}
|
|
31
|
+
function W() {
|
|
32
|
+
return window.runtime.EventsOffAll();
|
|
33
|
+
}
|
|
34
|
+
function a(n, i) {
|
|
35
|
+
return e(n, i, 1);
|
|
36
|
+
}
|
|
37
|
+
function S(n) {
|
|
38
|
+
let i = [n].slice.call(arguments);
|
|
39
|
+
return window.runtime.EventsEmit.apply(null, i);
|
|
40
|
+
}
|
|
41
|
+
function g() {
|
|
42
|
+
window.runtime.WindowReload();
|
|
43
|
+
}
|
|
44
|
+
function p() {
|
|
45
|
+
window.runtime.WindowReloadApp();
|
|
46
|
+
}
|
|
47
|
+
function L(n) {
|
|
48
|
+
window.runtime.WindowSetAlwaysOnTop(n);
|
|
49
|
+
}
|
|
50
|
+
function O() {
|
|
51
|
+
window.runtime.WindowSetSystemDefaultTheme();
|
|
52
|
+
}
|
|
53
|
+
function T() {
|
|
54
|
+
window.runtime.WindowSetLightTheme();
|
|
55
|
+
}
|
|
56
|
+
function h() {
|
|
57
|
+
window.runtime.WindowSetDarkTheme();
|
|
58
|
+
}
|
|
59
|
+
function v() {
|
|
60
|
+
window.runtime.WindowCenter();
|
|
61
|
+
}
|
|
62
|
+
function E(n) {
|
|
63
|
+
window.runtime.WindowSetTitle(n);
|
|
64
|
+
}
|
|
65
|
+
function M() {
|
|
66
|
+
window.runtime.WindowFullscreen();
|
|
67
|
+
}
|
|
68
|
+
function x() {
|
|
69
|
+
window.runtime.WindowUnfullscreen();
|
|
70
|
+
}
|
|
71
|
+
function F() {
|
|
72
|
+
return window.runtime.WindowIsFullscreen();
|
|
73
|
+
}
|
|
74
|
+
function C() {
|
|
75
|
+
return window.runtime.WindowGetSize();
|
|
76
|
+
}
|
|
77
|
+
function D(n, i) {
|
|
78
|
+
window.runtime.WindowSetSize(n, i);
|
|
79
|
+
}
|
|
80
|
+
function I(n, i) {
|
|
81
|
+
window.runtime.WindowSetMaxSize(n, i);
|
|
82
|
+
}
|
|
83
|
+
function P(n, i) {
|
|
84
|
+
window.runtime.WindowSetMinSize(n, i);
|
|
85
|
+
}
|
|
86
|
+
function R(n, i) {
|
|
87
|
+
window.runtime.WindowSetPosition(n, i);
|
|
88
|
+
}
|
|
89
|
+
function z() {
|
|
90
|
+
return window.runtime.WindowGetPosition();
|
|
91
|
+
}
|
|
92
|
+
function A() {
|
|
93
|
+
window.runtime.WindowHide();
|
|
94
|
+
}
|
|
95
|
+
function G() {
|
|
96
|
+
window.runtime.WindowShow();
|
|
97
|
+
}
|
|
98
|
+
function U() {
|
|
99
|
+
window.runtime.WindowMaximise();
|
|
100
|
+
}
|
|
101
|
+
function b() {
|
|
102
|
+
window.runtime.WindowToggleMaximise();
|
|
103
|
+
}
|
|
104
|
+
function y() {
|
|
105
|
+
window.runtime.WindowUnmaximise();
|
|
106
|
+
}
|
|
107
|
+
function k() {
|
|
108
|
+
return window.runtime.WindowIsMaximised();
|
|
109
|
+
}
|
|
110
|
+
function B() {
|
|
111
|
+
window.runtime.WindowMinimise();
|
|
112
|
+
}
|
|
113
|
+
function H() {
|
|
114
|
+
window.runtime.WindowUnminimise();
|
|
115
|
+
}
|
|
116
|
+
function N(n, i, o, t) {
|
|
117
|
+
window.runtime.WindowSetBackgroundColour(n, i, o, t);
|
|
118
|
+
}
|
|
119
|
+
function Q() {
|
|
120
|
+
return window.runtime.ScreenGetAll();
|
|
121
|
+
}
|
|
122
|
+
function j() {
|
|
123
|
+
return window.runtime.WindowIsMinimised();
|
|
124
|
+
}
|
|
125
|
+
function q() {
|
|
126
|
+
return window.runtime.WindowIsNormal();
|
|
127
|
+
}
|
|
128
|
+
function J(n) {
|
|
129
|
+
window.runtime.BrowserOpenURL(n);
|
|
130
|
+
}
|
|
131
|
+
function K() {
|
|
132
|
+
return window.runtime.Environment();
|
|
133
|
+
}
|
|
134
|
+
function V() {
|
|
135
|
+
window.runtime.Quit();
|
|
136
|
+
}
|
|
137
|
+
function X() {
|
|
138
|
+
window.runtime.Hide();
|
|
139
|
+
}
|
|
140
|
+
function Y() {
|
|
141
|
+
window.runtime.Show();
|
|
142
|
+
}
|
|
143
|
+
function Z() {
|
|
144
|
+
return window.runtime.ClipboardGetText();
|
|
145
|
+
}
|
|
146
|
+
function _(n) {
|
|
147
|
+
return window.runtime.ClipboardSetText(n);
|
|
148
|
+
}
|
|
149
|
+
function $(n, i) {
|
|
150
|
+
return window.runtime.OnFileDrop(n, i);
|
|
151
|
+
}
|
|
152
|
+
function nn() {
|
|
153
|
+
return window.runtime.OnFileDropOff();
|
|
154
|
+
}
|
|
155
|
+
function on() {
|
|
156
|
+
return window.runtime.CanResolveFilePaths();
|
|
157
|
+
}
|
|
158
|
+
function en(n) {
|
|
159
|
+
return window.runtime.ResolveFilePaths(n);
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
J as BrowserOpenURL,
|
|
163
|
+
on as CanResolveFilePaths,
|
|
164
|
+
Z as ClipboardGetText,
|
|
165
|
+
_ as ClipboardSetText,
|
|
166
|
+
K as Environment,
|
|
167
|
+
S as EventsEmit,
|
|
168
|
+
s as EventsOff,
|
|
169
|
+
W as EventsOffAll,
|
|
170
|
+
l as EventsOn,
|
|
171
|
+
e as EventsOnMultiple,
|
|
172
|
+
a as EventsOnce,
|
|
173
|
+
X as Hide,
|
|
174
|
+
r as LogDebug,
|
|
175
|
+
f as LogError,
|
|
176
|
+
c as LogFatal,
|
|
177
|
+
d as LogInfo,
|
|
178
|
+
w as LogPrint,
|
|
179
|
+
u as LogTrace,
|
|
180
|
+
m as LogWarning,
|
|
181
|
+
$ as OnFileDrop,
|
|
182
|
+
nn as OnFileDropOff,
|
|
183
|
+
V as Quit,
|
|
184
|
+
en as ResolveFilePaths,
|
|
185
|
+
Q as ScreenGetAll,
|
|
186
|
+
Y as Show,
|
|
187
|
+
v as WindowCenter,
|
|
188
|
+
M as WindowFullscreen,
|
|
189
|
+
z as WindowGetPosition,
|
|
190
|
+
C as WindowGetSize,
|
|
191
|
+
A as WindowHide,
|
|
192
|
+
F as WindowIsFullscreen,
|
|
193
|
+
k as WindowIsMaximised,
|
|
194
|
+
j as WindowIsMinimised,
|
|
195
|
+
q as WindowIsNormal,
|
|
196
|
+
U as WindowMaximise,
|
|
197
|
+
B as WindowMinimise,
|
|
198
|
+
g as WindowReload,
|
|
199
|
+
p as WindowReloadApp,
|
|
200
|
+
L as WindowSetAlwaysOnTop,
|
|
201
|
+
N as WindowSetBackgroundColour,
|
|
202
|
+
h as WindowSetDarkTheme,
|
|
203
|
+
T as WindowSetLightTheme,
|
|
204
|
+
I as WindowSetMaxSize,
|
|
205
|
+
P as WindowSetMinSize,
|
|
206
|
+
R as WindowSetPosition,
|
|
207
|
+
D as WindowSetSize,
|
|
208
|
+
O as WindowSetSystemDefaultTheme,
|
|
209
|
+
E as WindowSetTitle,
|
|
210
|
+
G as WindowShow,
|
|
211
|
+
b as WindowToggleMaximise,
|
|
212
|
+
x as WindowUnfullscreen,
|
|
213
|
+
y as WindowUnmaximise,
|
|
214
|
+
H as WindowUnminimise
|
|
215
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { default as React, ComponentType } from 'react';
|
|
2
|
+
import { ExtensionPointSettings } from './extensions';
|
|
3
|
+
import { RouteObject } from 'react-router-dom';
|
|
4
|
+
/** TODO: Add whatever props we need here */
|
|
5
|
+
export declare class PluginWindowRootProps {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Plugin container is the main type that is rendered for a visual component within the
|
|
9
|
+
* user interface.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PluginWindow {
|
|
12
|
+
_extensions?: Array<ExtensionPointSettings>;
|
|
13
|
+
/**
|
|
14
|
+
* The root component to render for the application window.
|
|
15
|
+
*/
|
|
16
|
+
root?: ComponentType;
|
|
17
|
+
/**
|
|
18
|
+
* Various pages to render under the root component. These can be navigated to using
|
|
19
|
+
* the built-in navigation system both programatically and through Links.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* Programatically:
|
|
23
|
+
* ```
|
|
24
|
+
* import { usePluginNavigation } from '@omniviewdev/runtime';
|
|
25
|
+
* const MyComponent = () => {
|
|
26
|
+
* const { navigate } = usePluginNavigation();
|
|
27
|
+
*
|
|
28
|
+
* const goToPage = () => {
|
|
29
|
+
* navigate('some-page')
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Using Links:
|
|
36
|
+
* ```
|
|
37
|
+
* import { Link } from '@omniviewdev/runtime';
|
|
38
|
+
* const MyComponent = () => {
|
|
39
|
+
* return (
|
|
40
|
+
* <Link to="some-page">
|
|
41
|
+
* )
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
pages?: Record<string, ComponentType>;
|
|
47
|
+
_routes?: Array<RouteObject>;
|
|
48
|
+
get extensions(): ExtensionPointSettings[];
|
|
49
|
+
get Routes(): Array<RouteObject>;
|
|
50
|
+
/**
|
|
51
|
+
* Get's the route provider component to render within the plugin view
|
|
52
|
+
*/
|
|
53
|
+
get Window(): React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Register extension points for other plugins to extend the functionality
|
|
56
|
+
* of the plugin. All extension points registered will be name as such:
|
|
57
|
+
*
|
|
58
|
+
* `${plugin_id}/${extension_point_id}`
|
|
59
|
+
*/
|
|
60
|
+
registerExtensionPoints(points: Array<ExtensionPointSettings>): this;
|
|
61
|
+
/**
|
|
62
|
+
* Set the component displayed under:
|
|
63
|
+
* /_plugin/${plugin_id}/*
|
|
64
|
+
*
|
|
65
|
+
* If the NavModel is configured, the page will have a managed frame, otheriwse it has full control.
|
|
66
|
+
*/
|
|
67
|
+
setRootPage(root: ComponentType<PluginWindowRootProps>): this;
|
|
68
|
+
/**
|
|
69
|
+
* Adds a page to the plugin window. This page will be displayed under:
|
|
70
|
+
*/
|
|
71
|
+
withPage(page: string, component: ComponentType): this;
|
|
72
|
+
withRoutes(routes: Array<RouteObject>): this;
|
|
73
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
export type ExtensionPointSettings = {
|
|
2
|
+
/**
|
|
3
|
+
* The ID of the plugin (or 'core') that owns the extension point
|
|
4
|
+
*/
|
|
5
|
+
owner: string;
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the extension point
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The human readable label for the extension point
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* A description of the extension point
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Set the extension point to support rendering multiple components or a single component.
|
|
20
|
+
*/
|
|
21
|
+
mode: 'single' | 'multiple';
|
|
22
|
+
/**
|
|
23
|
+
* Disable the extension point to prevent rendering components.
|
|
24
|
+
* This is useful when the extension point should be disabled temporarily.
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Selected component to render when the extension point is in single-component mode.
|
|
29
|
+
*/
|
|
30
|
+
selected?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The order in which the components should be rendered when the extension point is in multiple-component mode.
|
|
33
|
+
*/
|
|
34
|
+
order?: string[];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Options required during registration of the extension to the extension point's registry.
|
|
38
|
+
*/
|
|
39
|
+
export type RegisterOpts<Props> = {
|
|
40
|
+
/**
|
|
41
|
+
* The ID of the registered component
|
|
42
|
+
*/
|
|
43
|
+
id: string;
|
|
44
|
+
/**
|
|
45
|
+
* The plugin that owns the view
|
|
46
|
+
*/
|
|
47
|
+
plugin: string;
|
|
48
|
+
/**
|
|
49
|
+
* The human readable label for the component
|
|
50
|
+
*/
|
|
51
|
+
label: string;
|
|
52
|
+
/**
|
|
53
|
+
* A description of the component
|
|
54
|
+
*/
|
|
55
|
+
description?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The component to render
|
|
58
|
+
*/
|
|
59
|
+
component: React.Component<Props>;
|
|
60
|
+
/**
|
|
61
|
+
* Additional optional metadata for the component
|
|
62
|
+
*/
|
|
63
|
+
meta?: unknown;
|
|
64
|
+
};
|
|
65
|
+
export type Registration<Props> = RegisterOpts<Props> & {
|
|
66
|
+
/**
|
|
67
|
+
* The time the component was registered
|
|
68
|
+
*/
|
|
69
|
+
registeredAt: Date;
|
|
70
|
+
/**
|
|
71
|
+
* The time the component was last updated
|
|
72
|
+
* This will be the same as `registeredAt` if the component has not been updated
|
|
73
|
+
*/
|
|
74
|
+
updatedAt: Date;
|
|
75
|
+
/**
|
|
76
|
+
* Whether the component is enabled
|
|
77
|
+
* This can be used to disable a component without unregistering it.
|
|
78
|
+
*/
|
|
79
|
+
enabled?: boolean;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Context that can be passed to the registry to provide additional information to the matcher.
|
|
83
|
+
* The context should generate a cache key that can be used to cache the results of the matcher
|
|
84
|
+
* to avoid recalculating the same result multiple times.
|
|
85
|
+
*/
|
|
86
|
+
export type ExtensionRenderContext = {
|
|
87
|
+
getCacheKey: () => string;
|
|
88
|
+
};
|
|
89
|
+
export type CreateExtensionPointOptions<ComponentProps> = ExtensionPointSettings & {
|
|
90
|
+
/**
|
|
91
|
+
* Define a custom matcher to use to find which extensions to register based on any number of args.
|
|
92
|
+
* This is useful when the extension should only be registered for certain resources, like for example
|
|
93
|
+
* when a registry contains components that should only be rendered for specific resources.
|
|
94
|
+
*
|
|
95
|
+
* @param context The context to use to determine if the extension should be registered. The extension point
|
|
96
|
+
* renderer will call this function with the context provided by the extension point.
|
|
97
|
+
* @param item The item to check if it should be registered
|
|
98
|
+
* @returns Whether the item should be registered
|
|
99
|
+
*/
|
|
100
|
+
matcher?: (context: ExtensionRenderContext, item: Registration<ComponentProps>) => boolean;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* A registry to hold an extension points registered extensions, providing type safe access to the components.
|
|
104
|
+
*
|
|
105
|
+
* @param ComponentProps The props type for the component that is registered in the registry.
|
|
106
|
+
*/
|
|
107
|
+
export declare class ExtensionPointStore<ComponentProps> {
|
|
108
|
+
private readonly _settings;
|
|
109
|
+
private readonly _extensions;
|
|
110
|
+
private readonly _lookupCache;
|
|
111
|
+
private readonly _matchCache;
|
|
112
|
+
private readonly _matcher?;
|
|
113
|
+
constructor(opts: CreateExtensionPointOptions<ComponentProps>);
|
|
114
|
+
settings(): ExtensionPointSettings;
|
|
115
|
+
/**
|
|
116
|
+
* Registers a new component within the registry. Throws an error if a component with the same ID already exists.
|
|
117
|
+
* This method should be used when initializing components or dynamically adding new components at runtime.
|
|
118
|
+
*
|
|
119
|
+
* @param opts The registration options for the component, containing its ID, plugin, and other metadata.
|
|
120
|
+
* @throws Error if a component with the same ID is already registered.
|
|
121
|
+
* @example
|
|
122
|
+
* registry.register({
|
|
123
|
+
* id: 'unique-sidebar-item',
|
|
124
|
+
* plugin: 'examplePlugin',
|
|
125
|
+
* label: 'My Sidebar Item',
|
|
126
|
+
* component: MyComponent,
|
|
127
|
+
* });
|
|
128
|
+
*/
|
|
129
|
+
register(opts: RegisterOpts<ComponentProps>): void;
|
|
130
|
+
/**
|
|
131
|
+
* Unregisters a component from the registry by its ID. Useful for cleanup or when components are dynamically removed.
|
|
132
|
+
*
|
|
133
|
+
* @param id The ID of the component to unregister.
|
|
134
|
+
* @example
|
|
135
|
+
* registry.unregister('unique-sidebar-item');
|
|
136
|
+
*/
|
|
137
|
+
unregister(id: string): void;
|
|
138
|
+
/**
|
|
139
|
+
* Retrieves a component by its ID from the registry. Returns undefined if no such component exists.
|
|
140
|
+
*
|
|
141
|
+
* @param id The ID of the component to retrieve.
|
|
142
|
+
* @returns The component associated with the given ID, or undefined if not found.
|
|
143
|
+
* @example
|
|
144
|
+
* const component = registry.get('unique-sidebar-item');
|
|
145
|
+
* if (component) {
|
|
146
|
+
* render(component);
|
|
147
|
+
* }
|
|
148
|
+
*/
|
|
149
|
+
get(id: string): import('react').Component<ComponentProps, {}, any> | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Lists all registered components in the registry. Useful for debugging or generating summaries of available components.
|
|
152
|
+
*
|
|
153
|
+
* @returns An array of all registered components.
|
|
154
|
+
* @example
|
|
155
|
+
* const allComponents = registry.list();
|
|
156
|
+
* console.log('Registered Components:', allComponents);
|
|
157
|
+
*/
|
|
158
|
+
list(): Registration<ComponentProps>[];
|
|
159
|
+
generateMatchCacheKey(item: Registration<ComponentProps>): string;
|
|
160
|
+
/**
|
|
161
|
+
* Calculate the matches for the given context.
|
|
162
|
+
*/
|
|
163
|
+
calculateMatches(context: ExtensionRenderContext): Registration<ComponentProps>[];
|
|
164
|
+
/**
|
|
165
|
+
* Preload the registry caches with the given expected context to avoid on-first-request calculation.
|
|
166
|
+
* This is useful when the registry is used to provide components for a specific context, like for
|
|
167
|
+
* specific resources types.
|
|
168
|
+
*
|
|
169
|
+
* If the cache is already populated for the expected context, the cache key will be recalculated.
|
|
170
|
+
*
|
|
171
|
+
* @param context The context expected to be called preload the registry with on provide.
|
|
172
|
+
*/
|
|
173
|
+
preload(context: ExtensionRenderContext): void;
|
|
174
|
+
/**
|
|
175
|
+
* Provide the components that match the given context.
|
|
176
|
+
*/
|
|
177
|
+
provide(context: ExtensionRenderContext): Array<React.Component<ComponentProps>>;
|
|
178
|
+
reorderComponents(components: Array<React.Component<ComponentProps>>, ids: string[], order: string[]): Array<React.Component<ComponentProps>>;
|
|
179
|
+
/**
|
|
180
|
+
* Reorder the components in the registry based on the given order.
|
|
181
|
+
*/
|
|
182
|
+
reorder(order: string[]): void;
|
|
183
|
+
clearLookupCache(): void;
|
|
184
|
+
clearMatchCache(): void;
|
|
185
|
+
clearAllCaches(): void;
|
|
186
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InformerSyncPolicy controls when an informer starts for a resource type.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum InformerSyncPolicy {
|
|
5
|
+
/** Start when connection opens (default) */
|
|
6
|
+
OnConnect = 0,
|
|
7
|
+
/** Start on first Get/List/Find for this resource */
|
|
8
|
+
OnFirstQuery = 1,
|
|
9
|
+
/** Never start an informer (always use direct queries) */
|
|
10
|
+
Never = 2
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* InformerResourceState represents the sync state of a single resource type's informer.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum InformerResourceState {
|
|
16
|
+
Pending = 0,
|
|
17
|
+
Syncing = 1,
|
|
18
|
+
Synced = 2,
|
|
19
|
+
Error = 3,
|
|
20
|
+
Cancelled = 4
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* InformerStateEvent is emitted when a resource's informer state changes.
|
|
24
|
+
*/
|
|
25
|
+
export interface InformerStateEvent {
|
|
26
|
+
pluginId: string;
|
|
27
|
+
connection: string;
|
|
28
|
+
resourceKey: string;
|
|
29
|
+
state: InformerResourceState;
|
|
30
|
+
resourceCount: number;
|
|
31
|
+
totalCount: number;
|
|
32
|
+
error?: {
|
|
33
|
+
code: string;
|
|
34
|
+
title: string;
|
|
35
|
+
message: string;
|
|
36
|
+
suggestions?: string[];
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* InformerConnectionSummary provides an aggregate view of all informer states for a connection.
|
|
41
|
+
*/
|
|
42
|
+
export interface InformerConnectionSummary {
|
|
43
|
+
connection: string;
|
|
44
|
+
resources: Record<string, InformerResourceState>;
|
|
45
|
+
resourceCounts: Record<string, number>;
|
|
46
|
+
totalResources: number;
|
|
47
|
+
syncedCount: number;
|
|
48
|
+
errorCount: number;
|
|
49
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InformerResourceState, InformerStateEvent } from '../types/informer';
|
|
2
|
+
export interface ActiveSync {
|
|
3
|
+
pluginID: string;
|
|
4
|
+
connectionID: string;
|
|
5
|
+
totalResources: number;
|
|
6
|
+
syncedCount: number;
|
|
7
|
+
errorCount: number;
|
|
8
|
+
/** Count of resources in any terminal state (Synced + Error + Cancelled) */
|
|
9
|
+
doneCount: number;
|
|
10
|
+
/** 0-1 progress fraction */
|
|
11
|
+
progress: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ResourceTracker {
|
|
14
|
+
states: Record<string, InformerResourceState>;
|
|
15
|
+
pluginID: string;
|
|
16
|
+
connectionID: string;
|
|
17
|
+
}
|
|
18
|
+
/** Compute an ActiveSync from a ResourceTracker */
|
|
19
|
+
export declare function computeActiveSync(tracker: ResourceTracker): ActiveSync;
|
|
20
|
+
/** Whether a sync is considered "done" (all resources reached terminal state) */
|
|
21
|
+
export declare function isSyncDone(sync: ActiveSync): boolean;
|
|
22
|
+
/** Whether any syncs are still actively in progress */
|
|
23
|
+
export declare function hasActiveSyncing(syncs: ActiveSync[]): boolean;
|
|
24
|
+
/** Compute aggregate progress across multiple syncs */
|
|
25
|
+
export declare function aggregateProgress(syncs: ActiveSync[]): number;
|
|
26
|
+
/** Build a tracker key from an event */
|
|
27
|
+
export declare function trackerKey(event: InformerStateEvent): string;
|
|
28
|
+
/** Update a trackers map with a new event, returning the updated tracker */
|
|
29
|
+
export declare function updateTracker(trackers: Map<string, ResourceTracker>, event: InformerStateEvent): ResourceTracker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
|
2
|
+
// This file is automatically generated. DO NOT EDIT
|
|
3
|
+
|
|
4
|
+
export function Delete(arg1:string,arg2:string):Promise<void>;
|
|
5
|
+
|
|
6
|
+
export function Get(arg1:string,arg2:string):Promise<any>;
|
|
7
|
+
|
|
8
|
+
export function Keys(arg1:string):Promise<Array<string>>;
|
|
9
|
+
|
|
10
|
+
export function Set(arg1:string,arg2:string,arg3:any):Promise<void>;
|