Skip to content

Commit f0f1041

Browse files
Update TypeScript types (#33799)
Co-authored-by: wxiaoguang <[email protected]>
1 parent 95efc7b commit f0f1041

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

web_src/js/features/copycontent.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {registerGlobalEventFunc} from '../modules/observer.ts';
77
const {i18n} = window.config;
88

99
export function initCopyContent() {
10-
registerGlobalEventFunc('click', 'onCopyContentButtonClick', async (btn: HTMLInputElement) => {
10+
registerGlobalEventFunc('click', 'onCopyContentButtonClick', async (btn: HTMLElement) => {
1111
if (btn.classList.contains('disabled') || btn.classList.contains('is-loading')) return;
1212
let content;
1313
let isRasterImage = false;

web_src/js/globals.d.ts

+6-4
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

+1-3
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)