global.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import type { ComponentPublicInstance, FunctionalComponent, VNodeChild, PropType as VuePropType } from 'vue';
  2. import type { JSX } from 'vue/jsx-runtime';
  3. export {};
  4. declare global {
  5. export interface Window {
  6. /** NProgress instance */
  7. NProgress?: import('nprogress').NProgress;
  8. /** Loading bar instance */
  9. $loadingBar?: import('naive-ui').LoadingBarProviderInst;
  10. /** Dialog instance */
  11. $dialog?: import('naive-ui').DialogProviderInst;
  12. /** Message instance */
  13. $message?: import('naive-ui').MessageProviderInst;
  14. /** Notification instance */
  15. $notification?: import('naive-ui').NotificationProviderInst;
  16. }
  17. /** Build time of the project */
  18. export const BUILD_TIME: string;
  19. type PropType<T> = VuePropType<T>;
  20. type VueNode = VNodeChild | JSX.Element;
  21. export type Writable<T> = {
  22. -readonly [P in keyof T]: T[P];
  23. };
  24. interface InResult<T = any> {
  25. code: number;
  26. message: string;
  27. result: T;
  28. }
  29. type Nullable<T> = T | null;
  30. type Recordable<T = any> = Record<string, T>;
  31. type ReadonlyRecordable<T = any> = {
  32. readonly [key: string]: T;
  33. };
  34. type Indexable<T = any> = {
  35. [key: string]: T;
  36. };
  37. type DeepPartial<T> = {
  38. [P in keyof T]?: DeepPartial<T[P]>;
  39. };
  40. type TimeoutHandle = ReturnType<typeof setTimeout>;
  41. type IntervalHandle = ReturnType<typeof setInterval>;
  42. interface ChangeEvent extends Event {
  43. target: HTMLInputElement;
  44. }
  45. interface WheelEvent {
  46. path?: EventTarget[];
  47. }
  48. }
  49. declare module 'vue' {
  50. export type JSXComponent<Props = any> = { new (): ComponentPublicInstance<Props> } | FunctionalComponent<Props>;
  51. }