Files
NapCatQQ/.pnpm-store/v3/files/ba/f34567b1b2a76956d5157807c5265531a85ce6afed6680e86be45c731b3b47ff288024ed7733fd793fb1236d431b6e96c0fabad536852d8d48ed0fa710a1b4
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

39 lines
1.4 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TModule = void 0;
exports.Module = Module;
const index_1 = require("../create/index");
const index_2 = require("../symbols/index");
// ------------------------------------------------------------------
// Module Infrastructure Types
// ------------------------------------------------------------------
const compute_1 = require("./compute");
// ------------------------------------------------------------------
// Module
// ------------------------------------------------------------------
// prettier-ignore
class TModule {
constructor($defs) {
const computed = (0, compute_1.ComputeModuleProperties)($defs);
const identified = this.WithIdentifiers(computed);
this.$defs = identified;
}
/** `[Json]` Imports a Type by Key. */
Import(key, options) {
const $defs = { ...this.$defs, [key]: (0, index_1.CreateType)(this.$defs[key], options) };
return (0, index_1.CreateType)({ [index_2.Kind]: 'Import', $defs, $ref: key });
}
// prettier-ignore
WithIdentifiers($defs) {
return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
return { ...result, [key]: { ...$defs[key], $id: key } };
}, {});
}
}
exports.TModule = TModule;
/** `[Json]` Creates a Type Definition Module. */
function Module(properties) {
return new TModule(properties);
}