import { FilterPattern } from "unplugin-utils"; import { Plugin } from "rolldown"; //#region src/options.d.ts type Awaitable = T | Promise; /** * @returns A boolean or a promise that resolves to a boolean, * or `undefined` to let the plugin decide automatically. */ type TransformFn = (id: string, importer: string) => Awaitable; interface Options { include?: FilterPattern; exclude?: FilterPattern; order?: "pre" | "post" | undefined; /** * A function to determine whether a module should be transformed. * Return `true` to force transformation, `false` to skip transformation, * or `undefined` to let the plugin decide automatically. */ shouldTransform?: string[] | TransformFn; } type Overwrite = Pick> & U; type OptionsResolved = Overwrite, Pick & { shouldTransform?: TransformFn; }>; declare function resolveOptions(options: Options): OptionsResolved; //#endregion //#region src/index.d.ts declare function RequireCJS(userOptions?: Options): Plugin; declare function isPureCJS(id: string, importer: string): Promise; //#endregion export { Options, OptionsResolved, RequireCJS, TransformFn, isPureCJS, resolveOptions };