/** * Definition of a lib to transform with SWC, it consists of: * * 1) `path`: the library path e.g. `@/components` * 2) `flat` flag: `true` for packages where all consumable exports are at the * root level (no exports from nested folders), `false` or `undefined` otherwise */ export type SwcTransformingLib = { path: string; flat?: boolean; }; export type SwcTransform = Record<`${Path}/?(((\\$*\\w*)?/?)*)`, { transform: Flat extends true ? `${Path}/{{member}}` : `${Path}/{{ matches.[1] }}/{{member}}`; }>; /** * @category swc * * @see {@link https://rregex.dev/ rust regex playground} * @param path e.g. `@myorg/mylib` or `@/myprojectlib` * @param flat Pass `true` for packages where all consumable exports are at the * root level (no exports from nested folders) */ export declare function swcCreateTransform(lib: TLib): SwcTransform; export default swcCreateTransform;