Skip to content

Commit

Permalink
同步1.20.80正式版beta脚本API文档,同步1.21.0.23预览版脚本API文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianshanyao committed Apr 27, 2024
1 parent 23a4a33 commit 79cd57b
Show file tree
Hide file tree
Showing 21 changed files with 34,404 additions and 23,920 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ yarn-error.log*
/docs/sapi/preview/server-gametest/
/docs/sapi/preview/server-net/
/docs/sapi/preview/server-ui/
/docs/sapi/stable/server-editor/
/docs/sapi/stable/common/
/docs/sapi/preview/common/
/docs/sapi/preview/server-editor/
4 changes: 3 additions & 1 deletion bat/SapiFetchPreview.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmd.exe /c npm i @minecraft/server@beta @minecraft/server-ui@beta @minecraft/server-gametest@beta @minecraft/server-admin@beta @minecraft/server-net@beta --save-dev
cmd.exe /c npm i @minecraft/common@1.2.0-rc.1.20.80-preview.21 @minecraft/server@1.12.0-beta.1.21.0-preview.23 @minecraft/server-editor@0.1.0-beta.1.21.0-preview.23 @minecraft/server-ui@1.2.0-beta.1.21.0-preview.23 @minecraft/server-gametest@1.0.0-beta.1.21.0-preview.23 @minecraft/server-admin@1.0.0-beta.1.21.0-preview.23 @minecraft/server-net@1.0.0-beta.1.21.0-preview.23 --save-dev
Set-Location ../
Copy-Item -Path ./node_modules/@minecraft/common/index.d.ts -Destination ./static/typedoc/preview/common.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server/index.d.ts -Destination ./static/typedoc/preview/server.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server-editor/index.d.ts -Destination ./static/typedoc/preview/server-editor.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server-gametest/index.d.ts -Destination ./static/typedoc/preview/server-gametest.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server-ui/index.d.ts -Destination ./static/typedoc/preview/server-ui.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server-net/index.d.ts -Destination ./static/typedoc/preview/server-net.d.ts -Force
Expand Down
4 changes: 3 additions & 1 deletion bat/SapiFetchStable.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmd.exe /c npm i @minecraft/server@1.1.0-beta.1.19.70-stable @minecraft/server-ui@1.0.0-beta.1.19.70-stable @minecraft/server-gametest@1.0.0-beta.1.19.70-stable @minecraft/server-admin@1.0.0-beta.1.19.70-stable @minecraft/server-net@1.0.0-beta.1.19.70-stable --save-dev
cmd.exe /c npm i @minecraft/common@1.2.0 @minecraft/server@1.11.0-beta.1.20.80-stable @minecraft/server-ui@1.2.0-beta.1.20.80-stable @minecraft/server-editor@0.1.0-beta.1.20.80-stable @minecraft/server-gametest@1.0.0-beta.1.20.80-stable @minecraft/server-admin@1.0.0-beta.1.20.80-stable @minecraft/server-net@1.0.0-beta.1.20.80-stable --save-dev
Set-Location ../
Copy-Item -Path ./node_modules/@minecraft/common/index.d.ts -Destination ./static/typedoc/stable/common.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server/index.d.ts -Destination ./static/typedoc/stable/server.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server-editor/index.d.ts -Destination ./static/typedoc/stable/server-editor.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server-gametest/index.d.ts -Destination ./static/typedoc/stable/server-gametest.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server-ui/index.d.ts -Destination ./static/typedoc/stable/server-ui.d.ts -Force
Copy-Item -Path ./node_modules/@minecraft/server-net/index.d.ts -Destination ./static/typedoc/stable/server-net.d.ts -Force
Expand Down
62 changes: 60 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ const config = {
}
},
plugins: [
[
'docusaurus-plugin-typedoc',
// Plugin / TypeDoc options
{
id: 'preview-common',
entryPoints: ['./static/typedoc/preview/common.d.ts'],
tsconfig: './static/typedoc/preview/tsconfig.json',
out: 'sapi/preview/common',
sidebar: {
categoryLabel: 'sapiPreviewSidebar',
collapsed: false,
position: 0,
fullNames: true,
},
},
],
[
'docusaurus-plugin-typedoc',
// Plugin / TypeDoc options
Expand Down Expand Up @@ -102,7 +118,37 @@ const config = {
out: 'sapi/preview/server-gametest'
},
],
[
'docusaurus-plugin-typedoc',
// Plugin / TypeDoc options
{
id: 'preview-server-editor',
entryPoints: [
'./static/typedoc/preview/server-editor.d.ts',
],
tsconfig: './static/typedoc/preview/tsconfig.json',
out: 'sapi/preview/server-editor'
},
],
// -----------------------------------------------------
[
'docusaurus-plugin-typedoc',
// Plugin / TypeDoc options
{
id: 'stable-common',
entryPoints: [
'./static/typedoc/stable/common.d.ts'
],
tsconfig: './static/typedoc/stable/tsconfig.json',
out: 'sapi/stable/common',
sidebar: {
categoryLabel: 'sapiStableSidebar',
collapsed: false,
position: 0,
fullNames: true,
}
},
],
[
'docusaurus-plugin-typedoc',
// Plugin / TypeDoc options
Expand Down Expand Up @@ -169,6 +215,18 @@ const config = {
out: 'sapi/stable/server-gametest'
}
],
[
'docusaurus-plugin-typedoc',
// Plugin / TypeDoc options
{
id: 'stable-server-editor',
entryPoints: [
'./static/typedoc/stable/server-editor.d.ts',
],
tsconfig: './static/typedoc/stable/tsconfig.json',
out: 'sapi/stable/server-editor'
}
],
// --------------------------------------
[
'docusaurus-plugin-typedoc',
Expand Down Expand Up @@ -266,11 +324,11 @@ const config = {
items: [
{
to: '/docs/sapi/stable',
label: '稳定版 [1.19.70]',
label: '稳定版 [1.20.80]',
},
{
to: '/docs/sapi/preview',
label: '预览版 [1.19.80.24]',
label: '预览版 [1.21.0.23]',
}
]
},
Expand Down
16 changes: 16 additions & 0 deletions i18n/en/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
"message": "Script API Documentation",
"description": "The label for the doc item 脚本API文档 in sidebar sapiStableSidebar, linking to the doc sapi/stable/README"
},
"sidebar.sapiPreviewSidebar.category.@minecraft/common": {
"message": "@minecraft/common",
"description": "The label for category @minecraft/common in sidebar sapiPreviewSidebar"
},
"sidebar.sapiPreviewSidebar.category.@minecraft/server": {
"message": "@minecraft/server",
"description": "The label for category @minecraft/server in sidebar sapiPreviewSidebar"
Expand All @@ -71,6 +75,14 @@
"message": "@minecraft/server-gametest",
"description": "The label for category @minecraft/server-gametest in sidebar sapiPreviewSidebar"
},
"sidebar.sapiPreviewSidebar.category.@minecraft/server-editor": {
"message": "@minecraft/server-editor",
"description": "The label for category @minecraft/server-editor in sidebar sapiPreviewSidebar"
},
"sidebar.sapiStableSidebar.category.@minecraft/common": {
"message": "@minecraft/common",
"description": "The label for category @minecraft/common in sidebar sapiStableSidebar"
},
"sidebar.sapiStableSidebar.category.@minecraft/server": {
"message": "@minecraft/server",
"description": "The label for category @minecraft/server in sidebar sapiStableSidebar"
Expand All @@ -90,5 +102,9 @@
"sidebar.sapiStableSidebar.category.@minecraft/server-gametest": {
"message": "@minecraft/server-gametest",
"description": "The label for category @minecraft/server-gametest in sidebar sapiStableSidebar"
},
"sidebar.sapiStableSidebar.category.@minecraft/server-editor": {
"message": "@minecraft/server-editor",
"description": "The label for category @minecraft/server-editor in sidebar sapiStableSidebar"
}
}
12 changes: 6 additions & 6 deletions i18n/en/docusaurus-theme-classic/navbar.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"message": "Preview",
"description": "Navbar item with label 预览版"
},
"item.label.稳定版 [1.19.70]": {
"message": "Stable [1.19.70]",
"description": "Navbar item with label 稳定版 [1.19.70]"
"item.label.稳定版 [1.20.80]": {
"message": "Stable [1.20.80]",
"description": "Navbar item with label 稳定版 [1.20.80]"
},
"item.label.预览版 [1.19.80.24]": {
"message": "Preview [1.19.80.24]",
"description": "Navbar item with label 预览版 [1.19.80.24]"
"item.label.预览版 [1.21.0.23]": {
"message": "Preview [1.21.0.23]",
"description": "Navbar item with label 预览版 [1.21.0.23]"
}
}
4 changes: 3 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
*/

const moduleNames = {
'common': ['classes', 'interfaces'],
'server': ['classes', 'interfaces', 'enums'],
'server-ui': ['classes', 'enums'],
'server-admin': ['classes'],
'server-net': ['classes', 'enums'],
'server-gametest': ['classes']
'server-gametest': ['classes'],
'server-editor': ['classes', 'interfaces', 'enums']
};
const genSapiModuleSidebar = function (path, moduleName, moduleParseResultItemNameArr) {
const ret = {
Expand Down
100 changes: 100 additions & 0 deletions static/typedoc/preview/common.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// Type definitions for Minecraft Bedrock Edition script APIs
// Project: https://docs.microsoft.com/minecraft/creator/
// Definitions by: Jake Shirley <https://github.com/JakeShirley>
// Mike Ammerlaan <https://github.com/mammerla>

/* *****************************************************************************
Copyright (c) Microsoft Corporation.
***************************************************************************** */
/**
* @packageDocumentation
*
* Manifest Details
* ```json
* {
* "module_name": "@minecraft/common",
* "version": "1.1.0"
* }
* ```
*
*/
/**
* Represents a min/max structure for expressing a potential
* range of numbers.
*/
export interface NumberRange {
/**
* @remarks
* Maximum value within a range.
*
*/
max: number;
/**
* @remarks
* Minimum value within a range.
*
*/
min: number;
}

/**
* This type of error is thrown when a parameter to a method or
* property is out of expected bounds.
*/
// @ts-ignore Class inheritance allowed for native defined classes
export class ArgumentOutOfBoundsError extends Error {
private constructor();
/**
* @remarks
* Max expected value for the condition.
*
*/
maxValue: number;
/**
* @remarks
* Min expected value for the condition.
*
*/
minValue: number;
/**
* @remarks
* Passed-in value for the argument.
*
*/
value: number;
}

/**
* Specifies an underlying error in the engine in processing a
* function.
*/
// @ts-ignore Class inheritance allowed for native defined classes
export class EngineError extends Error {
private constructor();
}

/**
* Specifies that a passed-in argument to a method is not
* correct or allowed.
*/
// @ts-ignore Class inheritance allowed for native defined classes
export class InvalidArgumentError extends Error {
private constructor();
/**
* @remarks
* Index of the argument that is in error.
*
*/
index: number;
}

/**
* @beta
*/
// @ts-ignore Class inheritance allowed for native defined classes
export class PropertyOutOfBoundsError extends Error {
private constructor();
maxValue: number;
minValue: number;
value: number;
}
Loading

0 comments on commit 79cd57b

Please sign in to comment.