From 76cb9c2a39d477a64824a985ade40507e3bbade1 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 13 Feb 2026 21:34:48 -0800 Subject: feat(vanilla): add testing infrastructure and tests (NK-wjnczv) --- vanilla/node_modules/magicast/dist/helpers.d.ts | 74 +++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 vanilla/node_modules/magicast/dist/helpers.d.ts (limited to 'vanilla/node_modules/magicast/dist/helpers.d.ts') diff --git a/vanilla/node_modules/magicast/dist/helpers.d.ts b/vanilla/node_modules/magicast/dist/helpers.d.ts new file mode 100644 index 0000000..ac18155 --- /dev/null +++ b/vanilla/node_modules/magicast/dist/helpers.d.ts @@ -0,0 +1,74 @@ +import { S as ProxifiedObject, b as ProxifiedModule, c as Proxified, p as ProxifiedFunctionCall } from "./types-r4mG9WUV.js"; +import { VariableDeclarator } from "@babel/types"; + +//#region src/helpers/deep-merge.d.ts +declare function deepMergeObject(magicast: Proxified, object: any): void; +//#endregion +//#region src/helpers/nuxt.d.ts +declare function addNuxtModule(magicast: ProxifiedModule, name: string, optionsKey?: string, options?: any): void; +//#endregion +//#region src/helpers/vite.d.ts +interface AddVitePluginOptions { + /** + * The import path of the plugin + */ + from: string; + /** + * The import name of the plugin + * @default "default" + */ + imported?: string; + /** + * The name of local variable + */ + constructor: string; + /** + * The options of the plugin + */ + options?: Record; + /** + * The index in the plugins array where the plugin should be inserted at. + * By default, the plugin is appended to the array. + */ + index?: number; +} +interface UpdateVitePluginConfigOptions { + /** + * The import path of the plugin + */ + from: string; + /** + * The import name of the plugin + * @default "default" + */ + imported?: string; +} +declare function addVitePlugin(magicast: ProxifiedModule, plugin: AddVitePluginOptions): boolean; +declare function findVitePluginCall(magicast: ProxifiedModule, plugin: UpdateVitePluginConfigOptions | string): ProxifiedFunctionCall | undefined; +declare function updateVitePluginConfig(magicast: ProxifiedModule, plugin: UpdateVitePluginConfigOptions | string, handler: Record | ((args: any[]) => any[])): boolean; +//#endregion +//#region src/helpers/config.d.ts +declare function getDefaultExportOptions(magicast: ProxifiedModule): ProxifiedObject; +/** + * Returns the vite config object from a variable declaration thats + * exported as the default export. + * + * Example: + * + * ```js + * const config = {}; + * export default config; + * ``` + * + * @param magicast the module + * + * @returns an object containing the proxified config object and the + * declaration "parent" to attach the modified config to later. + * If no config declaration is found, undefined is returned. + */ +declare function getConfigFromVariableDeclaration(magicast: ProxifiedModule): { + declaration: VariableDeclarator; + config: ProxifiedObject | undefined; +}; +//#endregion +export { AddVitePluginOptions, UpdateVitePluginConfigOptions, addNuxtModule, addVitePlugin, deepMergeObject, findVitePluginCall, getConfigFromVariableDeclaration, getDefaultExportOptions, updateVitePluginConfig }; \ No newline at end of file -- cgit v1.2.3