@minecraft/markup-generators-plugin 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +26 -0
- package/CHANGELOG.md +14 -0
- package/README.md +17 -0
- package/lib/generators/ChangelogJSONGenerator.d.ts +7 -0
- package/lib/generators/ChangelogJSONGenerator.js +46 -0
- package/lib/generators/ChangelogJSONGenerator.js.map +1 -0
- package/lib/generators/ChangelogMDGenerator.d.ts +9 -0
- package/lib/generators/ChangelogMDGenerator.js +54 -0
- package/lib/generators/ChangelogMDGenerator.js.map +1 -0
- package/lib/generators/MSDocsMarkdownGenerator.d.ts +26 -0
- package/lib/generators/MSDocsMarkdownGenerator.js +434 -0
- package/lib/generators/MSDocsMarkdownGenerator.js.map +1 -0
- package/lib/generators/NPMModuleGenerator.d.ts +10 -0
- package/lib/generators/NPMModuleGenerator.js +176 -0
- package/lib/generators/NPMModuleGenerator.js.map +1 -0
- package/lib/generators/TypeDocGenerator.d.ts +8 -0
- package/lib/generators/TypeDocGenerator.js +123 -0
- package/lib/generators/TypeDocGenerator.js.map +1 -0
- package/lib/generators/TypeScriptDefinitionGenerator.d.ts +9 -0
- package/lib/generators/TypeScriptDefinitionGenerator.js +64 -0
- package/lib/generators/TypeScriptDefinitionGenerator.js.map +1 -0
- package/lib/generators/TypeScriptGenerator.d.ts +10 -0
- package/lib/generators/TypeScriptGenerator.js +128 -0
- package/lib/generators/TypeScriptGenerator.js.map +1 -0
- package/lib/generators/index.d.ts +7 -0
- package/lib/generators/index.js +26 -0
- package/lib/generators/index.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/lib/msdocsGeneratorUnitTests.spec.d.ts +1 -0
- package/lib/msdocsGeneratorUnitTests.spec.js +67 -0
- package/lib/msdocsGeneratorUnitTests.spec.js.map +1 -0
- package/package.json +66 -0
- package/templates/msdocs/blocks/block.mustache +18 -0
- package/templates/msdocs/blocks/block_property.mustache +26 -0
- package/templates/msdocs/blocks/default_metadata.mustache +4 -0
- package/templates/msdocs/commands/command.mustache +52 -0
- package/templates/msdocs/commands/default_metadata.mustache +4 -0
- package/templates/msdocs/commands/enum.mustache +25 -0
- package/templates/msdocs/commands/inline_enum.mustache +15 -0
- package/templates/msdocs/commands/overload.mustache +11 -0
- package/templates/msdocs/commands/parameter.mustache +1 -0
- package/templates/msdocs/commands/summary.mustache +21 -0
- package/templates/msdocs/commands/toc.mustache +6 -0
- package/templates/msdocs/script/class.mustache +162 -0
- package/templates/msdocs/script/default_metadata.mustache +5 -0
- package/templates/msdocs/script/enum.mustache +39 -0
- package/templates/msdocs/script/examples.mustache +15 -0
- package/templates/msdocs/script/function.mustache +95 -0
- package/templates/msdocs/script/module.mustache +139 -0
- package/templates/msdocs/script/module_changelog.mustache +235 -0
- package/templates/msdocs/script/property.mustache +81 -0
- package/templates/msdocs/script/property_declaration.mustache +6 -0
- package/templates/msdocs/script/toc.mustache +24 -0
- package/templates/msdocs/script/type_alias.mustache +56 -0
- package/templates/msdocs/script/type_with_links.mustache +1 -0
- package/templates/msdocs/script/value.mustache +1 -0
- package/templates/npm/README.md.mustache +13 -0
- package/templates/npm/package.json.mustache +30 -0
- package/templates/npm/vanilla-data/README.md +3 -0
- package/templates/npm/vanilla-data/bundle.js.mustache +10 -0
- package/templates/npm/vanilla-data/data-package.json.mustache +22 -0
- package/templates/npm/vanilla-data/index.ts.mustache +3 -0
- package/templates/npm/vanilla-data/template.npmignore +1 -0
- package/templates/npm/vanilla-data/tsconfig.json +18 -0
- package/templates/ts/data_items_enum.mustache +13 -0
- package/templates/ts/module.mustache +5 -0
- package/templates/ts/module_header.mustache +9 -0
- package/templates/ts/state_mapping.mustache +50 -0
- package/templates/tsdef/class.mustache +86 -0
- package/templates/tsdef/enum.mustache +32 -0
- package/templates/tsdef/examples.mustache +10 -0
- package/templates/tsdef/function.mustache +98 -0
- package/templates/tsdef/function_argument_declaration.mustache +1 -0
- package/templates/tsdef/function_declaration.mustache +1 -0
- package/templates/tsdef/module.mustache +63 -0
- package/templates/tsdef/module_header.mustache +8 -0
- package/templates/tsdef/property.mustache +99 -0
- package/templates/tsdef/property_declaration.mustache +1 -0
- package/templates/tsdef/type.mustache +1 -0
- package/templates/tsdef/type_alias.mustache +37 -0
- package/templates/tsdef/value.mustache +1 -0
- package/templates/txt/md_changelog.mustache +247 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# @minecraft/vanilla-data
|
|
2
|
+
|
|
3
|
+
This module contains type definitions and enumarations for vanilla content within the game, such as Blocks, Items, Entities, and more. This module is versioned accordingly with Minecraft release and preview versions, and contain the up to date types available in the game.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vanilla Data for Minecraft Bedrock Edition script APIs
|
|
2
|
+
// Project: https://docs.microsoft.com/minecraft/creator/
|
|
3
|
+
// Definitions by: Jake Shirley <https://github.com/JakeShirley>
|
|
4
|
+
// Mike Ammerlaan <https://github.com/mammerla>
|
|
5
|
+
// Raphael Landaverde <https://github.com/rlandav>
|
|
6
|
+
|
|
7
|
+
/* *****************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
***************************************************************************** */
|
|
10
|
+
{{{data}}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@minecraft/vanilla-data",
|
|
3
|
+
"version": "{{{version}}}",
|
|
4
|
+
"description": "Contains types for Minecraft Vanilla Content",
|
|
5
|
+
"exports": "./lib/index.js",
|
|
6
|
+
"types": "./lib/index.d.ts",
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Jake Shirley",
|
|
10
|
+
"email": "jake@xbox.com"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "Mike Ammerlaan",
|
|
14
|
+
"email": "mikeam@microsoft.com"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "Raphael Landaverde",
|
|
18
|
+
"email": "rlandav@microsoft.com"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT"
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"display": "Default",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"module": "ES2022",
|
|
6
|
+
"lib": ["es6"],
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"emitDeclarationOnly": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"target": "esnext",
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"outDir": "lib",
|
|
14
|
+
"skipLibCheck": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*"],
|
|
17
|
+
"exclude": ["lib", "dist", "node_modules"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All possible {{display_name}}
|
|
3
|
+
*/
|
|
4
|
+
export enum {{{display_name}}} {
|
|
5
|
+
{{#data_items}}
|
|
6
|
+
{{standardized_name}} = "{{value}}",
|
|
7
|
+
{{/data_items}}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Union type equivalent of the {{display_name}} enum.
|
|
12
|
+
*/
|
|
13
|
+
export type {{display_name}}Union = keyof typeof {{display_name}};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Vanilla Data for Minecraft Bedrock Edition script APIs
|
|
2
|
+
// Project: https://docs.microsoft.com/minecraft/creator/
|
|
3
|
+
// Definitions by: Jake Shirley <https://github.com/JakeShirley>
|
|
4
|
+
// Mike Ammerlaan <https://github.com/mammerla>
|
|
5
|
+
// Raphael Landaverde <https://github.com/rlandav>
|
|
6
|
+
|
|
7
|
+
/* *****************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
***************************************************************************** */
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{{#has_properties}}
|
|
2
|
+
{{! The superset of all states in a single struct. }}
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* All supported states and their types for {{display_name}}
|
|
6
|
+
*/
|
|
7
|
+
export type {{display_type}}StateSuperset = {
|
|
8
|
+
{{#data_properties}}
|
|
9
|
+
["{{name}}"]?: {{property_type}};
|
|
10
|
+
{{/data_properties}}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
{{! This will create the specific state type for each data item. }}
|
|
14
|
+
{{#data_items}}
|
|
15
|
+
{{#state_union}}
|
|
16
|
+
/**
|
|
17
|
+
* States specific to {{standardized_name}}
|
|
18
|
+
*/
|
|
19
|
+
export type {{standardized_name}}States = Pick<{{display_type}}StateSuperset, {{{state_union}}}>;
|
|
20
|
+
|
|
21
|
+
{{/state_union}}
|
|
22
|
+
{{/data_items}}
|
|
23
|
+
|
|
24
|
+
{{! Creates a union of all the state objects. State union key is used to determine if state object was created. }}
|
|
25
|
+
/**
|
|
26
|
+
* Union of all types for {{display_type}} states
|
|
27
|
+
*/
|
|
28
|
+
export type {{display_type}}States =
|
|
29
|
+
{{#data_items}}
|
|
30
|
+
{{#state_union}}
|
|
31
|
+
| {{standardized_name}}States
|
|
32
|
+
{{/state_union}}
|
|
33
|
+
{{/data_items}}
|
|
34
|
+
;
|
|
35
|
+
|
|
36
|
+
{{! Mapping of Block name to it's property types. }}
|
|
37
|
+
/**
|
|
38
|
+
* Mapping of each {{display_type}} name to it's states
|
|
39
|
+
*/
|
|
40
|
+
export type {{display_type}}StateMapping = {
|
|
41
|
+
{{#data_items}}
|
|
42
|
+
{{#state_union}}
|
|
43
|
+
'{{no_namespace_name}}': {{standardized_name}}States;
|
|
44
|
+
{{#namespace}}
|
|
45
|
+
'{{namespace}}:{{no_namespace_name}}': {{standardized_name}}States;
|
|
46
|
+
{{/namespace}}
|
|
47
|
+
{{/state_union}}
|
|
48
|
+
{{/data_items}}
|
|
49
|
+
};
|
|
50
|
+
{{/has_properties}}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{{#ts_has_comments}}
|
|
2
|
+
/**
|
|
3
|
+
{{#is_prerelease}}
|
|
4
|
+
* @{{{prerelease}}}
|
|
5
|
+
{{/is_prerelease}}
|
|
6
|
+
{{#is_deprecated}}
|
|
7
|
+
* @deprecated This {{#is_interface}}interface{{/is_interface}}{{^is_interface}}class{{/is_interface}} is deprecated and will be removed in {{{deprecated_version}}}.
|
|
8
|
+
{{#deprecated_description_ts.length}}
|
|
9
|
+
*
|
|
10
|
+
{{#deprecated_description_ts}}
|
|
11
|
+
* {{{.}}}
|
|
12
|
+
{{/deprecated_description_ts}}
|
|
13
|
+
{{/deprecated_description_ts.length}}
|
|
14
|
+
{{#class_description_ts.length}}
|
|
15
|
+
*
|
|
16
|
+
{{/class_description_ts.length}}
|
|
17
|
+
{{/is_deprecated}}
|
|
18
|
+
{{#class_description_ts}}
|
|
19
|
+
* {{{.}}}
|
|
20
|
+
{{/class_description_ts}}
|
|
21
|
+
{{#has_runtime_conditions}}
|
|
22
|
+
*
|
|
23
|
+
* Required Experiments:
|
|
24
|
+
{{#runtime_conditions}}
|
|
25
|
+
* - {{.}}
|
|
26
|
+
{{/runtime_conditions}}
|
|
27
|
+
*
|
|
28
|
+
{{/has_runtime_conditions}}
|
|
29
|
+
{{#examples.length}}
|
|
30
|
+
{{> examples}}
|
|
31
|
+
{{/examples.length}}
|
|
32
|
+
*/
|
|
33
|
+
{{/ts_has_comments}}
|
|
34
|
+
{{#base_types.length}}
|
|
35
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
36
|
+
{{/base_types.length}}
|
|
37
|
+
{{^is_script_generated}}
|
|
38
|
+
export {{#is_interface}}interface{{/is_interface}}{{^is_interface}}class{{/is_interface}} {{{class_name}}}{{#base_types.length}} extends {{#base_types}}{{> type}}{{^is_last}}, {{/is_last}}{{/base_types}}{{/base_types.length}}{{#iterator}} implements Iterable<{{> type}}>{{/iterator}} {
|
|
39
|
+
{{/is_script_generated}}
|
|
40
|
+
{{#is_script_generated}}
|
|
41
|
+
{{{raw_script_text}}} {
|
|
42
|
+
{{/is_script_generated}}
|
|
43
|
+
{{^is_script_generated}}
|
|
44
|
+
{{^has_constructor}}
|
|
45
|
+
{{^is_interface}}
|
|
46
|
+
private constructor();
|
|
47
|
+
{{/is_interface}}
|
|
48
|
+
{{/has_constructor}}
|
|
49
|
+
{{/is_script_generated}}
|
|
50
|
+
{{#properties}}
|
|
51
|
+
{{> property}}
|
|
52
|
+
{{/properties}}
|
|
53
|
+
{{#has_member_constants}}
|
|
54
|
+
{{#constants}}
|
|
55
|
+
{{> property}}
|
|
56
|
+
{{/constants}}
|
|
57
|
+
{{/has_member_constants}}
|
|
58
|
+
{{#has_member_functions}} {{! Constructor, member, and then static methods }}
|
|
59
|
+
{{#functions}}
|
|
60
|
+
{{#is_constructor}}
|
|
61
|
+
{{#arguments.length}}
|
|
62
|
+
{{> function}}
|
|
63
|
+
{{/arguments.length}}
|
|
64
|
+
{{^arguments.length}}
|
|
65
|
+
{{#base_types.length}}
|
|
66
|
+
{{> function}}
|
|
67
|
+
{{/base_types.length}}
|
|
68
|
+
{{/arguments.length}}
|
|
69
|
+
{{/is_constructor}}
|
|
70
|
+
{{/functions}}
|
|
71
|
+
{{#functions}} {{! Members }}
|
|
72
|
+
{{^is_constructor}}
|
|
73
|
+
{{^is_static}}
|
|
74
|
+
{{> function}}
|
|
75
|
+
{{/is_static}}
|
|
76
|
+
{{/is_constructor}}
|
|
77
|
+
{{/functions}}
|
|
78
|
+
{{#functions}} {{! Statics }}
|
|
79
|
+
{{^is_constructor}}
|
|
80
|
+
{{#is_static}}
|
|
81
|
+
{{> function}}
|
|
82
|
+
{{/is_static}}
|
|
83
|
+
{{/is_constructor}}
|
|
84
|
+
{{/functions}}
|
|
85
|
+
{{/has_member_functions}}
|
|
86
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{{#ts_has_comments}}
|
|
2
|
+
/**
|
|
3
|
+
{{#is_prerelease}}
|
|
4
|
+
* @{{{prerelease}}}
|
|
5
|
+
{{/is_prerelease}}
|
|
6
|
+
{{#is_deprecated}}
|
|
7
|
+
* @deprecated This enum is deprecated and will be removed in {{{deprecated_version}}}.
|
|
8
|
+
{{#deprecated_description_ts.length}}
|
|
9
|
+
*
|
|
10
|
+
{{#deprecated_description_ts}}
|
|
11
|
+
* {{{.}}}
|
|
12
|
+
{{/deprecated_description_ts}}
|
|
13
|
+
{{/deprecated_description_ts.length}}
|
|
14
|
+
{{#enum_description_ts.length}}
|
|
15
|
+
*
|
|
16
|
+
{{/enum_description_ts.length}}
|
|
17
|
+
{{/is_deprecated}}
|
|
18
|
+
{{#enum_description_ts}}
|
|
19
|
+
* {{{.}}}
|
|
20
|
+
{{/enum_description_ts}}
|
|
21
|
+
*/
|
|
22
|
+
{{/ts_has_comments}}
|
|
23
|
+
{{^is_script_generated}}
|
|
24
|
+
export enum {{{enum_name}}} {
|
|
25
|
+
{{/is_script_generated}}
|
|
26
|
+
{{#is_script_generated}}
|
|
27
|
+
{{{raw_script_text}}} {
|
|
28
|
+
{{/is_script_generated}}
|
|
29
|
+
{{#constants}}
|
|
30
|
+
{{> property}}
|
|
31
|
+
{{/constants}}
|
|
32
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{{#ts_has_comments}}
|
|
2
|
+
/**
|
|
3
|
+
{{#is_prerelease}}
|
|
4
|
+
* @{{{prerelease}}}
|
|
5
|
+
{{/is_prerelease}}
|
|
6
|
+
{{#is_deprecated}}
|
|
7
|
+
* @deprecated This function is deprecated and will be removed in {{{deprecated_version}}}.
|
|
8
|
+
{{#deprecated_description_ts.length}}
|
|
9
|
+
*
|
|
10
|
+
{{#deprecated_description_ts}}
|
|
11
|
+
* {{{.}}}
|
|
12
|
+
{{/deprecated_description_ts}}
|
|
13
|
+
{{/deprecated_description_ts.length}}
|
|
14
|
+
{{#ts_has_remarks}}
|
|
15
|
+
*
|
|
16
|
+
{{/ts_has_remarks}}
|
|
17
|
+
{{/is_deprecated}}
|
|
18
|
+
{{#ts_has_remarks}}
|
|
19
|
+
* @remarks
|
|
20
|
+
{{#function_description_ts.length}}
|
|
21
|
+
{{#function_description_ts}}
|
|
22
|
+
* {{{.}}}
|
|
23
|
+
{{/function_description_ts}}
|
|
24
|
+
*
|
|
25
|
+
{{/function_description_ts.length}}
|
|
26
|
+
{{#call_disallowed_in_read_only}}
|
|
27
|
+
* This function can't be called in read-only mode.
|
|
28
|
+
*
|
|
29
|
+
{{/call_disallowed_in_read_only}}
|
|
30
|
+
{{#call_allowed_in_early_execution}}
|
|
31
|
+
* This function can be called in early-execution mode.
|
|
32
|
+
*
|
|
33
|
+
{{/call_allowed_in_early_execution}}
|
|
34
|
+
{{/ts_has_remarks}}
|
|
35
|
+
{{#arguments}}
|
|
36
|
+
{{#ts_has_comments}}
|
|
37
|
+
* @param {{{name}}}
|
|
38
|
+
{{#argument_description_ts.length}}
|
|
39
|
+
{{#argument_description_ts}}
|
|
40
|
+
* {{{.}}}
|
|
41
|
+
{{/argument_description_ts}}
|
|
42
|
+
{{/argument_description_ts.length}}
|
|
43
|
+
{{#has_defaults}}
|
|
44
|
+
{{#details.default_value}}
|
|
45
|
+
* Defaults to: {{> value}}
|
|
46
|
+
{{/details.default_value}}
|
|
47
|
+
{{/has_defaults}}
|
|
48
|
+
{{/ts_has_comments}}
|
|
49
|
+
{{/arguments}}
|
|
50
|
+
{{#returns_description_ts.length}}
|
|
51
|
+
* @returns
|
|
52
|
+
{{#returns_description_ts}}
|
|
53
|
+
* {{{.}}}
|
|
54
|
+
{{/returns_description_ts}}
|
|
55
|
+
{{/returns_description_ts.length}}
|
|
56
|
+
{{#has_runtime_conditions}}
|
|
57
|
+
*
|
|
58
|
+
* Required Experiments:
|
|
59
|
+
{{#runtime_conditions}}
|
|
60
|
+
* - {{.}}
|
|
61
|
+
{{/runtime_conditions}}
|
|
62
|
+
*
|
|
63
|
+
{{/has_runtime_conditions}}
|
|
64
|
+
{{#throws_description_ts.length}}
|
|
65
|
+
* @throws
|
|
66
|
+
{{#throws_description_ts}}
|
|
67
|
+
* {{{.}}}
|
|
68
|
+
{{/throws_description_ts}}
|
|
69
|
+
{{/throws_description_ts.length}}
|
|
70
|
+
{{^throws_description_ts}}
|
|
71
|
+
{{#return_type}}
|
|
72
|
+
{{#is_errorable}}
|
|
73
|
+
* @throws This function can throw errors.
|
|
74
|
+
{{/is_errorable}}
|
|
75
|
+
{{/return_type}}
|
|
76
|
+
{{/throws_description_ts}}
|
|
77
|
+
{{#return_type}}
|
|
78
|
+
{{#error_types.length}}
|
|
79
|
+
{{#error_types}}
|
|
80
|
+
{{! Re-assign the mustache delimiters to avoid conflicts with typedoc comments }}
|
|
81
|
+
{{=<% %>=}}
|
|
82
|
+
*
|
|
83
|
+
* {@link <%> type%>}
|
|
84
|
+
<%={{ }}=%>
|
|
85
|
+
{{/error_types}}
|
|
86
|
+
{{/error_types.length}}
|
|
87
|
+
{{/return_type}}
|
|
88
|
+
{{#examples.length}}
|
|
89
|
+
{{> examples}}
|
|
90
|
+
{{/examples.length}}
|
|
91
|
+
*/
|
|
92
|
+
{{/ts_has_comments}}
|
|
93
|
+
{{^is_script_generated}}
|
|
94
|
+
{{> function_declaration }};
|
|
95
|
+
{{/is_script_generated}}
|
|
96
|
+
{{#is_script_generated}}
|
|
97
|
+
{{{raw_script_text}}}
|
|
98
|
+
{{/is_script_generated}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{{name}}}{{#details.supported_values.length}}: {{#details.supported_values}}{{> value}}{{^is_last}}|{{/is_last}}{{/details.supported_values}}{{/details.supported_values.length}}{{^details.supported_values.length}}{{#type}}{{#is_optional}}?{{/is_optional}}: {{> type}}{{/type}}{{/details.supported_values.length}}{{^is_last}}, {{/is_last}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{#is_constructor}}{{#mustache_config.display_constructor_as_instantiation}}new {{{class_name}}}{{/mustache_config.display_constructor_as_instantiation}}{{^mustache_config.display_constructor_as_instantiation}}constructor{{/mustache_config.display_constructor_as_instantiation}}{{/is_constructor}}{{^is_constructor}}{{^is_member}}{{^mustache_config.disable_export_keyword}}export function {{/mustache_config.disable_export_keyword}}{{/is_member}}{{#is_member}}{{#is_static}}static {{/is_static}}{{/is_member}}{{#ts_name_should_escape}}"{{/ts_name_should_escape}}{{{name}}}{{#ts_name_should_escape}}"{{/ts_name_should_escape}}{{/is_constructor}}({{#arguments}}{{> function_argument_declaration}}{{/arguments}}){{^is_constructor}}: {{#return_type}}{{> type}}{{#is_optional}} | undefined{{/is_optional}}{{/return_type}}{{/is_constructor}}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{{> module_header}}
|
|
2
|
+
/**
|
|
3
|
+
{{#version_is_prerelease}}
|
|
4
|
+
* @{{{module_prerelease_tag}}}
|
|
5
|
+
{{/version_is_prerelease}}
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
{{#module_description_ts}}
|
|
8
|
+
* {{{.}}}
|
|
9
|
+
{{/module_description_ts}}
|
|
10
|
+
{{#examples.length}}
|
|
11
|
+
{{> examples}}
|
|
12
|
+
{{/examples.length}}
|
|
13
|
+
*
|
|
14
|
+
* Manifest Details
|
|
15
|
+
* ```json
|
|
16
|
+
* {
|
|
17
|
+
* "module_name": "{{{name}}}",
|
|
18
|
+
* "version": "{{{manifest_example_version_ts}}}"
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
{{#dependencies}}
|
|
24
|
+
import * as {{{variable_name}}} from "{{{name}}}";
|
|
25
|
+
{{/dependencies}}
|
|
26
|
+
{{#peer_dependencies}}
|
|
27
|
+
{{^types_only}}
|
|
28
|
+
import * as {{{variable_name}}} from "{{{name}}}";
|
|
29
|
+
{{/types_only}}
|
|
30
|
+
{{#types_only}} {{! Add ts-ignore to allow optional peer dependencies that decay to any }}
|
|
31
|
+
// @ts-ignore Optional types-only package, will decay to any if {{{name}}} isn't installed
|
|
32
|
+
import type * as {{{variable_name}}} from "{{{name}}}";
|
|
33
|
+
{{/types_only}}
|
|
34
|
+
{{/peer_dependencies}}
|
|
35
|
+
{{#enums}}
|
|
36
|
+
{{> enum}}
|
|
37
|
+
|
|
38
|
+
{{/enums}}
|
|
39
|
+
{{#type_aliases}}
|
|
40
|
+
{{> type_alias}}
|
|
41
|
+
|
|
42
|
+
{{/type_aliases}}
|
|
43
|
+
{{#classes}}
|
|
44
|
+
{{> class}}
|
|
45
|
+
|
|
46
|
+
{{/classes}}
|
|
47
|
+
{{#interfaces}}
|
|
48
|
+
{{> class}}
|
|
49
|
+
|
|
50
|
+
{{/interfaces}}
|
|
51
|
+
{{#errors}}
|
|
52
|
+
{{> class}}
|
|
53
|
+
|
|
54
|
+
{{/errors}}
|
|
55
|
+
{{#functions}}
|
|
56
|
+
{{> function}}
|
|
57
|
+
{{/functions}}
|
|
58
|
+
{{#constants}}
|
|
59
|
+
{{> property}}
|
|
60
|
+
{{/constants}}
|
|
61
|
+
{{#objects}}
|
|
62
|
+
{{> property}}
|
|
63
|
+
{{/objects}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Type definitions for Minecraft Bedrock Edition script APIs
|
|
2
|
+
// Project: https://docs.microsoft.com/minecraft/creator/
|
|
3
|
+
// Definitions by: Jake Shirley <https://github.com/JakeShirley>
|
|
4
|
+
// Mike Ammerlaan <https://github.com/mammerla>
|
|
5
|
+
|
|
6
|
+
/* *****************************************************************************
|
|
7
|
+
Copyright (c) Microsoft Corporation.
|
|
8
|
+
***************************************************************************** */
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{{#ts_has_comments}}
|
|
2
|
+
/**
|
|
3
|
+
{{#is_prerelease}}
|
|
4
|
+
* @{{{prerelease}}}
|
|
5
|
+
{{/is_prerelease}}
|
|
6
|
+
{{#is_deprecated}}
|
|
7
|
+
* @deprecated This property is deprecated and will be removed in {{{deprecated_version}}}.
|
|
8
|
+
{{#deprecated_description_ts.length}}
|
|
9
|
+
*
|
|
10
|
+
{{#deprecated_description_ts}}
|
|
11
|
+
* {{{.}}}
|
|
12
|
+
{{/deprecated_description_ts}}
|
|
13
|
+
{{/deprecated_description_ts.length}}
|
|
14
|
+
{{#ts_has_remarks}}
|
|
15
|
+
*
|
|
16
|
+
{{/ts_has_remarks}}
|
|
17
|
+
{{/is_deprecated}}
|
|
18
|
+
{{#ts_has_remarks}}
|
|
19
|
+
* @remarks
|
|
20
|
+
{{#property_description_ts.length}}
|
|
21
|
+
{{#property_description_ts}}
|
|
22
|
+
* {{{.}}}
|
|
23
|
+
{{/property_description_ts}}
|
|
24
|
+
*
|
|
25
|
+
{{/property_description_ts.length}}
|
|
26
|
+
{{#set_disallowed_in_read_only}}
|
|
27
|
+
{{#get_disallowed_in_read_only}}
|
|
28
|
+
* This property can't be used in read-only mode.
|
|
29
|
+
*
|
|
30
|
+
{{/get_disallowed_in_read_only}}
|
|
31
|
+
{{^get_disallowed_in_read_only}}
|
|
32
|
+
* This property can't be edited in read-only mode.
|
|
33
|
+
*
|
|
34
|
+
{{/get_disallowed_in_read_only}}
|
|
35
|
+
{{/set_disallowed_in_read_only}}
|
|
36
|
+
{{^set_disallowed_in_read_only}}
|
|
37
|
+
{{#get_disallowed_in_read_only}}
|
|
38
|
+
* This property can't be read in read-only mode.
|
|
39
|
+
*
|
|
40
|
+
{{/get_disallowed_in_read_only}}
|
|
41
|
+
{{/set_disallowed_in_read_only}}
|
|
42
|
+
{{#set_allowed_in_early_execution}}
|
|
43
|
+
{{#get_allowed_in_early_execution}}
|
|
44
|
+
* This property can be used in early-execution mode.
|
|
45
|
+
*
|
|
46
|
+
{{/get_allowed_in_early_execution}}
|
|
47
|
+
{{^get_allowed_in_early_execution}}
|
|
48
|
+
* This property can be edited in early-execution mode.
|
|
49
|
+
*
|
|
50
|
+
{{/get_allowed_in_early_execution}}
|
|
51
|
+
{{/set_allowed_in_early_execution}}
|
|
52
|
+
{{^set_allowed_in_early_execution}}
|
|
53
|
+
{{#get_allowed_in_early_execution}}
|
|
54
|
+
* This property can be read in early-execution mode.
|
|
55
|
+
*
|
|
56
|
+
{{/get_allowed_in_early_execution}}
|
|
57
|
+
{{/set_allowed_in_early_execution}}
|
|
58
|
+
{{/ts_has_remarks}}
|
|
59
|
+
{{#has_defaults}}
|
|
60
|
+
{{#default_value}}
|
|
61
|
+
* Defaults to: {{> value}}
|
|
62
|
+
*
|
|
63
|
+
{{/default_value}}
|
|
64
|
+
{{/has_defaults}}
|
|
65
|
+
{{#throws_description_ts.length}}
|
|
66
|
+
* @throws
|
|
67
|
+
{{#throws_description_ts}}
|
|
68
|
+
* {{{.}}}
|
|
69
|
+
{{/throws_description_ts}}
|
|
70
|
+
{{/throws_description_ts.length}}
|
|
71
|
+
{{^throws_description_ts}}
|
|
72
|
+
{{#type}}
|
|
73
|
+
{{#is_errorable}}
|
|
74
|
+
* @throws This property can throw when used.
|
|
75
|
+
{{/is_errorable}}
|
|
76
|
+
{{/type}}
|
|
77
|
+
{{/throws_description_ts}}
|
|
78
|
+
{{#type}}
|
|
79
|
+
{{#error_types.length}}
|
|
80
|
+
{{#error_types}}
|
|
81
|
+
{{! Re-assign the mustache delimiters to avoid conflicts with typedoc comments }}
|
|
82
|
+
{{=<% %>=}}
|
|
83
|
+
*
|
|
84
|
+
* {@link <%> type%>}
|
|
85
|
+
<%={{ }}=%>
|
|
86
|
+
{{/error_types}}
|
|
87
|
+
{{/error_types.length}}
|
|
88
|
+
{{/type}}
|
|
89
|
+
{{#examples.length}}
|
|
90
|
+
{{> examples}}
|
|
91
|
+
{{/examples.length}}
|
|
92
|
+
*/
|
|
93
|
+
{{/ts_has_comments}}
|
|
94
|
+
{{^is_script_generated}}
|
|
95
|
+
{{> property_declaration }}{{^is_enum}};{{/is_enum}}
|
|
96
|
+
{{/is_script_generated}}
|
|
97
|
+
{{#is_script_generated}}
|
|
98
|
+
{{{raw_script_text}}}{{#is_enum}},{{/is_enum}}
|
|
99
|
+
{{/is_script_generated}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{^is_enum}}{{^is_member}}export {{#is_read_only}}const {{/is_read_only}}{{/is_member}}{{#is_member}}{{#is_static}}static {{/is_static}}{{#is_read_only}}readonly {{/is_read_only}}{{/is_member}}{{/is_enum}}{{#is_member}}{{/is_member}}{{#ts_name_should_escape}}"{{/ts_name_should_escape}}{{{name}}}{{#ts_name_should_escape}}"{{/ts_name_should_escape}}{{#is_member}}{{/is_member}}{{#constant_value}} = {{#type}}{{> value}}{{/type}}{{/constant_value}}{{^constant_value}}{{#type.is_optional}}?{{/type.is_optional}}: {{#type}}{{> type}}{{/type}}{{/constant_value}}{{#is_enum}}{{^is_last}},{{/is_last}}{{/is_enum}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{#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}}void{{/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}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{{#ts_has_comments}}
|
|
2
|
+
/**
|
|
3
|
+
{{#is_prerelease}}
|
|
4
|
+
* @{{{prerelease}}}
|
|
5
|
+
{{/is_prerelease}}
|
|
6
|
+
{{#is_deprecated}}
|
|
7
|
+
* @deprecated This type is deprecated and will be removed in {{{deprecated_version}}}.
|
|
8
|
+
{{#deprecated_description_ts.length}}
|
|
9
|
+
*
|
|
10
|
+
{{#deprecated_description_ts}}
|
|
11
|
+
* {{{.}}}
|
|
12
|
+
{{/deprecated_description_ts}}
|
|
13
|
+
{{/deprecated_description_ts.length}}
|
|
14
|
+
{{#alias_description_ts.length}}
|
|
15
|
+
*
|
|
16
|
+
{{/alias_description_ts.length}}
|
|
17
|
+
{{/is_deprecated}}
|
|
18
|
+
{{#alias_description_ts}}
|
|
19
|
+
* {{{.}}}
|
|
20
|
+
{{/alias_description_ts}}
|
|
21
|
+
*/
|
|
22
|
+
{{/ts_has_comments}}
|
|
23
|
+
{{#is_script_generated}}
|
|
24
|
+
{{{raw_script_text}}}
|
|
25
|
+
{{/is_script_generated}}
|
|
26
|
+
{{^is_script_generated}}
|
|
27
|
+
{{#is_type_map}}
|
|
28
|
+
export type {{{alias_name}}} = {
|
|
29
|
+
{{#mappings}}
|
|
30
|
+
'{{{name}}}': {{{value}}};
|
|
31
|
+
{{/mappings}}
|
|
32
|
+
};
|
|
33
|
+
{{/is_type_map}}
|
|
34
|
+
{{^is_type_map}}
|
|
35
|
+
THIS WILL TRIGGER AN ERROR. ONLY TYPE MAP ALIASES SUPPORTED FOR NATIVE METADATA.
|
|
36
|
+
{{/is_type_map}}
|
|
37
|
+
{{/is_script_generated}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{#type.is_string}}"{{/type.is_string}}{{#type.is_array}}[{{#value}}{{{value}}}{{^is_last}}, {{/is_last}}{{/value}}]{{/type.is_array}}{{^type.is_array}}{{{value}}}{{/type.is_array}}{{#type.is_string}}"{{/type.is_string}}
|