1// Copyright 2018 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5{% for declaration in module.namespace|namespace_declarations -%} 6/** @const */ 7{%- if loop.first %} 8var {{declaration}} = {}; 9{% else %} 10{{declaration}} = {}; 11{% endif -%} 12{%- endfor -%} 13 14{#--- Constant definitions #} 15{%- for constant in module.constants %} 16/** @type { {{constant.kind|closure_type_with_nullability }} } */ 17{{module.namespace}}.{{constant.name}}; 18{%- endfor %} 19 20{#--- Enum definitions #} 21{% for enum in enums %} 22/** @enum {number} */ 23{{module.namespace}}.{{enum.name}} = {}; 24{%- for field in enum.fields %} 25{{module.namespace}}.{{enum.name}}.{{field.name}}; 26{%- endfor %} 27{%- endfor %} 28 29{#--- Interface definitions #} 30{%- for interface in interfaces -%} 31{%- include "externs/interface_definition.tmpl" %} 32{% endfor -%} 33 34{#--- Struct definitions #} 35{%- for struct in structs -%} 36{%- include "externs/struct_definition.tmpl" %} 37{% endfor -%} 38