weapp-tailwindcss
Version:
把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!
65 lines (64 loc) • 3.33 kB
TypeScript
export type DetectableAppType = 'mpx' | 'taro' | 'uni-app' | 'uni-app-vite' | 'uni-app-x' | 'weapp-vite';
export type FrameworkEnv = Partial<Record<'MPX_CLI_MODE' | 'MPX_CURRENT_TARGET_MODE' | 'NODE_PATH' | 'TARO_ENV' | 'UNI_PLATFORM' | 'UNI_UTS_PLATFORM' | 'WEAPP_TAILWINDCSS_TARGET' | 'WEAPP_TW_TARGET', string | undefined>>;
export interface UniPlatformInfo {
raw: string | undefined;
normalized: string | undefined;
isApp: boolean;
isAppAndroid: boolean;
isAppHarmony: boolean;
isAppIos: boolean;
isMp: boolean;
isWeb: boolean;
}
export interface HBuilderXRuntimeHints {
cwd?: string | undefined;
env?: FrameworkEnv | undefined;
nodePath?: string | null | undefined;
}
export interface PackageJsonLike {
'dependencies'?: Record<string, string> | undefined;
'devDependencies'?: Record<string, string> | undefined;
'peerDependencies'?: Record<string, string> | undefined;
'optionalDependencies'?: Record<string, string> | undefined;
'scripts'?: Record<string, string> | undefined;
'uni-app'?: unknown;
}
export interface UniAppManifestLike {
'uni-app-x'?: unknown;
}
export interface DetectAppTypeOptions {
root?: string | undefined;
packageJson?: PackageJsonLike | undefined;
manifest?: UniAppManifestLike | undefined;
searchUp?: boolean | undefined;
env?: FrameworkEnv | undefined;
detectEnv?: boolean | undefined;
cwd?: string | undefined;
hbuilderxVite?: boolean | undefined;
}
export declare function isRunningInHBuilderX(options?: HBuilderXRuntimeHints): boolean;
export declare function resolvePlatform(value: string | undefined): UniPlatformInfo;
export declare function resolveTaroPlatform(value?: string | undefined): UniPlatformInfo;
export declare function resolveMpxPlatform(value?: string | undefined): UniPlatformInfo;
export declare function resolveUniPlatform(value?: string | undefined): UniPlatformInfo;
export declare function resolveUniUtsPlatform(value?: string | undefined): UniPlatformInfo;
export declare function resolveUniAppXPlatform(value?: string | undefined): UniPlatformInfo;
export declare function resolveUniPlatformsFromEnv(env?: FrameworkEnv): {
uniPlatform: UniPlatformInfo;
uniAppXPlatform: UniPlatformInfo;
uniUtsPlatform: UniPlatformInfo;
};
export declare function detectAppTypeFromEnv(env?: FrameworkEnv, options?: {
cwd?: string | undefined;
hbuilderxVite?: boolean | undefined;
}): DetectableAppType | undefined;
export declare function isWeappVitePackage(pkg: PackageJsonLike): boolean;
export declare function isMpxPackage(pkg: PackageJsonLike): boolean;
export declare function isTaroPackage(pkg: PackageJsonLike): boolean;
export declare function isUniAppVitePackage(pkg: PackageJsonLike): boolean;
export declare function isUniAppXPackage(pkg: PackageJsonLike): boolean;
export declare function isUniAppPackage(pkg: PackageJsonLike): boolean;
export declare function isUniAppXManifest(manifest: UniAppManifestLike | undefined): boolean;
export declare function detectAppTypeFromPackageJson(pkg: PackageJsonLike): DetectableAppType | undefined;
export declare function detectAppType(options?: DetectAppTypeOptions): DetectableAppType | undefined;
export declare const resolveImplicitAppTypeFromViteRoot: (root: string) => DetectableAppType | undefined;