refactor: 拆分小程序 vue 结构
This commit is contained in:
30
types/global.d.ts
vendored
Normal file
30
types/global.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference types="@tarojs/taro" />
|
||||
|
||||
declare module '*.png';
|
||||
declare module '*.gif';
|
||||
declare module '*.jpg';
|
||||
declare module '*.jpeg';
|
||||
declare module '*.svg';
|
||||
declare module '*.css';
|
||||
declare module '*.less';
|
||||
declare module '*.scss';
|
||||
declare module '*.sass';
|
||||
declare module '*.styl';
|
||||
|
||||
declare const __APP_ENV__: 'development' | 'production' | 'test';
|
||||
declare const __API_BASE_URL__: string;
|
||||
declare const __USE_MOCK__: boolean;
|
||||
declare const __REQUEST_TIMEOUT__: number;
|
||||
declare const __TENANT_CODE__: string;
|
||||
|
||||
declare namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
NODE_ENV: 'development' | 'production',
|
||||
TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'qq' | 'jd' | 'harmony' | 'jdrn',
|
||||
TARO_APP_ID: string
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@tarojs/components' {
|
||||
export * from '@tarojs/components/types/index.vue3'
|
||||
}
|
||||
34
types/vendor-stubs.d.ts
vendored
Normal file
34
types/vendor-stubs.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
declare module 'react' {
|
||||
const React: any
|
||||
export = React
|
||||
export as namespace React
|
||||
}
|
||||
|
||||
declare module 'react-native' {
|
||||
const ReactNative: any
|
||||
export = ReactNative
|
||||
}
|
||||
|
||||
declare module 'webpack-dev-server' {
|
||||
const WebpackDevServer: any
|
||||
export default WebpackDevServer
|
||||
}
|
||||
|
||||
declare module 'html-webpack-plugin' {
|
||||
const HtmlWebpackPlugin: any
|
||||
export default HtmlWebpackPlugin
|
||||
}
|
||||
|
||||
declare module 'webpack-chain' {
|
||||
const Config: any
|
||||
export default Config
|
||||
}
|
||||
|
||||
type CommonEventFunction<T = any> = (event: T) => void
|
||||
|
||||
declare const Input: any
|
||||
declare const taroResolver: any
|
||||
declare const styleTransformer: any
|
||||
|
||||
type ViteConfig = any
|
||||
type WebpackConfig = any
|
||||
10
types/vue.d.ts
vendored
Normal file
10
types/vue.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export {}
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents extends JSX.IntrinsicElements {
|
||||
/** Note: Vue 在 runtime 中将 JSX.IntrinsicElements 通过 index signature 重复声明标签
|
||||
* 这会导致插件无法正常跳转类型,可以手动覆盖声明标签活得更好的体验,参考如下:
|
||||
* 'scroll-view': JSX.IntrinsicElements['scroll-view']
|
||||
*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user