数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
5.1 KiB

2 years ago
import { P as Preset, I as Import, B as BuiltinPresetName, a as InlinePreset, T as TypeDeclarationOptions, M as MagicStringResult, S as ScanDirExportsOptions, U as UnimportOptions, b as Thenable, c as InjectImportsOptions, d as ImportInjectionResult, e as UnimportMeta, f as UnimportContext, g as InstallGlobalOptions } from './shared/unimport.b55a67ec.js';
export { p as Addon, A as AddonsOptions, k as ImportCommon, j as ImportName, n as InjectionUsageRecord, i as ModuleId, m as PackagePreset, o as PathFromResolver, l as PresetImport, h as builtinPresets } from './shared/unimport.b55a67ec.js';
2 years ago
import MagicString from 'magic-string';
2 years ago
import { StripLiteralOptions } from 'strip-literal';
2 years ago
import * as mlly from 'mlly';
2 years ago
export { vueTemplateAddon } from './addons.js';
2 years ago
declare function resolvePreset(preset: Preset): Promise<Import[]>;
declare function resolveBuiltinPresets(presets: (BuiltinPresetName | Preset)[]): Promise<Import[]>;
declare const excludeRE: RegExp[];
declare const importAsRE: RegExp;
declare const separatorRE: RegExp;
2 years ago
/** | |
* destructing case&ternary non-call inheritance | id |
* | |*/
2 years ago
declare const matchRE: RegExp;
2 years ago
declare function stripCommentsAndStrings(code: string, options?: StripLiteralOptions): string;
2 years ago
declare function defineUnimportPreset(preset: InlinePreset): InlinePreset;
declare function toImports(imports: Import[], isCJS?: boolean): string;
declare function dedupeImports(imports: Import[], warn: (msg: string) => void): Import[];
2 years ago
declare function toExports(imports: Import[], fileDir?: string, includeType?: boolean): string;
2 years ago
declare function toTypeDeclarationItems(imports: Import[], options?: TypeDeclarationOptions): string[];
declare function toTypeDeclarationFile(imports: Import[], options?: TypeDeclarationOptions): string;
declare function toTypeReExports(imports: Import[], options?: TypeDeclarationOptions): string;
declare function getString(code: string | MagicString): string;
declare function getMagicString(code: string | MagicString): MagicString;
2 years ago
declare function addImportToCode(code: string | MagicString, imports: Import[], isCJS?: boolean, mergeExisting?: boolean, injectAtLast?: boolean, firstOccurrence?: number, onResolved?: (imports: Import[]) => void | Import[], onStringified?: (str: string, imports: Import[]) => void | string): MagicStringResult;
2 years ago
declare function normalizeImports(imports: Import[]): Import[];
2 years ago
declare function resolveIdAbsolute(id: string, parentId?: string): Promise<string>;
2 years ago
declare function scanFilesFromDir(dir: string | string[], options?: ScanDirExportsOptions): Promise<string[]>;
declare function scanDirExports(dir: string | string[], options?: ScanDirExportsOptions): Promise<Import[]>;
2 years ago
declare function dedupeDtsExports(exports: Import[]): Import[];
declare function scanExports(filepath: string, includeTypes: boolean, seen?: Set<string>): Promise<Import[]>;
2 years ago
type Unimport = ReturnType<typeof createUnimport>;
declare function createUnimport(opts: Partial<UnimportOptions>): {
init: () => Promise<void>;
clearDynamicImports: () => void;
modifyDynamicImports: (fn: (imports: Import[]) => Thenable<void | Import[]>) => Promise<void>;
scanImportsFromDir: (dirs?: string[], options?: ScanDirExportsOptions | undefined) => Promise<Import[]>;
2 years ago
scanImportsFromFile: (filepath: string, includeTypes?: boolean) => Promise<Import[]>;
2 years ago
getImports: () => Promise<Import[]>;
getImportMap: () => Promise<Map<string, Import>>;
detectImports: (code: string | MagicString) => Promise<{
s: MagicString;
strippedCode: string;
isCJSContext: boolean;
matchedImports: Import[];
firstOccurrence: number;
}>;
injectImports: (code: string | MagicString, id?: string, options?: InjectImportsOptions) => Promise<ImportInjectionResult>;
2 years ago
toExports: (filepath?: string, includeTypes?: boolean) => Promise<string>;
2 years ago
parseVirtualImports: (code: string) => mlly.ParsedStaticImport[];
generateTypeDeclarations: (options?: TypeDeclarationOptions) => Promise<string>;
getMetadata: () => UnimportMeta | undefined;
getInternalContext: () => UnimportContext;
};
declare function installGlobalAutoImports(imports: Import[] | Unimport, options?: InstallGlobalOptions): Promise<any>;
2 years ago
const version = "3.4.0";
export { BuiltinPresetName, Import, ImportInjectionResult, InjectImportsOptions, InlinePreset, InstallGlobalOptions, MagicStringResult, Preset, ScanDirExportsOptions, Thenable, TypeDeclarationOptions, type Unimport, UnimportContext, UnimportMeta, UnimportOptions, addImportToCode, createUnimport, dedupeDtsExports, dedupeImports, defineUnimportPreset, excludeRE, getMagicString, getString, importAsRE, installGlobalAutoImports, matchRE, normalizeImports, resolveBuiltinPresets, resolveIdAbsolute, resolvePreset, scanDirExports, scanExports, scanFilesFromDir, separatorRE, stripCommentsAndStrings, toExports, toImports, toTypeDeclarationFile, toTypeDeclarationItems, toTypeReExports, version };