import { MagicString, generateTransform, CodeTransform, MagicStringAST } from 'magic-string-ast'; export * from 'magic-string-ast'; export * from 'ast-kit'; import * as t from '@babel/types'; import { Program, Node } from '@babel/types'; import { ResolvedOptions } from '@vitejs/plugin-vue'; import { Plugin } from 'rollup'; import { Plugin as Plugin$1, HmrContext } from 'vite'; import { SFCScriptBlock as SFCScriptBlock$1, SFCDescriptor, SFCParseResult } from '@vue/compiler-sfc'; declare function checkInvalidScopeReference(node: t.Node | undefined, method: string, setupBindings: string[]): void; declare function isStaticExpression(node: t.Node, options?: Partial & { magicComment?: string }>): boolean; declare function isStaticObjectKey(node: t.ObjectExpression): boolean; /** * @param node must be a static expression, SpreadElement is not supported */ declare function resolveObjectExpression(node: t.ObjectExpression): Record | undefined; declare const HELPER_PREFIX = "__MACROS_"; declare function importHelperFn(s: MagicString, offset: number, local: string, from?: string, isDefault?: boolean): string; declare const DEFINE_PROPS = "defineProps"; declare const DEFINE_PROPS_DOLLAR = "$defineProps"; declare const DEFINE_PROPS_REFS = "definePropsRefs"; declare const DEFINE_EMITS = "defineEmits"; declare const WITH_DEFAULTS = "withDefaults"; declare const DEFINE_OPTIONS = "defineOptions"; declare const DEFINE_MODELS = "defineModels"; declare const DEFINE_MODELS_DOLLAR = "$defineModels"; declare const DEFINE_SETUP_COMPONENT = "defineSetupComponent"; declare const DEFINE_RENDER = "defineRender"; declare const DEFINE_SLOTS = "defineSlots"; declare const DEFINE_STYLEX = "defineStyleX"; declare const DEFINE_PROP = "defineProp"; declare const DEFINE_PROP_DOLLAR = "$defineProp"; declare const DEFINE_EMIT = "defineEmit"; declare const REPO_ISSUE_URL: "https://github.com/vue-macros/vue-macros/issues"; declare const REGEX_SRC_FILE: RegExp; declare const REGEX_SETUP_SFC: RegExp; declare const REGEX_SETUP_SFC_SUB: RegExp; declare const REGEX_VUE_SFC: RegExp; /** webpack only */ declare const REGEX_VUE_SUB: RegExp; /** webpack only */ declare const REGEX_VUE_SUB_SETUP: RegExp; declare const REGEX_NODE_MODULES: RegExp; declare const REGEX_SUPPORTED_EXT: RegExp; declare const VIRTUAL_ID_PREFIX = "/vue-macros"; declare function detectVueVersion(root?: string, defaultVersion?: number): number; /** * A valid `picomatch` glob pattern, or array of patterns. */ type FilterPattern = ReadonlyArray | string | RegExp | null; /** * Constructs a filter function which can be used to determine whether or not * certain modules should be operated upon. * @param include If `include` is omitted or has zero length, filter will return `true` by default. * @param exclude ID must not match any of the `exclude` patterns. * @param options Additional options. * @param options.resolve Optionally resolves the patterns against a directory other than `process.cwd()`. * If a `string` is specified, then the value will be used as the base directory. * Relative paths will be resolved against `process.cwd()` first. * If `false`, then the patterns will not be resolved against any directory. * This can be useful if you want to create a filter for virtual module names. */ declare function createRollupFilter(include?: FilterPattern, exclude?: FilterPattern, options?: { resolve?: string | false | null }): (id: string | unknown) => boolean; declare function toArray(thing: readonly T[] | T | undefined | null): readonly T[]; /** @deprecated use `generateTransform` instead */ declare const getTransformResult: typeof generateTransform; interface FilterOptions { include?: FilterPattern; exclude?: FilterPattern; } declare function createFilter(options: FilterOptions): (id: string | unknown) => boolean; interface VuePluginApi { options: ResolvedOptions; version: string; } declare function getVuePluginApi(plugins: Readonly<(Plugin | Plugin$1)[]> | undefined): VuePluginApi | null; declare enum FilterFileType { /** Vue SFC */ VUE_SFC = 0, /** Vue SFC with `