| 9282 | */ |
| 9283 | var _environments = {}; |
| 9284 | function defineEnvironment(_ref) { |
| 9285 | var type = _ref.type, |
| 9286 | names = _ref.names, |
| 9287 | props = _ref.props, |
| 9288 | handler = _ref.handler, |
| 9289 | htmlBuilder = _ref.htmlBuilder, |
| 9290 | mathmlBuilder = _ref.mathmlBuilder; |
| 9291 | // Set default values of environments. |
| 9292 | var data = { |
| 9293 | type: type, |
| 9294 | numArgs: props.numArgs || 0, |
| 9295 | greediness: 1, |
| 9296 | allowedInText: false, |
| 9297 | numOptionalArgs: 0, |
| 9298 | handler: handler |
| 9299 | }; |
| 9300 | |
| 9301 | for (var i = 0; i < names.length; ++i) { |
| 9302 | // TODO: The value type of _environments should be a type union of all |
| 9303 | // possible `EnvSpec<>` possibilities instead of `EnvSpec<*>`, which is |
| 9304 | // an existential type. |
| 9305 | // $FlowFixMe |
| 9306 | _environments[names[i]] = data; |
| 9307 | } |
| 9308 | |
| 9309 | if (htmlBuilder) { |
| 9310 | _htmlGroupBuilders[type] = htmlBuilder; |
| 9311 | } |
| 9312 | |
| 9313 | if (mathmlBuilder) { |
| 9314 | _mathmlGroupBuilders[type] = mathmlBuilder; |
| 9315 | } |
| 9316 | } |
| 9317 | // CONCATENATED MODULE: ./src/environments/array.js |
| 9318 | |
| 9319 | |