UNPKG

@hestjs/scalar

Version:

HestJS Scalar API Reference Integration - Beautiful API documentation for HestJS applications

42 lines 1.51 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ScalarModule_1; import { Module } from '@hestjs/core'; /** * Scalar 模块 * * 这个模块可以在 HestJS 应用中导入,提供 Scalar API 文档功能 */ let ScalarModule = ScalarModule_1 = class ScalarModule { /** * 静态方法:配置 Scalar 模块 * * @param config Scalar 配置选项 * @returns 配置后的模块 */ static forRoot(config) { // 这里可以根据需要扩展,目前主要通过中间件使用 return { module: ScalarModule_1, providers: [ { provide: 'SCALAR_CONFIG', useValue: config, }, ], exports: ['SCALAR_CONFIG'], }; } }; ScalarModule = ScalarModule_1 = __decorate([ Module({ providers: [], exports: [], }) ], ScalarModule); export { ScalarModule }; //# sourceMappingURL=scalar.module.js.map