1{"version":3,"file":"AssetContents.js","names":["createContentsJsonItem","item","writeContentsJsonAsync","directory","images","fs","ensureDir","writeFile","join","JSON","stringify","info","version","author"],"sources":["../../../src/plugins/icons/AssetContents.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { join } from 'path';\n\nexport type ContentsJsonImageIdiom = 'iphone' | 'ipad' | 'ios-marketing' | 'universal';\n\nexport type ContentsJsonImageAppearance = {\n  appearance: 'luminosity';\n  value: 'dark';\n};\n\nexport type ContentsJsonImageScale = '1x' | '2x' | '3x';\n\nexport interface ContentsJsonImage {\n  appearances?: ContentsJsonImageAppearance[];\n  idiom: ContentsJsonImageIdiom;\n  size?: string;\n  scale: ContentsJsonImageScale;\n  filename?: string;\n}\n\nexport interface ContentsJson {\n  images: ContentsJsonImage[];\n  info: {\n    version: number;\n    author: string;\n  };\n}\n\nexport function createContentsJsonItem(item: ContentsJsonImage): ContentsJsonImage {\n  return item;\n}\n\n/**\n * Writes the Config.json which is used to assign images to their respective platform, dpi, and idiom.\n *\n * @param directory path to add the Contents.json to.\n * @param contents image json data\n */\nexport async function writeContentsJsonAsync(\n  directory: string,\n  { images }: Pick<ContentsJson, 'images'>\n): Promise<void> {\n  await fs.ensureDir(directory);\n\n  await fs.writeFile(\n    join(directory, 'Contents.json'),\n    JSON.stringify(\n      {\n        images,\n        info: {\n          version: 1,\n          // common practice is for the tool that generated the icons to be the \"author\"\n          author: 'expo',\n        },\n      },\n      null,\n      2\n    )\n  );\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AA2BO,SAASA,sBAAT,CAAgCC,IAAhC,EAA4E;EACjF,OAAOA,IAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,eAAeC,sBAAf,CACLC,SADK,EAEL;EAAEC;AAAF,CAFK,EAGU;EACf,MAAMC,kBAAA,CAAGC,SAAH,CAAaH,SAAb,CAAN;EAEA,MAAME,kBAAA,CAAGE,SAAH,CACJ,IAAAC,YAAA,EAAKL,SAAL,EAAgB,eAAhB,CADI,EAEJM,IAAI,CAACC,SAAL,CACE;IACEN,MADF;IAEEO,IAAI,EAAE;MACJC,OAAO,EAAE,CADL;MAEJ;MACAC,MAAM,EAAE;IAHJ;EAFR,CADF,EASE,IATF,EAUE,CAVF,CAFI,CAAN;AAeD"}