Add: some type hint

This commit is contained in:
eight 2018-10-13 15:20:10 +08:00
parent 7d340d62dc
commit 8b4ab47d89

View File

@ -14,8 +14,24 @@ to cleanup the temporary code. See /edit/live-preview.js.
*/
const styleManager = (() => {
const preparing = prepare();
/* styleId => {
data: styleData,
preview: styleData,
appliesTo: Set<url>
} */
const styles = new Map();
/* url => {
maybeMatch: Set<styleId>,
sections: Object<styleId => {
id: styleId,
enabled: Boolean,
code: String
}>
} */
const cachedStyleForUrl = createCache();
const BAD_MATCHER = {test: () => false};
const compileRe = createCompiler(text => `^(${text})$`);
const compileSloppyRe = createCompiler(text => `^${text}$`);