chromium/mojo/public/tools/bindings/generators/js_templates/lite/module_definition.tmpl

{#--- Constants #}
{%- for constant in module.constants %}
{%  if generate_closure_exports -%}
goog.provide('{{module.namespace}}.{{constant.name}}');

{%- endif %}
/**
 * @const { {{constant.kind|lite_closure_type_with_nullability}} }
 * @export
 */
{{module.namespace}}.{{constant.name}} = {{constant|constant_value}};
{%- endfor %}

{#--- Enums #}
{% from "lite/enum_definition.tmpl" import enum_def with context %}
{%- for enum in enums %}
{{enum_def(module.namespace, module.namespace, enum)}}
{%  endfor %}

{#--- Interface definitions #}
{%- for interface in interfaces %}
{%   include "lite/interface_definition.tmpl" %}
{%- endfor %}

{#--- Struct and Union forward declarations #}
{# Note that we do an evil type cast here because we know that
 # mojo.internal.Struct and mojo.internal.Union will fix-up the object
 # appropriately, and we don't want Closure to complain. #}
{%  for struct in structs %}
{%  if generate_closure_exports -%}
goog.provide('{{module.namespace}}.{{struct.name}}Spec');
{%- endif %}
/**
 * @const { {$:!mojo.internal.MojomType}}
 * @export
 */
{{module.namespace}}.{{struct.name}}Spec =
    { $: /** @type {!mojo.internal.MojomType} */ ({}) };
{% endfor %}
{%- for union in unions %}
{%  if generate_closure_exports -%}
goog.provide('{{module.namespace}}.{{union.name}}Spec');
{%- endif %}
/**
 * @const { {$:!mojo.internal.MojomType} }
 * @export
 */
{{module.namespace}}.{{union.name}}Spec =
    { $: /** @type {!mojo.internal.MojomType} */ ({}) };
{% endfor %}

{#--- Struct definitions #}
{%  for struct in structs %}
{%-   include "lite/struct_definition.tmpl" %}
{% endfor -%}

{#--- Union definitions #}
{%  for union in unions %}
{%-   include "lite/union_definition.tmpl" %}
{% endfor %}