@univer-cli/api-reference-command 1.0.0-beta.2

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/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # @univer-cli/api-reference-command
2
+
3
+ English | [简体中文](./README.zh-CN.md)
4
+
5
+ Add `@univer-cli/api-reference` to an existing Commander application with ready-to-use `api find` and `api show` commands.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pnpm add commander @univer-cli/api-reference @univer-cli/api-reference-command
11
+ ```
12
+
13
+ Commander `^15.0.0` is a peer dependency. Requires Node.js 22.12 or higher.
14
+
15
+ ## Quick Start
16
+
17
+ ```ts
18
+ import { createStandardApiReference } from "@univer-cli/api-reference";
19
+ import { createApiCommand } from "@univer-cli/api-reference-command";
20
+ import { Command } from "commander";
21
+
22
+ const program = new Command("my-cli");
23
+
24
+ program.addCommand(
25
+ createApiCommand({
26
+ reference: createStandardApiReference(),
27
+ }),
28
+ );
29
+
30
+ await program.parseAsync();
31
+ ```
32
+
33
+ After building the CLI, query the reference directly:
34
+
35
+ ```bash
36
+ my-cli api find setValues "conditional formatting" --unit sheet
37
+ my-cli api show FRange FRange.setValues ICellData.v
38
+ ```
39
+
40
+ ## Command list
41
+
42
+ ```text
43
+ api find <terms...> [--unit <sheet|slide|doc|base|board>]
44
+ api show <symbols...>
45
+ ```
46
+
47
+ `find` prints human-readable matches; `show` prints precise details. When a symbol is not found, `show` writes an error and exits non-zero. Commander also handles invalid arguments and reference execution errors.
48
+
49
+ ## Customize with Commander
50
+
51
+ The factory returns a native `Command`, so you can continue to customize its name, aliases, output, and error behavior:
52
+
53
+ ```ts
54
+ const command = createApiCommand({ reference }).name("reference").alias("api").exitOverride();
55
+
56
+ command.configureOutput({
57
+ writeOut: (text) => process.stdout.write(text),
58
+ writeErr: (text) => process.stderr.write(text),
59
+ });
60
+ ```
61
+
62
+ The package does not create a root program or restrict how the application composes other commands.
63
+
64
+ ## API entry
65
+
66
+ - `createApiCommand({ reference })`: Returns a native Commander `Command`.
67
+ - `renderFindResults()`, `renderShowResult()`: Default text presenters.
@@ -0,0 +1,69 @@
1
+ # @univer-cli/api-reference-command
2
+
3
+ [English](./README.md) | 简体中文
4
+
5
+ 把 `@univer-cli/api-reference` 接入现有 Commander 应用,提供可直接使用的 `api find` 和 `api show`
6
+ 命令。
7
+
8
+ ## 安装
9
+
10
+ ```bash
11
+ pnpm add commander @univer-cli/api-reference @univer-cli/api-reference-command
12
+ ```
13
+
14
+ Commander `^15.0.0` 是 peer dependency。要求 Node.js 22.12 或更高版本。
15
+
16
+ ## 快速开始
17
+
18
+ ```ts
19
+ import { createStandardApiReference } from "@univer-cli/api-reference";
20
+ import { createApiCommand } from "@univer-cli/api-reference-command";
21
+ import { Command } from "commander";
22
+
23
+ const program = new Command("my-cli");
24
+
25
+ program.addCommand(
26
+ createApiCommand({
27
+ reference: createStandardApiReference(),
28
+ }),
29
+ );
30
+
31
+ await program.parseAsync();
32
+ ```
33
+
34
+ 构建后可直接查询:
35
+
36
+ ```bash
37
+ my-cli api find setValues "conditional formatting" --unit sheet
38
+ my-cli api show FRange FRange.setValues ICellData.v
39
+ ```
40
+
41
+ ## 命令一览
42
+
43
+ ```text
44
+ api find <terms...> [--unit <sheet|slide|doc|base|board>]
45
+ api show <symbols...>
46
+ ```
47
+
48
+ `find` 输出面向人阅读的候选项;`show` 输出精确详情。找不到 symbol 时写入错误信息并以失败退出,参数非法或
49
+ reference 执行异常也由 Commander 处理。
50
+
51
+ ## 使用原生 Commander 定制
52
+
53
+ Factory 返回原生 `Command`,可以继续修改名称、alias、输出和错误行为:
54
+
55
+ ```ts
56
+ const command = createApiCommand({ reference }).name("reference").alias("api").exitOverride();
57
+
58
+ command.configureOutput({
59
+ writeOut: (text) => process.stdout.write(text),
60
+ writeErr: (text) => process.stderr.write(text),
61
+ });
62
+ ```
63
+
64
+ Package 不创建 root program,也不限制 application 如何组合其他 command。
65
+
66
+ ## API 入口
67
+
68
+ - `createApiCommand({ reference })`:返回原生 Commander `Command`。
69
+ - `renderFindResults()`、`renderShowResult()`:默认文本 presenter。
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ 'use strict';module['exports']=require('./index.mjs');
@@ -0,0 +1,9 @@
1
+ import { ApiReference } from "@univer-cli/api-reference";
2
+ import { Command } from "commander";
3
+ //#region src/index.d.ts
4
+ interface ApiReferenceCommandDependencies {
5
+ readonly reference: ApiReference;
6
+ }
7
+ declare function createApiCommand(dependencies: ApiReferenceCommandDependencies): Command;
8
+ //#endregion
9
+ export { ApiReferenceCommandDependencies, createApiCommand };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ (function(_0x5ab296,_0x152772){const _0x3b5436=_0x559d,_0x4d8227=_0x5ab296();while(!![]){try{const _0x5df670=-parseInt(_0x3b5436(0x1f6))/0x1*(parseInt(_0x3b5436(0x1da))/0x2)+-parseInt(_0x3b5436(0x1b1))/0x3*(-parseInt(_0x3b5436(0x1c4))/0x4)+parseInt(_0x3b5436(0x1ff))/0x5*(parseInt(_0x3b5436(0x1ba))/0x6)+parseInt(_0x3b5436(0x1e4))/0x7+parseInt(_0x3b5436(0x1e6))/0x8+-parseInt(_0x3b5436(0x223))/0x9*(-parseInt(_0x3b5436(0x1bd))/0xa)+-parseInt(_0x3b5436(0x213))/0xb*(parseInt(_0x3b5436(0x215))/0xc);if(_0x5df670===_0x152772)break;else _0x4d8227['push'](_0x4d8227['shift']());}catch(_0x26e060){_0x4d8227['push'](_0x4d8227['shift']());}}}(_0x3d16,0xbfdf7));import{API_REFERENCE_UNITS as _0x30c3a4}from'@univer-cli/api-reference';import{Command as _0x5f4f23,Option as _0x5c242a}from'commander';var r=0x48,i=0x5a,a=0x58,o=0x64,s=0x4c,c=0x50;function l(_0x49555d){const _0x5f2731=_0x559d;return(_0x49555d[_0x5f2731(0x1bb)](/^(.*?[.。])(\s|$)/u)?.[0x1]??_0x49555d)['trim']();}function u(_0x2576b6,_0x5833ba){const _0x5d798a=_0x559d;return _0x2576b6['length']>_0x5833ba?_0x2576b6[_0x5d798a(0x21c)](0x0,_0x5833ba-0x1)+'…':_0x2576b6;}function d(_0x47a5fe){const _0x53e860=_0x559d;let _0x208704=_0x47a5fe['summary']===''?'':_0x53e860(0x1ea)+l(_0x47a5fe[_0x53e860(0x1d0)]);return'['+_0x47a5fe['kind']+']\x20'+u(_0x47a5fe[_0x53e860(0x210)],r)+u(_0x208704,i)+_0x53e860(0x1ca)+_0x47a5fe['packageName']+']';}function f(_0x289ad9,_0x32f1e7){const _0x41f11e=_0x559d;if(_0x289ad9[_0x41f11e(0x20c)][_0x41f11e(0x21a)]===0x0){let _0x309062=_0x32f1e7===void 0x0?'':_0x41f11e(0x1f8)+_0x32f1e7+')';return'No\x20API\x20matches\x20\x22'+_0x289ad9[_0x41f11e(0x1f1)]+'\x22'+_0x309062+_0x41f11e(0x1c9)+(_0x32f1e7===void 0x0?'':_0x41f11e(0x211))+',\x20or\x20api\x20show\x20<Class>\x20to\x20browse\x20a\x20whole\x20class.';}let _0x50ec5f=_0x289ad9['matches'][_0x41f11e(0x1cb)](d),_0x2902ff=_0x289ad9[_0x41f11e(0x1ac)]-_0x289ad9['matches'][_0x41f11e(0x21a)];return _0x2902ff>0x0&&_0x50ec5f['push']('…\x20'+_0x2902ff+_0x41f11e(0x203)),_0x50ec5f[_0x41f11e(0x1d1)]('\x0a');}function p(_0x48d589,_0x3e9608){const _0x4dadd0=_0x559d;return _0x48d589['map'](_0x2b796b=>{const _0x1e01cd=_0x559d;let _0x5c7d68=f(_0x2b796b,_0x3e9608);return _0x48d589[_0x1e01cd(0x21a)]>0x1?'══\x20'+_0x2b796b[_0x1e01cd(0x1f1)]+_0x1e01cd(0x1ce)+_0x5c7d68:_0x5c7d68;})[_0x4dadd0(0x1d1)]('\x0a\x0a');}function m(_0x4b8e24,_0x59add2=a){const _0x3500f3=_0x559d;let _0x2cdc85=(_0x4b8e24[_0x3500f3(0x1b0)]??[])[_0x3500f3(0x1cb)](_0x8d4425=>_0x8d4425['name']+'='+_0x8d4425[_0x3500f3(0x1f4)])[_0x3500f3(0x1d1)]('\x20');return u(_0x4b8e24[_0x3500f3(0x1f2)]+':\x20'+_0x2cdc85,_0x59add2);}function h(_0x1654b0,_0x5502f6=a){const _0x90e7b0=_0x559d;let _0x3a7a2d=(_0x1654b0['members']??[])[_0x90e7b0(0x1cb)](_0x16d225=>''+_0x16d225[_0x90e7b0(0x1f2)]+(_0x16d225[_0x90e7b0(0x1b6)]?'?':'')),_0xdf6f07=_0x1654b0[_0x90e7b0(0x1a4)]===void 0x0?'':_0x90e7b0(0x1a5)+_0x1654b0['extends'];return u(''+_0x1654b0[_0x90e7b0(0x1f2)]+_0xdf6f07+_0x90e7b0(0x1d6)+_0x3a7a2d[_0x90e7b0(0x1d1)](',\x20')+'\x20}',_0x5502f6);}function g(_0x3edce8){const _0x5cc967=_0x559d;return _0x3edce8[_0x5cc967(0x21a)]===0x0?[]:['',_0x5cc967(0x1a7),..._0x3edce8[_0x5cc967(0x1cb)](_0x1beb94=>_0x1beb94[_0x5cc967(0x1f0)]==='enum'?'\x20\x20'+m(_0x1beb94,o):_0x1beb94[_0x5cc967(0x1f0)]===_0x5cc967(0x1dc)?'\x20\x20'+_0x1beb94[_0x5cc967(0x1f2)]+_0x5cc967(0x1e0)+u(_0x1beb94['definition']??'',o):'\x20\x20'+h(_0x1beb94,o)),_0x5cc967(0x219)];}function _(_0x2596a6){const _0x4d9378=_0x559d;let _0x2e3901=_0x2596a6[_0x4d9378(0x1d0)]===''?'':'\x20\x20—\x20'+l(_0x2596a6['summary']);return'['+(''+(_0x2596a6[_0x4d9378(0x1f5)]?'readonly\x20':'')+_0x2596a6[_0x4d9378(0x1f0)])+']\x20'+u(_0x2596a6[_0x4d9378(0x21d)]+'.'+_0x2596a6[_0x4d9378(0x210)],r)+u(_0x2e3901,i);}function v(_0x4d1bfc){const _0x3b2d09=_0x559d;let _0x2a008e=_0x4d1bfc[_0x3b2d09(0x1d0)]===void 0x0?'':_0x3b2d09(0x1ea)+l(_0x4d1bfc[_0x3b2d09(0x1d0)]);return'\x20\x20'+u(''+_0x4d1bfc[_0x3b2d09(0x1f2)]+(_0x4d1bfc[_0x3b2d09(0x1b6)]?'?':'')+':\x20'+_0x4d1bfc[_0x3b2d09(0x201)],s)+u(_0x2a008e,c);}function _0x3d16(){const _0x72b9d0=['kind','term','name','(...).','value','readonly','1548811eJfVeH','\x0a\x20\x20If\x20unsure,\x20api\x20find\x20<keyword>\x20to\x20search\x20by\x20intent,\x20or\x20api\x20show\x20<class\x20alias:\x20range/slide/document/presentation/api>\x20to\x20browse\x20a\x20whole\x20class.','\x20(filtered\x20by\x20--unit\x20','.<member>','getter','writeOut','api.reference.not-found','example','@example','2895ySsFEG','packageName','type','limit\x20results\x20to\x20one\x20unit\x20while\x20retaining\x20shared\x20APIs','\x20more.\x20Narrow\x20with\x20a\x20longer\x20substring,\x20or\x20api\x20show\x20<symbol>\x20for\x20details.','found','relationOwner','--unit\x20<unit>','function-property','filter','\x20is\x20a\x20callable\x20function\x20property;\x20call\x20it\x20as\x20','show','target','matches','Supported\x20via\x20','\x20supported\x20members)','inherited','signature',',\x20drop\x20--unit','\x0a\x20\x20List\x20all:\x20api\x20show\x20','11HTRdpu','enum','17560572oSCbIX','outputHelp',';\x20composed\x20by\x20','\x20\x20(also\x20univerAPI.Enum:\x20','(details:\x20api\x20show\x20<TypeName>)','length','<terms...>','slice','owner','\x20\x20(','details:\x20api\x20show\x20','reference',';\x20inherited\x20by\x20','relation','543573UJBrJe','extends','\x20extends\x20','Offline\x20Univer\x20Facade\x20API\x20reference','Types:','members','unit','entries','\x0a\x20\x20Similar\x20','totalMatches','push','configureOutput','().','values','2085bznGrW','Unknown\x20symbol:\x20','Do\x20not\x20assign\x20to\x20','split','error','optional','composed','symbols','class','4182IrLsnX','match','Show\x20exact\x20API\x20classes,\x20members,\x20types,\x20fields,\x20or\x20enum\x20values','10UqdUVT','composes','\x20is\x20a\x20','command','action','Find\x20API\x20methods,\x20types,\x20fields,\x20and\x20enums\x20by\x20keyword','aliases','5556qgSObP','Composed\x20from\x20','lineage','<symbols...>','choices','.\x20Try\x20a\x20shorter\x20substring','\x20\x20[','map','api','find','\x20══\x0a','reduce','summary','join','<Class>','status','composes\x20','one\x20or\x20more\x20terms,\x20searched\x20independently','\x20{\x20','not-found','one\x20or\x20more\x20exact\x20API\x20symbols','exact\x20symbols;\x20shorthand\x20for\x20api\x20show','2oscsum','appendix','alias','description','argument','declaredBy','\x20=\x20','suggestions','readonly\x20','inherits\x20','5611627DbyGPw','methods','12537016FMAELB','member','[symbols...]','\x20+\x20','\x20\x20—\x20','Access:\x20','\x20has\x20no\x20','enum\x20','getter\x20property','\x20→\x20'];_0x3d16=function(){return _0x72b9d0;};return _0x3d16();}function y(_0xb890b5,_0x37fa51){const _0xe56c27=_0x559d;let _0x439afc=_0xb890b5[_0xe56c27(0x1c3)]??[],_0x2e8f1a=_0x439afc[_0xe56c27(0x21a)]===0x0?'':_0xe56c27(0x218)+_0x439afc[_0xe56c27(0x1d1)](',\x20')+')';if(_0xb890b5[_0xe56c27(0x1f0)]===_0xe56c27(0x214))return[_0xe56c27(0x1ed)+_0xb890b5['name']+_0xe56c27(0x1ca)+_0xb890b5[_0xe56c27(0x200)]+']'+_0x2e8f1a,..._0xb890b5[_0xe56c27(0x1d0)]===''?[]:['',_0xb890b5[_0xe56c27(0x1d0)]],'',...(_0xb890b5[_0xe56c27(0x1b0)]??[])[_0xe56c27(0x1cb)](_0x10be53=>'\x20\x20'+_0x10be53['name']+_0xe56c27(0x1e0)+_0x10be53[_0xe56c27(0x1f4)])][_0xe56c27(0x1d1)]('\x0a');if(_0xb890b5[_0xe56c27(0x1f0)]===_0xe56c27(0x1dc))return['type\x20'+_0xb890b5[_0xe56c27(0x1f2)]+_0xe56c27(0x1e0)+(_0xb890b5['definition']??'')+_0xe56c27(0x1ca)+_0xb890b5['packageName']+']'+_0x2e8f1a,..._0xb890b5['summary']===''?[]:['',_0xb890b5[_0xe56c27(0x1d0)]]][_0xe56c27(0x1d1)]('\x0a');let _0x3c1641=_0xb890b5['extends']===void 0x0?'':_0xe56c27(0x1a5)+_0xb890b5[_0xe56c27(0x1a4)],_0x40012c=['interface\x20'+_0xb890b5[_0xe56c27(0x1f2)]+_0x3c1641+_0xe56c27(0x1ca)+_0xb890b5[_0xe56c27(0x200)]+']'+_0x2e8f1a,..._0xb890b5[_0xe56c27(0x1d0)]===''?[]:['',_0xb890b5['summary']],'',...(_0xb890b5[_0xe56c27(0x1a8)]??[])[_0xe56c27(0x1cb)](v)];for(let _0x39d7b7 of _0x37fa51)_0x40012c['push']('','Inherited\x20from\x20'+_0x39d7b7[_0xe56c27(0x1f2)]+':',...(_0x39d7b7[_0xe56c27(0x1a8)]??[])['map'](v));return _0x40012c[_0xe56c27(0x1d1)]('\x0a');}function _0x559d(_0x52be27,_0x3c3d60){_0x52be27=_0x52be27-0x1a4;const _0x3d16cd=_0x3d16();let _0x559de2=_0x3d16cd[_0x52be27];return _0x559de2;}function b(_0x173ea7){const _0x2b8f62=_0x559d;if(_0x173ea7[_0x2b8f62(0x1f0)]===_0x2b8f62(0x207))return[_0x2b8f62(0x1eb)+_0x173ea7[_0x2b8f62(0x1f2)]+_0x2b8f62(0x209)+_0x173ea7[_0x2b8f62(0x1f2)]+_0x2b8f62(0x1f3)];if(_0x173ea7[_0x2b8f62(0x1f0)]!=='getter'&&_0x173ea7[_0x2b8f62(0x1f0)]!=='property')return[];let _0x370e24=_0x173ea7[_0x2b8f62(0x1f0)]==='getter'?_0x2b8f62(0x1ee):'property',_0x571033=_0x173ea7[_0x2b8f62(0x1f0)]===_0x2b8f62(0x1fa)||_0x173ea7[_0x2b8f62(0x1f5)]?_0x2b8f62(0x1e2):'';return[_0x2b8f62(0x1eb)+_0x173ea7[_0x2b8f62(0x1f2)]+_0x2b8f62(0x1bf)+_0x571033+_0x370e24+';\x20do\x20not\x20call\x20'+_0x173ea7[_0x2b8f62(0x1f2)]+_0x2b8f62(0x1af),..._0x173ea7[_0x2b8f62(0x1f5)]?[_0x2b8f62(0x1b3)+_0x173ea7['name']+'.']:[]];}function x(_0x5ed9dd){const _0x59a825=_0x559d;if(_0x5ed9dd['status']===_0x59a825(0x1d7))return'';if(_0x5ed9dd[_0x59a825(0x1f0)]===_0x59a825(0x1b9)){let _0x2d6d44=_0x5ed9dd['groups'][_0x59a825(0x1cf)]((_0x50f640,_0x2fffe7)=>_0x50f640+_0x2fffe7['members'][_0x59a825(0x21a)],0x0),_0x98b028=[_0x5ed9dd[_0x59a825(0x1f2)]+_0x59a825(0x21e)+_0x2d6d44+_0x59a825(0x20e)];_0x5ed9dd[_0x59a825(0x1c6)][_0x59a825(0x21a)]>0x1&&_0x98b028['push'](_0x59a825(0x1e3)+_0x5ed9dd[_0x59a825(0x1c6)][_0x59a825(0x21c)](0x1)[_0x59a825(0x1d1)](_0x59a825(0x1ef))),_0x5ed9dd['composes'][_0x59a825(0x21a)]>0x0&&_0x98b028[_0x59a825(0x1ad)](_0x59a825(0x1d4)+_0x5ed9dd[_0x59a825(0x1be)][_0x59a825(0x1d1)](_0x59a825(0x1e9)));for(let _0x1e5990 of _0x5ed9dd['groups'])_0x1e5990['relation']===_0x59a825(0x20f)&&_0x98b028[_0x59a825(0x1ad)]('','Inherited\x20from\x20'+_0x1e5990[_0x59a825(0x21d)]+':'),_0x1e5990[_0x59a825(0x222)]==='composed'&&_0x98b028[_0x59a825(0x1ad)]('',_0x59a825(0x1c5)+_0x1e5990[_0x59a825(0x21d)]+':'),_0x98b028[_0x59a825(0x1ad)](..._0x1e5990[_0x59a825(0x1a8)][_0x59a825(0x1cb)](_0x54a9e6=>'\x20\x20'+_(_0x54a9e6)));return _0x98b028[_0x59a825(0x1ad)]('',_0x59a825(0x21f)+_0x5ed9dd[_0x59a825(0x1f2)]+_0x59a825(0x1f9)),_0x98b028[_0x59a825(0x1d1)]('\x0a');}if(_0x5ed9dd['kind']===_0x59a825(0x1e7)){let _0x5eef17=[];for(let [_0x106cde,_0xb8082d]of _0x5ed9dd[_0x59a825(0x1aa)]['entries']()){let _0x1a25d8=_0xb8082d['member'];_0x5eef17[_0x59a825(0x1ad)](_0x1a25d8['owner']+'.'+_0x1a25d8[_0x59a825(0x210)]);let _0xbad315=b(_0x1a25d8);_0xbad315['length']>0x0&&_0x5eef17[_0x59a825(0x1ad)]('',..._0xbad315),_0xb8082d[_0x59a825(0x222)]===_0x59a825(0x20f)&&_0x5eef17[_0x59a825(0x1ad)]('',_0x59a825(0x20d)+_0xb8082d['relationOwner']+_0x59a825(0x221)+_0x5ed9dd[_0x59a825(0x20b)]+'.'),_0xb8082d[_0x59a825(0x222)]===_0x59a825(0x1b7)&&_0x5eef17[_0x59a825(0x1ad)]('',_0x59a825(0x20d)+_0xb8082d[_0x59a825(0x205)]+_0x59a825(0x217)+_0x5ed9dd[_0x59a825(0x20b)]+'.'),_0x1a25d8['summary']!==''&&_0x5eef17[_0x59a825(0x1ad)]('',_0x1a25d8[_0x59a825(0x1d0)]),_0x5eef17[_0x59a825(0x1ad)](...g(_0xb8082d[_0x59a825(0x1db)])),_0x1a25d8[_0x59a825(0x1fd)]!==''&&_0x5eef17[_0x59a825(0x1ad)]('',_0x59a825(0x1fe),_0x1a25d8['example'][_0x59a825(0x1b4)]('\x0a')['map'](_0x4f45bc=>'\x20\x20'+_0x4f45bc)[_0x59a825(0x1d1)]('\x0a')),_0x106cde<_0x5ed9dd[_0x59a825(0x1aa)][_0x59a825(0x21a)]-0x1&&_0x5eef17['push']('','———');}return _0x5eef17[_0x59a825(0x1d1)]('\x0a');}return _0x5ed9dd[_0x59a825(0x1f0)]===_0x59a825(0x201)?[y(_0x5ed9dd[_0x59a825(0x201)],_0x5ed9dd[_0x59a825(0x20f)]),...g(_0x5ed9dd[_0x59a825(0x1db)])][_0x59a825(0x1d1)]('\x0a'):'value'in _0x5ed9dd['member']?_0x5ed9dd['declaredBy'][_0x59a825(0x1f2)]+'.'+_0x5ed9dd[_0x59a825(0x1e7)][_0x59a825(0x1f2)]+_0x59a825(0x1e0)+_0x5ed9dd[_0x59a825(0x1e7)][_0x59a825(0x1f4)]+_0x59a825(0x1ca)+_0x5ed9dd['declaredBy'][_0x59a825(0x200)]+']':[_0x5ed9dd[_0x59a825(0x1df)][_0x59a825(0x1f2)]+'.'+_0x5ed9dd[_0x59a825(0x1e7)][_0x59a825(0x1f2)]+(_0x5ed9dd['member']['optional']?'?':'')+':\x20'+_0x5ed9dd[_0x59a825(0x1e7)][_0x59a825(0x201)]+'\x20\x20['+_0x5ed9dd[_0x59a825(0x1df)][_0x59a825(0x200)]+']',..._0x5ed9dd[_0x59a825(0x1e7)][_0x59a825(0x1d0)]===void 0x0?[]:['',_0x5ed9dd[_0x59a825(0x1e7)][_0x59a825(0x1d0)]],...g(_0x5ed9dd[_0x59a825(0x1db)])][_0x59a825(0x1d1)]('\x0a');}function S(_0x53a094){const _0x50a812=_0x559d;let _0x1fe5ad=_0x53a094[_0x50a812(0x1e1)][_0x50a812(0x21a)]===0x0?'':_0x50a812(0x1ab)+(_0x53a094[_0x50a812(0x1f0)]===_0x50a812(0x1e7)?_0x50a812(0x1e5):_0x50a812(0x1b8))+':\x20'+_0x53a094['suggestions'][_0x50a812(0x1d1)](',\x20');return _0x53a094['kind']===_0x50a812(0x1e7)?(_0x53a094[_0x50a812(0x21d)]??'Symbol')+_0x50a812(0x1ec)+(_0x53a094[_0x50a812(0x1e7)]??_0x50a812(0x1e7))+_0x1fe5ad+_0x50a812(0x212)+(_0x53a094['owner']??_0x50a812(0x1d2)):_0x50a812(0x1b2)+_0x53a094['query']+_0x1fe5ad+_0x50a812(0x1f7);}function C(_0x4f30de,_0x5d401c){const _0x21f096=_0x559d;let _0x5ab96c=_0x4f30de[_0x21f096(0x1ae)](),_0x34f831=_0x5d401c[_0x21f096(0x208)](_0x30c937=>_0x30c937[_0x21f096(0x1d3)]===_0x21f096(0x204));_0x34f831[_0x21f096(0x21a)]>0x0&&_0x5ab96c[_0x21f096(0x1fb)]?.(_0x34f831[_0x21f096(0x1cb)](_0x3ec922=>_0x5d401c[_0x21f096(0x21a)]>0x1?'══\x20'+_0x3ec922['query']+'\x20══\x0a'+x(_0x3ec922):x(_0x3ec922))[_0x21f096(0x1d1)]('\x0a\x0a')+'\x0a');let _0x1f4d8e=_0x5d401c[_0x21f096(0x208)](_0x14469c=>_0x14469c[_0x21f096(0x1d3)]===_0x21f096(0x1d7))[_0x21f096(0x1cb)](S);_0x1f4d8e[_0x21f096(0x21a)]>0x0&&_0x4f30de[_0x21f096(0x1b5)](_0x1f4d8e[_0x21f096(0x1d1)]('\x0a'),{'code':_0x21f096(0x1fc),'exitCode':0x1});}function w(_0x3252a8){const _0x233f63=_0x559d;let _0xa15088=new _0x5f4f23(_0x233f63(0x1cc))[_0x233f63(0x1dd)](_0x233f63(0x1a6))[_0x233f63(0x1de)](_0x233f63(0x1e8),_0x233f63(0x1d9))[_0x233f63(0x1c1)](_0x31b508=>{const _0x2834fe=_0x233f63;if(_0x31b508[_0x2834fe(0x21a)]===0x0){_0xa15088[_0x2834fe(0x216)]();return;}C(_0xa15088,_0x3252a8['reference']['show'](_0x31b508));});return _0xa15088[_0x233f63(0x1c0)]('find')[_0x233f63(0x1dd)](_0x233f63(0x1c2))[_0x233f63(0x1de)](_0x233f63(0x21b),_0x233f63(0x1d5))['addOption'](new _0x5c242a(_0x233f63(0x206),_0x233f63(0x202))[_0x233f63(0x1c8)](_0x30c3a4))[_0x233f63(0x1c1)]((_0x3c44f7,_0x71f6ab)=>{const _0x2ff386=_0x233f63;let _0x4a427d=_0x3252a8['reference'][_0x2ff386(0x1cd)]({'terms':_0x3c44f7,..._0x71f6ab[_0x2ff386(0x1a9)]===void 0x0?{}:{'unit':_0x71f6ab[_0x2ff386(0x1a9)]}});_0xa15088[_0x2ff386(0x1ae)]()[_0x2ff386(0x1fb)]?.(p(_0x4a427d,_0x71f6ab[_0x2ff386(0x1a9)])+'\x0a');}),_0xa15088['command'](_0x233f63(0x20a))[_0x233f63(0x1dd)](_0x233f63(0x1bc))[_0x233f63(0x1de)](_0x233f63(0x1c7),_0x233f63(0x1d8))[_0x233f63(0x1c1)](_0x27e986=>{const _0x55bba5=_0x233f63;C(_0xa15088,_0x3252a8[_0x55bba5(0x220)][_0x55bba5(0x20a)](_0x27e986));}),_0xa15088;}export{w as createApiCommand};
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@univer-cli/api-reference-command",
3
+ "type": "module",
4
+ "version": "1.0.0-beta.2",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md",
18
+ "README.zh-CN.md"
19
+ ],
20
+ "dependencies": {
21
+ "@univer-cli/api-reference": "1.0.0-beta.2"
22
+ },
23
+ "peerDependencies": {
24
+ "commander": "^15.0.0"
25
+ }
26
+ }