diff options
author | Kerwin Bryant <kerwin612@qq.com> | 2025-03-06 00:03:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-05 08:03:44 -0800 |
commit | f0f10413aeaa6970c07cc481ebd22ea2eb626a4c (patch) | |
tree | 161882292ff36b050f2b1e179e15613338143a8a /web_src | |
parent | 95efc7b35bcaa3d9d621da0445dcfa86a3c29889 (diff) | |
download | gitea-f0f10413aeaa6970c07cc481ebd22ea2eb626a4c.tar.gz gitea-f0f10413aeaa6970c07cc481ebd22ea2eb626a4c.zip |
Update TypeScript types (#33799)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/features/copycontent.ts | 2 | ||||
-rw-r--r-- | web_src/js/globals.d.ts | 10 | ||||
-rw-r--r-- | web_src/js/standalone/swagger.ts | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/web_src/js/features/copycontent.ts b/web_src/js/features/copycontent.ts index 3961a8d7ac..d58f6c8246 100644 --- a/web_src/js/features/copycontent.ts +++ b/web_src/js/features/copycontent.ts @@ -7,7 +7,7 @@ import {registerGlobalEventFunc} from '../modules/observer.ts'; const {i18n} = window.config; export function initCopyContent() { - registerGlobalEventFunc('click', 'onCopyContentButtonClick', async (btn: HTMLInputElement) => { + registerGlobalEventFunc('click', 'onCopyContentButtonClick', async (btn: HTMLElement) => { if (btn.classList.contains('disabled') || btn.classList.contains('is-loading')) return; let content; let isRasterImage = false; diff --git a/web_src/js/globals.d.ts b/web_src/js/globals.d.ts index 0c540ac296..2f8cd98878 100644 --- a/web_src/js/globals.d.ts +++ b/web_src/js/globals.d.ts @@ -58,21 +58,23 @@ interface Element { type Writable<T> = { -readonly [K in keyof T]: T[K] }; interface Window { + __webpack_public_path__: string; config: import('./web_src/js/types.ts').Config; $: typeof import('@types/jquery'), jQuery: typeof import('@types/jquery'), htmx: Omit<typeof import('htmx.org/dist/htmx.esm.js').default, 'config'> & { config?: Writable<typeof import('htmx.org').default.config>, }, - ui?: any, _globalHandlerErrors: Array<ErrorEvent & PromiseRejectionEvent> & { _inited: boolean, push: (e: ErrorEvent & PromiseRejectionEvent) => void | number, }, - __webpack_public_path__: string; + codeEditors: any[], // export editor for customization + + // various captcha plugins grecaptcha: any, turnstile: any, hcaptcha: any, - codeEditors: any[], - updateCloneStates: () => void, + + // do not add more properties here unless it is a must } diff --git a/web_src/js/standalone/swagger.ts b/web_src/js/standalone/swagger.ts index 63b676b2ea..4b17ba21a8 100644 --- a/web_src/js/standalone/swagger.ts +++ b/web_src/js/standalone/swagger.ts @@ -14,7 +14,7 @@ window.addEventListener('load', async () => { return 0; }); - const ui = SwaggerUI({ + SwaggerUI({ spec, dom_id: '#swagger-ui', deepLinking: true, @@ -27,6 +27,4 @@ window.addEventListener('load', async () => { SwaggerUI.plugins.DownloadUrl, ], }); - - window.ui = ui; }); |