// @flow //TODO: proper typing //TODO: use webpack to find //TODO: funny sink code //(() => { // const raw = findAll( // (m) => // typeof m === "object" && // Object.values(m).length > 0 && // Object.values(m).every((v) => typeof v === "string") // ); // const map = new Map(); // for (const m of raw) // for (const [k, v] of Object.entries(m)) // if (map.has(k)) map.get(k).push(v); // else map.set(k, [v]); // return map; //})(); function getAllClasses() { return document.styleSheets[0].rules || document.styleSheets[0].cssRules; } function getClassListByName(className) { const classes = getAllClasses(); return classes; } //how to define getters and setters on an object: // //Object.defineProperty(hello, "place", { // set: (x) => { // this.oldPlace = this.place; // this.place = x; // }, // get: (x) => { // console.log( // "Current place: " + this.place + "\nPlace before this: " + this.oldPlace // ); // return this.place; // }, //}); function getProxyObj(classes) {} function init(obj: Object) { obj.demon.css = { classes: { get: (className) => {} } }; } export default { init };