@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
58 lines (57 loc) • 2.9 kB
JavaScript
;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolCommandParser = exports.ToolCommandRegistry = exports.ToolCommandContextFactory = exports.ToolCommandScope = exports.ToolCommandBase = void 0;
exports.initializeToolCommands = initializeToolCommands;
exports.isToolCommandsInitialized = isToolCommandsInitialized;
var IToolCommand_1 = require("./IToolCommand");
Object.defineProperty(exports, "ToolCommandBase", { enumerable: true, get: function () { return IToolCommand_1.ToolCommandBase; } });
Object.defineProperty(exports, "ToolCommandScope", { enumerable: true, get: function () { return IToolCommand_1.ToolCommandScope; } });
var IToolCommandContext_1 = require("./IToolCommandContext");
Object.defineProperty(exports, "ToolCommandContextFactory", { enumerable: true, get: function () { return IToolCommandContext_1.ToolCommandContextFactory; } });
// Registry and parser
var ToolCommandRegistry_1 = require("./ToolCommandRegistry");
Object.defineProperty(exports, "ToolCommandRegistry", { enumerable: true, get: function () { return ToolCommandRegistry_1.ToolCommandRegistry; } });
var ToolCommandParser_1 = require("./ToolCommandParser");
Object.defineProperty(exports, "ToolCommandParser", { enumerable: true, get: function () { return ToolCommandParser_1.ToolCommandParser; } });
// Autocomplete providers
__exportStar(require("./AutocompleteProviders"), exports);
// Commands
__exportStar(require("./commands"), exports);
const commands_1 = require("./commands");
let _initialized = false;
/**
* Initialize the ToolCommand system by registering all built-in commands.
* Safe to call multiple times (only initializes once).
*
* NOTE: This registers only platform-safe commands. For Node.js-only commands
* (e.g., ServerCommand), call registerNodeOnlyCommands() from
* "./registerNodeCommands" in your Node.js entry point.
*/
function initializeToolCommands() {
if (_initialized)
return;
_initialized = true;
(0, commands_1.registerAllToolCommands)();
}
/**
* Check if ToolCommands have been initialized.
*/
function isToolCommandsInitialized() {
return _initialized;
}