{"version":3,"file":"flat-dts.plugin.cjs","sources":["../src/plugin.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * @module Module rollup-plugin-flat-dts\n */\nimport type { OutputPlugin } from 'rollup';\nimport type { FlatDts } from './api';\nimport { emitFlatDts } from './api';\n\nexport type { FlatDts };\n\n/**\n * Creates type definitions flattening plugin instance.\n *\n * @param dtsOptions - Type definition flattening options.\n *\n * @returns Rollup output plugin instance.\n */\nexport default function flatDtsPlugin(dtsOptions?: FlatDts.Options): OutputPlugin {\n  return {\n\n    name: 'flat-dts',\n\n    async generateBundle(): Promise<void> {\n\n      const dts = await emitFlatDts(dtsOptions);\n\n      if (dts.diagnostics.length) {\n        this.error(dts.formatDiagnostics());\n      }\n\n      dts.files.forEach(({ path, content }) => {\n        this.emitFile({\n          type: 'asset',\n          fileName: path,\n          source: content,\n        });\n      });\n    },\n  };\n}\n"],"names":["emitFlatDts"],"mappings":";;;;AAUA;;;;;;;SAOwB,aAAa,CAAC,UAA4B;IAChE,OAAO;QAEL,IAAI,EAAE,UAAU;QAEhB,MAAM,cAAc;YAElB,MAAM,GAAG,GAAG,MAAMA,uBAAW,CAAC,UAAU,CAAC,CAAC;YAE1C,IAAI,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE;gBAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;aACrC;YAED,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;gBAClC,IAAI,CAAC,QAAQ,CAAC;oBACZ,IAAI,EAAE,OAAO;oBACb,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,OAAO;iBAChB,CAAC,CAAC;aACJ,CAAC,CAAC;SACJ;KACF,CAAC;AACJ;;;;"}