diff --git a/change/@minecraft-markup-generators-plugin-271b1c33-117a-4023-8fb9-46c8df6cbce6.json b/change/@minecraft-markup-generators-plugin-271b1c33-117a-4023-8fb9-46c8df6cbce6.json new file mode 100644 index 0000000..d0e16a7 --- /dev/null +++ b/change/@minecraft-markup-generators-plugin-271b1c33-117a-4023-8fb9-46c8df6cbce6.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Fixed an issue where optional type information wasn't properly conveyed when inside an Record type.", + "packageName": "@minecraft/markup-generators-plugin", + "email": "alexander.denford@skyboxlabs.com", + "dependentChangeType": "patch" +} diff --git a/tools/api-docs-generator-test-snapshots/test/optionals/__snapshots__/optionals.spec.ts.snap b/tools/api-docs-generator-test-snapshots/test/optionals/__snapshots__/optionals.spec.ts.snap index 44f1ff0..14730b9 100644 --- a/tools/api-docs-generator-test-snapshots/test/optionals/__snapshots__/optionals.spec.ts.snap +++ b/tools/api-docs-generator-test-snapshots/test/optionals/__snapshots__/optionals.spec.ts.snap @@ -41,6 +41,7 @@ Notes: ## Methods - [methodThatReturnsOptional](#methodthatreturnsoptional) - [methodThatTakesOptionals](#methodthattakesoptionals) +- [methodThatTakesRecordOfOptionalVariants](#methodthattakesrecordofoptionalvariants) - [methodWithDefaultValuesAreOptional](#methodwithdefaultvaluesareoptional) ### **methodThatReturnsOptional** @@ -67,6 +68,19 @@ methodThatTakesOptionals(arg1?: boolean, arg2?: string): void Notes: - This function can't be called in read-only mode. +### **methodThatTakesRecordOfOptionalVariants** +\` +methodThatTakesRecordOfOptionalVariants(values: Record): void +\` + +#### **Parameters** +- **values**: Record<*string*, *boolean* | *number* | *string* | *undefined*> + +**Returns** *void* + +Notes: +- This function can't be called in read-only mode. + ### **methodWithDefaultValuesAreOptional** \` methodWithDefaultValuesAreOptional(defaultIs1?: number, defaultIs0?: number, defaultIsFalse?: boolean, defaultIsString?: string, defaultIsArray?: number[]): void @@ -205,6 +219,12 @@ export class ClassWithOptionals { * */ methodThatTakesOptionals(arg1?: boolean, arg2?: string): void; + /** + * @remarks + * This function can't be called in read-only mode. + * + */ + methodThatTakesRecordOfOptionalVariants(values: Record): void; /** * @remarks * This function can't be called in read-only mode. diff --git a/tools/api-docs-generator-test-snapshots/test/optionals/input/test-module.json b/tools/api-docs-generator-test-snapshots/test/optionals/input/test-module.json index 1e4aded..743e661 100644 --- a/tools/api-docs-generator-test-snapshots/test/optionals/input/test-module.json +++ b/tools/api-docs-generator-test-snapshots/test/optionals/input/test-module.json @@ -4,6 +4,71 @@ "base_types": [], "constants": [], "functions": [ + { + "arguments": [ + { + "details": null, + "name": "values", + "type": { + "is_bind_type": true, + "is_errorable": false, + "key_type": { + "is_bind_type": false, + "is_errorable": false, + "name": "string" + }, + "name": "map", + "value_type": { + "is_bind_type": true, + "is_errorable": false, + "name": "optional", + "optional_type": { + "is_bind_type": false, + "is_errorable": false, + "name": "variant", + "variant_types": [ + { + "is_bind_type": false, + "is_errorable": false, + "name": "boolean" + }, + { + "is_bind_type": false, + "is_errorable": false, + "name": "double", + "valid_range": { + "max": 2147483647, + "min": -2147483648 + } + }, + { + "is_bind_type": false, + "is_errorable": false, + "name": "float", + "valid_range": { + "max": 2147483647, + "min": -2147483648 + } + }, + { + "is_bind_type": false, + "is_errorable": false, + "name": "string" + } + ] + } + } + } + } + ], + "is_constructor": false, + "name": "methodThatTakesRecordOfOptionalVariants", + "return_type": { + "is_bind_type": false, + "is_errorable": false, + "name": "void" + } + }, { "arguments": [], "is_constructor": false, diff --git a/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/__snapshots__/recordOfOptionalVariants.spec.ts.snap b/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/__snapshots__/recordOfOptionalVariants.spec.ts.snap new file mode 100644 index 0000000..a71d096 --- /dev/null +++ b/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/__snapshots__/recordOfOptionalVariants.spec.ts.snap @@ -0,0 +1,99 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Record of Optional Variants > Generates correct output for record of optional variants > # Of Files Generated 1`] = `4`; + +exports[`Record of Optional Variants > Generates correct output for record of optional variants > msdocs/scriptapi/TOC.yml 1`] = ` +" - name: exampleMember + items: + - name: exampleMember + href: examplemember/examplemember.md + - name: ClassWithRecordOfOptionalVariantsProperty + href: examplemember/ClassWithRecordOfOptionalVariantsProperty.md +" +`; + +exports[`Record of Optional Variants > Generates correct output for record of optional variants > msdocs/scriptapi/examplemember/ClassWithRecordOfOptionalVariantsProperty.md 1`] = ` +"--- +# DO NOT TOUCH — This file was automatically generated by @minecraft/api-docs-generator, to report problems file an issue at https://github.com/Mojang/minecraft-scripting-libraries +author: jakeshirley +ms.author: jashir +ms.service: minecraft-bedrock-edition +ms.date: 02/10/2025 +title: examplemember.ClassWithRecordOfOptionalVariantsProperty Class +description: Contents of the exampleMember.ClassWithRecordOfOptionalVariantsProperty class. +--- +# ClassWithRecordOfOptionalVariantsProperty Class + +## Properties + +### **exampleMember** +\`exampleMember?: Record;\` + +Type: Record<*string*, *boolean* | *number* | *string* | *undefined*> + +Notes: + - This property can't be used in read-only mode. +" +`; + +exports[`Record of Optional Variants > Generates correct output for record of optional variants > msdocs/scriptapi/examplemember/examplemember.md 1`] = ` +"--- +# DO NOT TOUCH — This file was automatically generated by @minecraft/api-docs-generator, to report problems file an issue at https://github.com/Mojang/minecraft-scripting-libraries +author: jakeshirley +ms.author: jashir +ms.service: minecraft-bedrock-edition +ms.date: 02/10/2025 +title: examplemember Module +description: Contents of the exampleMember module +--- +# \`exampleMember\` Module + +## Manifest Details +\`\`\`json +{ + "module_name": "exampleMember", + "version": "1.0.0" +} +\`\`\` +This is version 1.x.x of this module, which is the latest as of version 1.0.0 of Minecraft. + +## Available Versions +- \`1.0.0\` + +## Classes +- [ClassWithRecordOfOptionalVariantsProperty](ClassWithRecordOfOptionalVariantsProperty.md) +" +`; + +exports[`Record of Optional Variants > Generates correct output for record of optional variants > typescript/exampleMember@1.0.0.d.ts 1`] = ` +"// Type definitions for Minecraft Bedrock Edition script APIs +// Project: https://docs.microsoft.com/minecraft/creator/ +// Definitions by: Jake Shirley +// Mike Ammerlaan + +/* ***************************************************************************** + Copyright (c) Microsoft Corporation. + ***************************************************************************** */ +/** + * @packageDocumentation + * + * Manifest Details + * \`\`\`json + * { + * "module_name": "exampleMember", + * "version": "1.0.0" + * } + * \`\`\` + * + */ +export class ClassWithRecordOfOptionalVariantsProperty { + private constructor(); + /** + * @remarks + * This property can't be used in read-only mode. + * + */ + exampleMember?: Record; +} +" +`; diff --git a/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/docs/sentinel b/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/docs/sentinel new file mode 100644 index 0000000..a5e30b1 --- /dev/null +++ b/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/docs/sentinel @@ -0,0 +1 @@ +// File exists to ensure docs folder exists diff --git a/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/input/test-script-module.json b/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/input/test-script-module.json new file mode 100644 index 0000000..d03a7b6 --- /dev/null +++ b/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/input/test-script-module.json @@ -0,0 +1,72 @@ +{ + "classes": [ + { + "base_types": [], + "constants": [], + "functions": [], + "name": "ClassWithRecordOfOptionalVariantsProperty", + "properties": [ + { + "is_read_only": false, + "name": "exampleMember", + "type": { + "is_bind_type": false, + "is_errorable": false, + "name": "optional", + "optional_type": { + "key_type": { + "is_bind_type": false, + "is_errorable": false, + "name": "string" + }, + "value_type": { + "is_bind_type": false, + "is_errorable": false, + "name": "optional", + "optional_type": { + "is_bind_type": false, + "is_errorable": false, + "name": "variant", + "variant_types": [ + { + "is_bind_type": false, + "is_errorable": false, + "name": "boolean" + }, + { + "is_bind_type": false, + "is_errorable": false, + "name": "float", + "valid_range": { + "max": 2147483647, + "min": -2147483648 + } + }, + { + "is_bind_type": false, + "is_errorable": false, + "name": "string" + } + ] + } + }, + "is_bind_type": false, + "is_errorable": false, + "name": "map" + } + } + } + ], + "type": { + "is_bind_type": true, + "is_errorable": false, + "name": "ClassWithRecordOfOptionalVariantsProperty" + } + } + ], + "minecraft_version": "1.0.0", + "name": "exampleMember", + "uuid": "93faf953-0173-44dc-b542-b48f4fea7c4b", + "version": "1.0.0", + "module_type": "script" +} \ No newline at end of file diff --git a/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/recordOfOptionalVariants.spec.ts b/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/recordOfOptionalVariants.spec.ts new file mode 100644 index 0000000..9fdb1a7 --- /dev/null +++ b/tools/api-docs-generator-test-snapshots/test/record_of_optional_variants/recordOfOptionalVariants.spec.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it } from 'vitest'; +import { runGeneratorForTest } from '../runGeneratorForTest'; + +describe('Record of Optional Variants', () => { + it('Generates correct output for record of optional variants', () => { + runGeneratorForTest({ + testDir: __dirname, + generators: ['ts', 'msdocs'], + }); + }); +}); diff --git a/tools/markup-generators-plugin/templates/msdocs/script/type_with_links.mustache b/tools/markup-generators-plugin/templates/msdocs/script/type_with_links.mustache index 02b495d..95806ed 100644 --- a/tools/markup-generators-plugin/templates/msdocs/script/type_with_links.mustache +++ b/tools/markup-generators-plugin/templates/msdocs/script/type_with_links.mustache @@ -1 +1 @@ -{{#is_void_return}}*void*{{/is_void_return}}{{^is_void_return}}{{#is_data_buffer}}{{#data_buffer_type}}[{{> type}}](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/{{> type}}){{/data_buffer_type}}{{/is_data_buffer}}{{^is_data_buffer}}{{#is_generator}}Generator<{{#generator_type}}{{#yield_type}}{{> type_with_links}}{{/yield_type}}, {{#return_type}}{{> type_with_links}}{{/return_type}}, {{#next_type}}{{> type_with_links}}{{/next_type}}{{/generator_type}}>{{/is_generator}}{{^is_generator}}{{#is_map}}Record<{{#key_type}}{{> type_with_links}}{{/key_type}}, {{#value_type}}{{> type_with_links}}{{/value_type}}>{{/is_map}}{{^is_map}}{{#is_iterator_result}}IteratorResult<{{#iterator_type}}{{> type_with_links}}{{/iterator_type}}>{{/is_iterator_result}}{{^is_iterator_result}}{{#is_iterator}}Iterator<{{#iterator_type}}{{> type_with_links}}{{/iterator_type}}>{{/is_iterator}}{{^is_iterator}}{{#is_optional_type}}{{#optional_type}}{{> type_with_links}}{{/optional_type}}{{/is_optional_type}}{{^is_optional_type}}{{#is_variant}}{{#variant_types}}{{> type_with_links}}{{^is_last}} | {{/is_last}}{{/variant_types}}{{/is_variant}}{{^is_variant}}{{#is_promise}}Promise<{{#promise_type}}{{> type_with_links}}{{/promise_type}}>{{/is_promise}}{{^is_promise}}{{#is_array}}{{#element_type}}{{#is_optional_type}}{{#optional_type}}({{/optional_type}}{{/is_optional_type}}{{#is_variant}}({{/is_variant}}{{> type_with_links}}{{#is_optional_type}}{{#optional_type}} | *undefined*){{/optional_type}}{{/is_optional_type}}{{#is_variant}}){{/is_variant}}[]{{/element_type}}{{/is_array}}{{^is_array}}{{#is_undefined}}*undefined*{{/is_undefined}}{{^is_undefined}}{{#is_closure}}{{#closure_type}}({{#argument_types}}arg{{index}}: {{> type_with_links}}{{^is_last}}, {{/is_last}}{{/argument_types}}) => {{#return_type}}{{#is_variant}}({{/is_variant}}{{> type_with_links}}{{#is_variant}}){{/is_variant}}{{/return_type}}{{/closure_type}}{{^closure_type}}() => void{{/closure_type}}{{/is_closure}}{{^is_closure}}{{#argument_valid_values.length}}{{#argument_valid_values}}`'{{argument_valid_value}}'`{{^argument_valid_value_end}}, {{/argument_valid_value_end}}{{/argument_valid_values}}{{/argument_valid_values.length}}{{^argument_valid_values}}{{#is_bind_type}}[{{/is_bind_type}}*{{#from_module.is_external_module}}{{{from_module.name}}}.{{/from_module.is_external_module}}{{{name}}}*{{#is_bind_type}}]({{#from_module.is_external_module}}../../../{{{from_module.folder_path}}}/{{{from_module.filepath_name}}}/{{/from_module.is_external_module}}{{{name}}}.md){{/is_bind_type}}{{/argument_valid_values}}{{/is_closure}}{{/is_undefined}}{{/is_array}}{{/is_promise}}{{/is_variant}}{{/is_optional_type}}{{/is_iterator}}{{/is_iterator_result}}{{/is_map}}{{/is_generator}}{{/is_data_buffer}}{{/is_void_return}} \ No newline at end of file +{{#is_void_return}}*void*{{/is_void_return}}{{^is_void_return}}{{#is_data_buffer}}{{#data_buffer_type}}[{{> type}}](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/{{> type}}){{/data_buffer_type}}{{/is_data_buffer}}{{^is_data_buffer}}{{#is_generator}}Generator<{{#generator_type}}{{#yield_type}}{{> type_with_links}}{{/yield_type}}, {{#return_type}}{{> type_with_links}}{{/return_type}}, {{#next_type}}{{> type_with_links}}{{/next_type}}{{/generator_type}}>{{/is_generator}}{{^is_generator}}{{#is_map}}Record<{{#key_type}}{{> type_with_links}}{{/key_type}}, {{#value_type}}{{> type_with_links}}{{#is_optional_type}}{{#optional_type}} | *undefined*{{/optional_type}}{{/is_optional_type}}{{/value_type}}>{{/is_map}}{{^is_map}}{{#is_iterator_result}}IteratorResult<{{#iterator_type}}{{> type_with_links}}{{/iterator_type}}>{{/is_iterator_result}}{{^is_iterator_result}}{{#is_iterator}}Iterator<{{#iterator_type}}{{> type_with_links}}{{/iterator_type}}>{{/is_iterator}}{{^is_iterator}}{{#is_optional_type}}{{#optional_type}}{{> type_with_links}}{{/optional_type}}{{/is_optional_type}}{{^is_optional_type}}{{#is_variant}}{{#variant_types}}{{> type_with_links}}{{^is_last}} | {{/is_last}}{{/variant_types}}{{/is_variant}}{{^is_variant}}{{#is_promise}}Promise<{{#promise_type}}{{> type_with_links}}{{/promise_type}}>{{/is_promise}}{{^is_promise}}{{#is_array}}{{#element_type}}{{#is_optional_type}}{{#optional_type}}({{/optional_type}}{{/is_optional_type}}{{#is_variant}}({{/is_variant}}{{> type_with_links}}{{#is_optional_type}}{{#optional_type}} | *undefined*){{/optional_type}}{{/is_optional_type}}{{#is_variant}}){{/is_variant}}[]{{/element_type}}{{/is_array}}{{^is_array}}{{#is_undefined}}*undefined*{{/is_undefined}}{{^is_undefined}}{{#is_closure}}{{#closure_type}}({{#argument_types}}arg{{index}}: {{> type_with_links}}{{^is_last}}, {{/is_last}}{{/argument_types}}) => {{#return_type}}{{#is_variant}}({{/is_variant}}{{> type_with_links}}{{#is_variant}}){{/is_variant}}{{/return_type}}{{/closure_type}}{{^closure_type}}() => void{{/closure_type}}{{/is_closure}}{{^is_closure}}{{#argument_valid_values.length}}{{#argument_valid_values}}`'{{argument_valid_value}}'`{{^argument_valid_value_end}}, {{/argument_valid_value_end}}{{/argument_valid_values}}{{/argument_valid_values.length}}{{^argument_valid_values}}{{#is_bind_type}}[{{/is_bind_type}}*{{#from_module.is_external_module}}{{{from_module.name}}}.{{/from_module.is_external_module}}{{{name}}}*{{#is_bind_type}}]({{#from_module.is_external_module}}../../../{{{from_module.folder_path}}}/{{{from_module.filepath_name}}}/{{/from_module.is_external_module}}{{{name}}}.md){{/is_bind_type}}{{/argument_valid_values}}{{/is_closure}}{{/is_undefined}}{{/is_array}}{{/is_promise}}{{/is_variant}}{{/is_optional_type}}{{/is_iterator}}{{/is_iterator_result}}{{/is_map}}{{/is_generator}}{{/is_data_buffer}}{{/is_void_return}} \ No newline at end of file diff --git a/tools/markup-generators-plugin/templates/tsdef/type.mustache b/tools/markup-generators-plugin/templates/tsdef/type.mustache index f586e48..18cb632 100644 --- a/tools/markup-generators-plugin/templates/tsdef/type.mustache +++ b/tools/markup-generators-plugin/templates/tsdef/type.mustache @@ -1 +1 @@ -{{#is_void_return}}void{{/is_void_return}}{{^is_void_return}}{{#is_data_buffer}}{{#data_buffer_type}}{{> type}}{{/data_buffer_type}}{{/is_data_buffer}}{{^is_data_buffer}}{{#is_generator}}Generator<{{#generator_type}}{{#yield_type}}{{> type}}{{/yield_type}}, {{#return_type}}{{> type}}{{/return_type}}, {{#next_type}}{{> type}}{{/next_type}}{{/generator_type}}>{{/is_generator}}{{^is_generator}}{{#is_map}}Record<{{#key_type}}{{> type}}{{/key_type}}, {{#value_type}}{{> type}}{{/value_type}}>{{/is_map}}{{^is_map}}{{#is_iterator_result}}IteratorResult<{{#iterator_type}}{{> type}}{{/iterator_type}}>{{/is_iterator_result}}{{^is_iterator_result}}{{#is_iterator}}Iterator<{{#iterator_type}}{{> type}}{{/iterator_type}}>{{/is_iterator}}{{^is_iterator}}{{#is_optional_type}}{{#optional_type}}{{> type}}{{/optional_type}}{{/is_optional_type}}{{^is_optional_type}}{{#is_variant}}{{#variant_types}}{{> type}}{{^is_last}} | {{/is_last}}{{/variant_types}}{{/is_variant}}{{^is_variant}}{{#is_promise}}Promise<{{#promise_type}}{{> type}}{{/promise_type}}>{{/is_promise}}{{^is_promise}}{{#is_any}}any{{/is_any}}{{^is_any}}{{#is_array}}{{#element_type}}{{#is_optional_type}}{{#optional_type}}({{/optional_type}}{{/is_optional_type}}{{#is_variant}}({{/is_variant}}{{> type}}{{#is_optional_type}}{{#optional_type}} | undefined){{/optional_type}}{{/is_optional_type}}{{#is_variant}}){{/is_variant}}{{/element_type}}[]{{/is_array}}{{^is_array}}{{#is_closure}}{{#closure_type}}({{#argument_types}}arg{{index}}: {{> type}}{{^is_last}}, {{/is_last}}{{/argument_types}}) => {{#return_type}}{{#is_variant}}({{/is_variant}}{{> type}}{{#is_variant}}){{/is_variant}}{{/return_type}}{{/closure_type}}{{^closure_type}}() => void{{/closure_type}}{{/is_closure}}{{^is_closure}}{{#argument_valid_values.length}}({{#argument_valid_values}}'{{argument_valid_value}}'{{^argument_valid_value_end}}|{{/argument_valid_value_end}}{{/argument_valid_values}}){{/argument_valid_values.length}}{{^argument_valid_values}}{{#is_undefined}}undefined{{/is_undefined}}{{^is_undefined}}{{#from_module.is_external_module}}{{from_module.variable_name}}.{{/from_module.is_external_module}}{{{name}}}{{/is_undefined}}{{/argument_valid_values}}{{/is_closure}}{{/is_array}}{{/is_any}}{{/is_promise}}{{/is_variant}}{{/is_optional_type}}{{/is_iterator}}{{/is_iterator_result}}{{/is_map}}{{/is_generator}}{{/is_data_buffer}}{{/is_void_return}} \ No newline at end of file +{{#is_void_return}}void{{/is_void_return}}{{^is_void_return}}{{#is_data_buffer}}{{#data_buffer_type}}{{> type}}{{/data_buffer_type}}{{/is_data_buffer}}{{^is_data_buffer}}{{#is_generator}}Generator<{{#generator_type}}{{#yield_type}}{{> type}}{{/yield_type}}, {{#return_type}}{{> type}}{{/return_type}}, {{#next_type}}{{> type}}{{/next_type}}{{/generator_type}}>{{/is_generator}}{{^is_generator}}{{#is_map}}Record<{{#key_type}}{{> type}}{{/key_type}}, {{#value_type}}{{> type}}{{#is_optional_type}}{{#optional_type}} | undefined{{/optional_type}}{{/is_optional_type}}{{/value_type}}>{{/is_map}}{{^is_map}}{{#is_iterator_result}}IteratorResult<{{#iterator_type}}{{> type}}{{/iterator_type}}>{{/is_iterator_result}}{{^is_iterator_result}}{{#is_iterator}}Iterator<{{#iterator_type}}{{> type}}{{/iterator_type}}>{{/is_iterator}}{{^is_iterator}}{{#is_optional_type}}{{#optional_type}}{{> type}}{{/optional_type}}{{/is_optional_type}}{{^is_optional_type}}{{#is_variant}}{{#variant_types}}{{> type}}{{^is_last}} | {{/is_last}}{{/variant_types}}{{/is_variant}}{{^is_variant}}{{#is_promise}}Promise<{{#promise_type}}{{> type}}{{/promise_type}}>{{/is_promise}}{{^is_promise}}{{#is_any}}any{{/is_any}}{{^is_any}}{{#is_array}}{{#element_type}}{{#is_optional_type}}{{#optional_type}}({{/optional_type}}{{/is_optional_type}}{{#is_variant}}({{/is_variant}}{{> type}}{{#is_optional_type}}{{#optional_type}} | undefined){{/optional_type}}{{/is_optional_type}}{{#is_variant}}){{/is_variant}}{{/element_type}}[]{{/is_array}}{{^is_array}}{{#is_closure}}{{#closure_type}}({{#argument_types}}arg{{index}}: {{> type}}{{^is_last}}, {{/is_last}}{{/argument_types}}) => {{#return_type}}{{#is_variant}}({{/is_variant}}{{> type}}{{#is_variant}}){{/is_variant}}{{/return_type}}{{/closure_type}}{{^closure_type}}() => void{{/closure_type}}{{/is_closure}}{{^is_closure}}{{#argument_valid_values.length}}({{#argument_valid_values}}'{{argument_valid_value}}'{{^argument_valid_value_end}}|{{/argument_valid_value_end}}{{/argument_valid_values}}){{/argument_valid_values.length}}{{^argument_valid_values}}{{#is_undefined}}undefined{{/is_undefined}}{{^is_undefined}}{{#from_module.is_external_module}}{{from_module.variable_name}}.{{/from_module.is_external_module}}{{{name}}}{{/is_undefined}}{{/argument_valid_values}}{{/is_closure}}{{/is_array}}{{/is_any}}{{/is_promise}}{{/is_variant}}{{/is_optional_type}}{{/is_iterator}}{{/is_iterator_result}}{{/is_map}}{{/is_generator}}{{/is_data_buffer}}{{/is_void_return}} \ No newline at end of file