Netfan
2021-05-21 2d3d04f547046c23cdfc319a7483261b47c08e83
提交 | 用户 | age
a98835 1 import type {
V 2   ComponentRenderProxy,
3   VNode,
4   ComponentPublicInstance,
5   FunctionalComponent,
bb6769 6   PropType as VuePropType,
a98835 7 } from 'vue';
bb6769 8
a98835 9 declare global {
c03056 10   const __APP_INFO__: {
6d6e0a 11     pkg: {
V 12       name: string;
13       version: string;
14       dependencies: Recordable<string>;
15       devDependencies: Recordable<string>;
16     };
17     lastBuildTime: string;
c03056 18   };
39d629 19   declare interface Window {
V 20     // Global vue app instance
21     __APP__: App<Element>;
22   }
a98835 23
bb6769 24   // vue
V 25   declare type PropType<T> = VuePropType<T>;
26
a98835 27   export type Writable<T> = {
V 28     -readonly [P in keyof T]: T[P];
29   };
30
31   declare type Nullable<T> = T | null;
32   declare type NonNullable<T> = T extends null | undefined ? never : T;
33   declare type Recordable<T = any> = Record<string, T>;
34   declare type ReadonlyRecordable<T = any> = {
35     readonly [key: string]: T;
36   };
37   declare type Indexable<T = any> = {
38     [key: string]: T;
39   };
40   declare type DeepPartial<T> = {
41     [P in keyof T]?: DeepPartial<T[P]>;
42   };
43   declare type TimeoutHandle = ReturnType<typeof setTimeout>;
44   declare type IntervalHandle = ReturnType<typeof setInterval>;
45
46   declare interface ChangeEvent extends Event {
47     target: HTMLInputElement;
48   }
49
50   declare interface WheelEvent {
51     path?: EventTarget[];
52   }
53   interface ImportMetaEnv extends ViteEnv {
54     __: unknown;
55   }
56
57   declare interface ViteEnv {
58     VITE_PORT: number;
59     VITE_USE_MOCK: boolean;
60     VITE_USE_PWA: boolean;
61     VITE_PUBLIC_PATH: string;
62     VITE_PROXY: [string, string][];
63     VITE_GLOB_APP_TITLE: string;
64     VITE_GLOB_APP_SHORT_NAME: string;
65     VITE_USE_CDN: boolean;
66     VITE_DROP_CONSOLE: boolean;
67     VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
f7499c 68     VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean;
a98835 69     VITE_LEGACY: boolean;
V 70     VITE_USE_IMAGEMIN: boolean;
71     VITE_GENERATE_UI: string;
72   }
73
74   declare function parseInt(s: string | number, radix?: number): number;
75
76   declare function parseFloat(string: string | number): number;
77
78   namespace JSX {
79     // tslint:disable no-empty-interface
80     type Element = VNode;
81     // tslint:disable no-empty-interface
82     type ElementClass = ComponentRenderProxy;
83     interface ElementAttributesProperty {
84       $props: any;
85     }
86     interface IntrinsicElements {
87       [elem: string]: any;
88     }
89     interface IntrinsicAttributes {
90       [elem: string]: any;
91     }
92   }
661db0 93 }
V 94
a98835 95 declare module 'vue' {
V 96   export type JSXComponent<Props = any> =
97     | { new (): ComponentPublicInstance<Props> }
98     | FunctionalComponent<Props>;
8ad127 99 }