🏷️ typing

This commit is contained in:
ful1e5 2020-08-16 16:55:31 +05:30
parent 2ae0f8ea65
commit f9ba957ee6

View file

@ -4,14 +4,14 @@ import rimraf from "rimraf";
import { staticCursors, animatedCursors, animatedClip } from "../cursors.json"; import { staticCursors, animatedCursors, animatedClip } from "../cursors.json";
import { schemesPath } from "../config"; import { schemesPath } from "../config";
import { ColorSchema, Config } from "../types"; import { ColorSchema, Configs } from "../types";
const generateConfigs = ( const generateConfigs = (
colorSchemes: ColorSchema, colorSchemes: ColorSchema,
dirPrefix: string, dirPrefix: string,
rawSvgsDir: string rawSvgsDir: string
) => { ) => {
const configs: Array<Config> = []; const configs: Configs = {};
for (let [schema] of Object.entries(colorSchemes)) { for (let [schema] of Object.entries(colorSchemes)) {
const { base, outline } = colorSchemes[schema]; const { base, outline } = colorSchemes[schema];
@ -52,13 +52,13 @@ const generateConfigs = (
); );
if (!fs.existsSync(bitmapsDir)) fs.mkdirSync(bitmapsDir); if (!fs.existsSync(bitmapsDir)) fs.mkdirSync(bitmapsDir);
configs.push({ configs[schema] = {
svgsDir: schemaSvgsPath, svgsDir: schemaSvgsPath,
staticSvgs, staticSvgs,
bitmapsDir, bitmapsDir,
animatedCursors, animatedCursors,
animatedClip animatedClip
}); };
} catch (error) { } catch (error) {
console.error("An error occurred in .svg files generation."); console.error("An error occurred in .svg files generation.");
} }