import { ParserOptions } from 'oxc-parser'; import { FilterPattern } from 'unplugin-utils'; /** Location shape passed to `transformFileName` (line/column match Babel-style `SourceLocation`). */ interface SourceLocation { start: { line: number; column: number; }; end: { line: number; column: number; }; } interface Options { /** * The include pattern to match files * @default ['.[jt]sx?$'] */ include?: FilterPattern; exclude?: FilterPattern | undefined; /** @default "pre" */ enforce?: "post" | "pre" | undefined; /** Options passed to `oxc-parser` `parseSync` (see [ParserOptions](https://www.npmjs.com/package/oxc-parser)). */ parserOptions?: ParserOptions; /** * The transform function to modify the file name used in the `attributes.at` option */ transformFileName?: (fileName: string, location: SourceLocation) => string; /** * The attributes to add to the JSX element * @default { at: 'data-at', in: 'data-in', kind: 'data-kind' } */ attributes?: { /** * The attribute name to add for the `fileName:lineStart-lineEnd` location * @default 'data-at' * data-source="file.tsx:4-4" */ at?: string | false; /** * The attribute name to add for the file location (only) * @default false * * @example * data-source="4-4" */ loc?: string | false; /** * The attribute name to add for the wrapping component name * @default 'data-in' */ in?: string | false; /** * The attribute name to add for the component kind * @default 'data-kind' */ kind?: string | false; }; } type Overwrite = Pick> & U; type OptionsResolved = Overwrite, { exclude: Options["exclude"]; enforce: Options["enforce"]; attributes: Required["attributes"]>; }>; declare function resolveOption(options: Options): OptionsResolved; export { type Options, type OptionsResolved, type SourceLocation, resolveOption };