mirror of
https://github.com/go-gitea/gitea
synced 2025-03-10 04:34:26 +00:00
Update TypeScript types (#33799)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
95efc7b35b
commit
f0f10413ae
@ -7,7 +7,7 @@ import {registerGlobalEventFunc} from '../modules/observer.ts';
|
|||||||
const {i18n} = window.config;
|
const {i18n} = window.config;
|
||||||
|
|
||||||
export function initCopyContent() {
|
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;
|
if (btn.classList.contains('disabled') || btn.classList.contains('is-loading')) return;
|
||||||
let content;
|
let content;
|
||||||
let isRasterImage = false;
|
let isRasterImage = false;
|
||||||
|
10
web_src/js/globals.d.ts
vendored
10
web_src/js/globals.d.ts
vendored
@ -58,21 +58,23 @@ interface Element {
|
|||||||
type Writable<T> = { -readonly [K in keyof T]: T[K] };
|
type Writable<T> = { -readonly [K in keyof T]: T[K] };
|
||||||
|
|
||||||
interface Window {
|
interface Window {
|
||||||
|
__webpack_public_path__: string;
|
||||||
config: import('./web_src/js/types.ts').Config;
|
config: import('./web_src/js/types.ts').Config;
|
||||||
$: typeof import('@types/jquery'),
|
$: typeof import('@types/jquery'),
|
||||||
jQuery: typeof import('@types/jquery'),
|
jQuery: typeof import('@types/jquery'),
|
||||||
htmx: Omit<typeof import('htmx.org/dist/htmx.esm.js').default, 'config'> & {
|
htmx: Omit<typeof import('htmx.org/dist/htmx.esm.js').default, 'config'> & {
|
||||||
config?: Writable<typeof import('htmx.org').default.config>,
|
config?: Writable<typeof import('htmx.org').default.config>,
|
||||||
},
|
},
|
||||||
ui?: any,
|
|
||||||
_globalHandlerErrors: Array<ErrorEvent & PromiseRejectionEvent> & {
|
_globalHandlerErrors: Array<ErrorEvent & PromiseRejectionEvent> & {
|
||||||
_inited: boolean,
|
_inited: boolean,
|
||||||
push: (e: ErrorEvent & PromiseRejectionEvent) => void | number,
|
push: (e: ErrorEvent & PromiseRejectionEvent) => void | number,
|
||||||
},
|
},
|
||||||
__webpack_public_path__: string;
|
codeEditors: any[], // export editor for customization
|
||||||
|
|
||||||
|
// various captcha plugins
|
||||||
grecaptcha: any,
|
grecaptcha: any,
|
||||||
turnstile: any,
|
turnstile: any,
|
||||||
hcaptcha: any,
|
hcaptcha: any,
|
||||||
codeEditors: any[],
|
|
||||||
updateCloneStates: () => void,
|
// do not add more properties here unless it is a must
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ window.addEventListener('load', async () => {
|
|||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
const ui = SwaggerUI({
|
SwaggerUI({
|
||||||
spec,
|
spec,
|
||||||
dom_id: '#swagger-ui',
|
dom_id: '#swagger-ui',
|
||||||
deepLinking: true,
|
deepLinking: true,
|
||||||
@ -27,6 +27,4 @@ window.addEventListener('load', async () => {
|
|||||||
SwaggerUI.plugins.DownloadUrl,
|
SwaggerUI.plugins.DownloadUrl,
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
window.ui = ui;
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user