Skip to content

Commit b6487dd

Browse files
committed
remove unnecessary global variables
1 parent a57a882 commit b6487dd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

web_src/js/globals.d.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,23 @@ interface Element {
5858
type Writable<T> = { -readonly [K in keyof T]: T[K] };
5959

6060
interface Window {
61+
__webpack_public_path__: string;
6162
config: import('./web_src/js/types.ts').Config;
6263
$: typeof import('@types/jquery'),
6364
jQuery: typeof import('@types/jquery'),
6465
htmx: Omit<typeof import('htmx.org/dist/htmx.esm.js').default, 'config'> & {
6566
config?: Writable<typeof import('htmx.org').default.config>,
6667
},
67-
ui?: any,
6868
_globalHandlerErrors: Array<ErrorEvent & PromiseRejectionEvent> & {
6969
_inited: boolean,
7070
push: (e: ErrorEvent & PromiseRejectionEvent) => void | number,
7171
},
72-
__webpack_public_path__: string;
72+
codeEditors: any[], // export editor for customization
73+
74+
// various captcha plugins
7375
grecaptcha: any,
7476
turnstile: any,
7577
hcaptcha: any,
76-
codeEditors: any[],
77-
updateCloneStates: () => void,
78+
79+
// do not add more properties here unless it is a must
7880
}

web_src/js/standalone/swagger.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ window.addEventListener('load', async () => {
1414
return 0;
1515
});
1616

17-
const ui = SwaggerUI({
17+
SwaggerUI({
1818
spec,
1919
dom_id: '#swagger-ui',
2020
deepLinking: true,
@@ -27,6 +27,4 @@ window.addEventListener('load', async () => {
2727
SwaggerUI.plugins.DownloadUrl,
2828
],
2929
});
30-
31-
window.ui = ui;
3230
});

0 commit comments

Comments
 (0)