gitea源码

globals.d.ts 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. declare module '*.svg' {
  2. const value: string;
  3. export default value;
  4. }
  5. declare module '*.css' {
  6. const value: string;
  7. export default value;
  8. }
  9. declare module '*.vue' {
  10. import type {DefineComponent} from 'vue';
  11. const component: DefineComponent<unknown, unknown, any>;
  12. export default component;
  13. // List of named exports from vue components, used to make `tsc` output clean.
  14. // To actually lint .vue files, `vue-tsc` is used because `tsc` can not parse them.
  15. export function initDashboardRepoList(): void;
  16. export function initRepositoryActionView(): void;
  17. }
  18. declare let __webpack_public_path__: string;
  19. declare module 'htmx.org/dist/htmx.esm.js' {
  20. const value = await import('htmx.org');
  21. export default value;
  22. }
  23. declare module 'swagger-ui-dist/swagger-ui-es-bundle.js' {
  24. const value = await import('swagger-ui-dist');
  25. export default value.SwaggerUIBundle;
  26. }
  27. interface JQuery {
  28. areYouSure: any, // jquery.are-you-sure
  29. fomanticExt: any; // fomantic extension
  30. api: any, // fomantic
  31. dimmer: any, // fomantic
  32. dropdown: any; // fomantic
  33. modal: any; // fomantic
  34. tab: any; // fomantic
  35. transition: any, // fomantic
  36. search: any, // fomantic
  37. }
  38. interface JQueryStatic {
  39. api: any, // fomantic
  40. }
  41. interface Element {
  42. _tippy: import('tippy.js').Instance;
  43. }
  44. interface Window {
  45. __webpack_public_path__: string;
  46. config: import('./web_src/js/types.ts').Config;
  47. $: typeof import('@types/jquery'),
  48. jQuery: typeof import('@types/jquery'),
  49. htmx: typeof import('htmx.org').default,
  50. _globalHandlerErrors: Array<ErrorEvent & PromiseRejectionEvent> & {
  51. _inited: boolean,
  52. push: (e: ErrorEvent & PromiseRejectionEvent) => void | number,
  53. },
  54. codeEditors: any[], // export editor for customization
  55. // various captcha plugins
  56. grecaptcha: any,
  57. turnstile: any,
  58. hcaptcha: any,
  59. // do not add more properties here unless it is a must
  60. }