@simplysm/sd-claude 14.0.47 → 14.0.49

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.
Files changed (130) hide show
  1. package/{claude/references/sd-simplysm14/sd-claude/usage.md → README.md} +2 -2
  2. package/claude/rules/sd-claude-rules.md +25 -10
  3. package/claude/rules/sd-options.md +11 -6
  4. package/claude/sd-subagent-start.sh +6 -0
  5. package/claude/settings.json +1 -12
  6. package/claude/skills/sd-check/SKILL.md +43 -12
  7. package/claude/skills/sd-claude-docs/SKILL.md +30 -58
  8. package/claude/skills/sd-claude-docs/references/package-claudemd.md +12 -0
  9. package/claude/skills/sd-claude-docs/references/package-doc-gen.md +26 -13
  10. package/claude/skills/sd-commit/SKILL.md +1 -1
  11. package/claude/skills/sd-debug/SKILL.md +5 -3
  12. package/claude/skills/sd-deliverable/SKILL.md +1 -1
  13. package/claude/skills/sd-dev/SKILL.md +14 -9
  14. package/claude/skills/sd-doc-extract/SKILL.md +8 -10
  15. package/claude/skills/sd-doc-extract/_common.py +8 -1
  16. package/claude/skills/sd-doc-extract/_extract_docx.py +74 -34
  17. package/claude/skills/sd-doc-extract/_extract_pdf.py +12 -1
  18. package/claude/skills/sd-doc-extract/_extract_pptx.py +103 -23
  19. package/claude/skills/sd-doc-extract/_extract_xlsb.py +93 -4
  20. package/claude/skills/sd-doc-extract/_extract_xlsx.py +98 -36
  21. package/claude/skills/sd-doc-extract/extract.py +22 -3
  22. package/claude/skills/sd-inner-clarify/SKILL.md +78 -0
  23. package/claude/skills/sd-inner-debug/SKILL.md +1 -1
  24. package/claude/skills/sd-inner-review/SKILL.md +13 -0
  25. package/claude/skills/sd-issue/SKILL.md +1 -1
  26. package/claude/skills/sd-outlook/SKILL.md +1 -1
  27. package/claude/skills/sd-plan/SKILL.md +50 -17
  28. package/claude/skills/sd-prompt/SKILL.md +180 -178
  29. package/claude/skills/sd-prompt/references/eval-runner.md +5 -30
  30. package/claude/skills/sd-prompt/references/sd-eval-env-template.md +23 -0
  31. package/claude/skills/sd-refactor/SKILL.md +2 -2
  32. package/claude/skills/sd-tdd/SKILL.md +45 -16
  33. package/claude/skills/sd-use/SKILL.md +84 -80
  34. package/claude/skills/sd-wbs/SKILL.md +84 -27
  35. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/assets.md +2 -3
  36. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/hooks.md +7 -6
  37. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/scripts.md +1 -9
  38. package/package.json +3 -2
  39. package/scripts/sync.mjs +4 -2
  40. package/claude/references/sd-simplysm14/angular/docs/bootstrap.md +0 -48
  41. package/claude/references/sd-simplysm14/angular/docs/directives.md +0 -236
  42. package/claude/references/sd-simplysm14/angular/docs/features.md +0 -379
  43. package/claude/references/sd-simplysm14/angular/docs/pipes.md +0 -32
  44. package/claude/references/sd-simplysm14/angular/docs/plugins.md +0 -37
  45. package/claude/references/sd-simplysm14/angular/docs/provider-types.md +0 -283
  46. package/claude/references/sd-simplysm14/angular/docs/providers.md +0 -379
  47. package/claude/references/sd-simplysm14/angular/docs/styling.md +0 -222
  48. package/claude/references/sd-simplysm14/angular/docs/type-utilities.md +0 -250
  49. package/claude/references/sd-simplysm14/angular/docs/ui-data.md +0 -275
  50. package/claude/references/sd-simplysm14/angular/docs/ui-form.md +0 -490
  51. package/claude/references/sd-simplysm14/angular/docs/ui-layout.md +0 -140
  52. package/claude/references/sd-simplysm14/angular/docs/ui-navigation.md +0 -273
  53. package/claude/references/sd-simplysm14/angular/docs/ui-overlay.md +0 -157
  54. package/claude/references/sd-simplysm14/angular/docs/ui-visual.md +0 -127
  55. package/claude/references/sd-simplysm14/angular/docs/utils.md +0 -295
  56. package/claude/references/sd-simplysm14/angular/usage.md +0 -489
  57. package/claude/references/sd-simplysm14/capacitor-plugin-auto-update/usage.md +0 -182
  58. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/file-operations.md +0 -154
  59. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/permissions.md +0 -84
  60. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/storage-paths.md +0 -107
  61. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/types.md +0 -83
  62. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/usage.md +0 -133
  63. package/claude/references/sd-simplysm14/capacitor-plugin-intent/usage.md +0 -203
  64. package/claude/references/sd-simplysm14/capacitor-plugin-usb-storage/usage.md +0 -258
  65. package/claude/references/sd-simplysm14/core-browser/usage.md +0 -306
  66. package/claude/references/sd-simplysm14/core-common/docs/errors.md +0 -82
  67. package/claude/references/sd-simplysm14/core-common/docs/extensions.md +0 -167
  68. package/claude/references/sd-simplysm14/core-common/docs/features.md +0 -136
  69. package/claude/references/sd-simplysm14/core-common/docs/types.md +0 -245
  70. package/claude/references/sd-simplysm14/core-common/docs/utils.md +0 -591
  71. package/claude/references/sd-simplysm14/core-common/usage.md +0 -255
  72. package/claude/references/sd-simplysm14/core-node/docs/child-process.md +0 -182
  73. package/claude/references/sd-simplysm14/core-node/docs/features.md +0 -214
  74. package/claude/references/sd-simplysm14/core-node/docs/file-system.md +0 -509
  75. package/claude/references/sd-simplysm14/core-node/docs/file-watching.md +0 -139
  76. package/claude/references/sd-simplysm14/core-node/docs/logging.md +0 -180
  77. package/claude/references/sd-simplysm14/core-node/docs/path.md +0 -176
  78. package/claude/references/sd-simplysm14/core-node/docs/utilities-cpx.md +0 -194
  79. package/claude/references/sd-simplysm14/core-node/docs/utilities-fsx.md +0 -469
  80. package/claude/references/sd-simplysm14/core-node/docs/utilities-pathx.md +0 -151
  81. package/claude/references/sd-simplysm14/core-node/docs/worker-threads.md +0 -334
  82. package/claude/references/sd-simplysm14/core-node/docs/worker.md +0 -205
  83. package/claude/references/sd-simplysm14/core-node/usage.md +0 -259
  84. package/claude/references/sd-simplysm14/excel/docs/core-classes.md +0 -453
  85. package/claude/references/sd-simplysm14/excel/docs/types.md +0 -459
  86. package/claude/references/sd-simplysm14/excel/docs/utilities.md +0 -194
  87. package/claude/references/sd-simplysm14/excel/docs/wrapper.md +0 -73
  88. package/claude/references/sd-simplysm14/excel/usage.md +0 -134
  89. package/claude/references/sd-simplysm14/lint/usage.md +0 -130
  90. package/claude/references/sd-simplysm14/orm-common/docs/core.md +0 -188
  91. package/claude/references/sd-simplysm14/orm-common/docs/expression.md +0 -190
  92. package/claude/references/sd-simplysm14/orm-common/docs/models.md +0 -17
  93. package/claude/references/sd-simplysm14/orm-common/docs/query-builder.md +0 -97
  94. package/claude/references/sd-simplysm14/orm-common/docs/queryable-executable.md +0 -250
  95. package/claude/references/sd-simplysm14/orm-common/docs/schema-builders.md +0 -364
  96. package/claude/references/sd-simplysm14/orm-common/docs/types.md +0 -522
  97. package/claude/references/sd-simplysm14/orm-common/usage.md +0 -229
  98. package/claude/references/sd-simplysm14/orm-node/docs/connections.md +0 -137
  99. package/claude/references/sd-simplysm14/orm-node/docs/core.md +0 -131
  100. package/claude/references/sd-simplysm14/orm-node/docs/types.md +0 -173
  101. package/claude/references/sd-simplysm14/orm-node/usage.md +0 -143
  102. package/claude/references/sd-simplysm14/sd-cli/usage.md +0 -782
  103. package/claude/references/sd-simplysm14/service-client/docs/features.md +0 -217
  104. package/claude/references/sd-simplysm14/service-client/docs/main.md +0 -148
  105. package/claude/references/sd-simplysm14/service-client/docs/protocol.md +0 -53
  106. package/claude/references/sd-simplysm14/service-client/docs/transport.md +0 -131
  107. package/claude/references/sd-simplysm14/service-client/docs/types.md +0 -129
  108. package/claude/references/sd-simplysm14/service-client/usage.md +0 -202
  109. package/claude/references/sd-simplysm14/service-common/docs/app-structure.md +0 -175
  110. package/claude/references/sd-simplysm14/service-common/docs/events.md +0 -64
  111. package/claude/references/sd-simplysm14/service-common/docs/protocol.md +0 -331
  112. package/claude/references/sd-simplysm14/service-common/docs/service-types.md +0 -90
  113. package/claude/references/sd-simplysm14/service-common/docs/types.md +0 -19
  114. package/claude/references/sd-simplysm14/service-common/usage.md +0 -154
  115. package/claude/references/sd-simplysm14/service-server/docs/auth.md +0 -64
  116. package/claude/references/sd-simplysm14/service-server/docs/core.md +0 -174
  117. package/claude/references/sd-simplysm14/service-server/docs/legacy.md +0 -25
  118. package/claude/references/sd-simplysm14/service-server/docs/main.md +0 -88
  119. package/claude/references/sd-simplysm14/service-server/docs/protocol.md +0 -33
  120. package/claude/references/sd-simplysm14/service-server/docs/services.md +0 -94
  121. package/claude/references/sd-simplysm14/service-server/docs/transport-http.md +0 -93
  122. package/claude/references/sd-simplysm14/service-server/docs/transport-socket.md +0 -119
  123. package/claude/references/sd-simplysm14/service-server/docs/types.md +0 -36
  124. package/claude/references/sd-simplysm14/service-server/docs/utils.md +0 -22
  125. package/claude/references/sd-simplysm14/service-server/usage.md +0 -171
  126. package/claude/references/sd-simplysm14/storage/usage.md +0 -301
  127. package/claude/references/sd-simplysm14.md +0 -35
  128. package/claude/rules/sd-clarify.md +0 -23
  129. package/claude/sd-session-start.sh +0 -10
  130. /package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/cli.md +0 -0
@@ -1,259 +0,0 @@
1
- # @simplysm/core-node
2
-
3
- Node.js 전용 코어 유틸리티 패키지. 파일 시스템 조작, 자식 프로세스 실행, 경로 처리, 파일 감시, Worker thread 래퍼, consola 로깅 설정을 제공한다.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @simplysm/core-node
9
- ```
10
-
11
- ## API Overview
12
-
13
- ### File System (fsx)
14
-
15
- 파일 시스템 작업을 위한 유틸리티 네임스페이스. 모든 함수는 동기/비동기 쌍으로 제공된다.
16
-
17
- | API | Type | Description |
18
- |-----|------|-------------|
19
- | `exists` | function | 파일 또는 디렉토리가 존재하는지 확인 (비동기) |
20
- | `existsSync` | function | 파일 또는 디렉토리가 존재하는지 확인 (동기) |
21
- | `mkdir` | function | 디렉토리를 생성 (재귀적, 비동기) |
22
- | `mkdirSync` | function | 디렉토리를 생성 (재귀적, 동기) |
23
- | `rm` | function | 파일/디렉토리 삭제, 파일 잠금 시 최대 6회 재시도 (비동기) |
24
- | `rmSync` | function | 파일/디렉토리 삭제 (동기, 재시도 없음) |
25
- | `copy` | function | 파일/디렉토리 복사, 필터 옵션 지원 (비동기) |
26
- | `copySync` | function | 파일/디렉토리 복사, 필터 옵션 지원 (동기) |
27
- | `read` | function | 파일을 UTF-8 문자열로 읽음 (비동기) |
28
- | `readSync` | function | 파일을 UTF-8 문자열로 읽음 (동기) |
29
- | `readBytes` | function | 파일을 Uint8Array로 읽음 (비동기) |
30
- | `readBytesSync` | function | 파일을 Uint8Array로 읽음 (동기) |
31
- | `readJson` | function | JSON 파일 읽음 (비동기) |
32
- | `readJsonSync` | function | JSON 파일 읽음 (동기) |
33
- | `write` | function | 파일에 데이터 쓰기, 상위 디렉토리 자동 생성 (비동기) |
34
- | `writeSync` | function | 파일에 데이터 쓰기, 상위 디렉토리 자동 생성 (동기) |
35
- | `writeJson` | function | JSON 파일에 데이터 쓰기 (비동기) |
36
- | `writeJsonSync` | function | JSON 파일에 데이터 쓰기 (동기) |
37
- | `readdir` | function | 디렉토리 내용 읽기 (비동기) |
38
- | `readdirSync` | function | 디렉토리 내용 읽기 (동기) |
39
- | `stat` | function | 파일/디렉토리 정보 조회, 심볼릭 링크 따라감 (비동기) |
40
- | `statSync` | function | 파일/디렉토리 정보 조회, 심볼릭 링크 따라감 (동기) |
41
- | `lstat` | function | 파일/디렉토리 정보 조회, 심볼릭 링크 따라가지 않음 (비동기) |
42
- | `lstatSync` | function | 파일/디렉토리 정보 조회, 심볼릭 링크 따라가지 않음 (동기) |
43
- | `glob` | function | Glob 패턴으로 파일 검색 (비동기) |
44
- | `globSync` | function | Glob 패턴으로 파일 검색 (동기) |
45
- | `clearEmptyDirectory` | function | 빈 디렉토리 재귀적 삭제 |
46
- | `findAllParentChildPathsSync` | function | 부모 디렉토리에서 특정 파일 검색 (동기) |
47
- | `findAllParentChildPaths` | function | 부모 디렉토리에서 특정 파일 검색 (비동기) |
48
-
49
- → See [docs/file-system.md](./docs/file-system.md) for details.
50
-
51
- ### Child Process (cpx)
52
-
53
- 자식 프로세스 실행 및 인코딩 감지.
54
-
55
- | API | Type | Description |
56
- |-----|------|-------------|
57
- | `spawn` | function | 자식 프로세스 실행, Promise 기반, 실시간 제어 가능 |
58
- | `spawnSync` | function | 자식 프로세스 동기 실행 |
59
- | `getSystemEncoding` | function | 시스템 기본 인코딩 감지 |
60
- | `codePageToEncoding` | function | Windows 코드 페이지를 인코딩명으로 변환 |
61
- | `decodeBytes` | function | Uint8Array를 문자열로 디코딩 |
62
- | `resolveStdioPipe` | function | stdio 옵션에서 pipe 여부 판단 |
63
- | `resetEncodingCache` | function | 인코딩 캐시 초기화 |
64
- | `SpawnProcess` | class | spawn() 반환 타입, PromiseLike 구현 |
65
- | `SpawnResult` | interface | spawn/spawnSync 결과 타입 |
66
-
67
- → See [docs/child-process.md](./docs/child-process.md) for details.
68
-
69
- ### Path (pathx)
70
-
71
- 경로 처리 및 PosixPath 브랜드 타입.
72
-
73
- | API | Type | Description |
74
- |-----|------|-------------|
75
- | `posix` | function | 경로를 POSIX 스타일(슬래시)로 변환 |
76
- | `posixResolve` | function | 경로를 절대 경로로 resolve한 후 POSIX 스타일로 변환 |
77
- | `changeFileDirectory` | function | 파일의 디렉토리를 변경 |
78
- | `basenameWithoutExt` | function | 확장자를 제외한 파일명 반환 |
79
- | `isChildPath` | function | 자식 경로 여부 확인 |
80
- | `filterByTargets` | function | 대상 경로 목록에 기반한 파일 필터링 |
81
- | `PosixPath` | type | POSIX 스타일 경로 브랜드 타입 |
82
-
83
- → See [docs/path.md](./docs/path.md) for details.
84
-
85
- ### File Watching (FsWatcher)
86
-
87
- Chokidar 기반 파일 시스템 감시 클래스.
88
-
89
- | API | Type | Description |
90
- |-----|------|-------------|
91
- | `FsWatcher` | class | 파일 시스템 감시, 이벤트 병합, 자동 복구 |
92
- | `FsWatcherEvent` | type | 감시 이벤트 타입: "add" \| "addDir" \| "change" \| "unlink" \| "unlinkDir" |
93
- | `FsWatcherChangeInfo` | interface | 파일 변경 정보 (event + path) |
94
-
95
- → See [docs/file-watching.md](./docs/file-watching.md) for details.
96
-
97
- ### Logging (consola)
98
-
99
- Consola 로깅 설정 및 reporter.
100
-
101
- | API | Type | Description |
102
- |-----|------|-------------|
103
- | `setupConsola` | function | 환경별 자동 consola 구성 |
104
- | `withMaxLevel` | function | 로그 레벨 상한선을 설정한 reporter 래퍼 |
105
- | `PrettyReporter` | class | 터미널 출력용 consola reporter |
106
- | `createFileReporter` | function | 파일 기반 consola reporter 생성 |
107
-
108
- → See [docs/logging.md](./docs/logging.md) for details.
109
-
110
- ### Worker Threads
111
-
112
- 타입 안전한 Worker thread 래퍼.
113
-
114
- | API | Type | Description |
115
- |-----|------|-------------|
116
- | `Worker` | class | Worker thread 프록시 생성 및 메서드 호출 |
117
- | `createWorker` | function | 워커 측에서 호출하는 워커 모듈 생성 함수 |
118
- | `WorkerModule` | interface | 워커 모듈의 타입 구조 |
119
- | `WorkerProxy` | type | Worker.create() 반환 프록시 타입 |
120
- | `WorkerRequest` | interface | 워커 요청 메시지 타입 |
121
- | `WorkerResponse` | type | 워커 응답 메시지 타입 |
122
- | `PromisifyMethods` | type | 메서드를 Promise 버전으로 변환하는 매핑 타입 |
123
-
124
- → See [docs/worker-threads.md](./docs/worker-threads.md) for details.
125
-
126
- ## Usage Examples
127
-
128
- ### File System Operations
129
-
130
- ```typescript
131
- import { fsx } from "@simplysm/core-node";
132
-
133
- // 파일 존재 확인
134
- const exists = await fsx.exists("/path/to/file.txt");
135
-
136
- // 파일 읽기/쓰기
137
- const content = await fsx.read("/path/to/file.txt");
138
- await fsx.write("/path/to/new-file.txt", "Hello, World!");
139
-
140
- // JSON 파일 읽기/쓰기
141
- const data = await fsx.readJson<{ name: string }>("/path/to/config.json");
142
- await fsx.writeJson("/path/to/config.json", { name: "test" });
143
-
144
- // 파일 복사 (필터 적용)
145
- await fsx.copy("/src/dir", "/dst/dir", (filePath) => {
146
- return !filePath.includes("node_modules");
147
- });
148
-
149
- // Glob 검색
150
- const tsFiles = await fsx.glob("src/**/*.ts");
151
- ```
152
-
153
- ### Child Process Execution
154
-
155
- ```typescript
156
- import { cpx } from "@simplysm/core-node";
157
-
158
- // 기본 실행
159
- const result = await cpx.spawn("npm", ["list"], { cwd: "/project" });
160
- console.log(result.stdout);
161
-
162
- // 실시간 출력
163
- await cpx.spawn("npm", ["run", "build"], { stdio: "inherit" });
164
-
165
- // 오류 무시
166
- const result = await cpx.spawn("cmd", ["nonexistent"], { reject: false });
167
- // result.exitCode가 0이 아니어도 throw되지 않음
168
-
169
- // 동기 실행
170
- const syncResult = cpx.spawnSync("node", ["--version"]);
171
- console.log(syncResult.stdout);
172
- ```
173
-
174
- ### Path Utilities
175
-
176
- ```typescript
177
- import { pathx } from "@simplysm/core-node";
178
-
179
- // POSIX 경로 변환
180
- const posixPath = pathx.posix("C:\\Users\\test");
181
- console.log(posixPath); // "C:/Users/test"
182
-
183
- // 절대 경로 resolve + POSIX
184
- const absPath = pathx.posixResolve("./relative", "path");
185
-
186
- // 자식 경로 확인
187
- const isChild = pathx.isChildPath("/a/b/c", "/a/b"); // true
188
-
189
- // 경로 필터링
190
- const filtered = pathx.filterByTargets(
191
- ["/proj/src/a.ts", "/proj/tests/b.ts"],
192
- ["src"],
193
- "/proj"
194
- );
195
- // ["/proj/src/a.ts"]
196
- ```
197
-
198
- ### File Watching
199
-
200
- ```typescript
201
- import { FsWatcher } from "@simplysm/core-node";
202
-
203
- const watcher = await FsWatcher.watch(["src/**/*.ts"]);
204
-
205
- watcher.onChange({ delay: 300 }, (changes) => {
206
- for (const { event, path } of changes) {
207
- console.log(`${event}: ${path}`);
208
- }
209
- });
210
-
211
- // 파일 감시 종료
212
- await watcher.close();
213
- ```
214
-
215
- ### Logging Setup
216
-
217
- ```typescript
218
- import { setupConsola } from "@simplysm/core-node";
219
-
220
- // 환경별 자동 구성
221
- setupConsola();
222
-
223
- // CLI 모드 (프로덕션에서도 file + pretty reporter 사용)
224
- setupConsola({ cli: true });
225
- ```
226
-
227
- ### Worker Threads
228
-
229
- ```typescript
230
- // worker.ts (워커 파일)
231
- import { createWorker } from "@simplysm/core-node";
232
-
233
- interface MyEvents {
234
- progress: number;
235
- }
236
-
237
- const methods = {
238
- add: (a: number, b: number) => a + b,
239
- multiply: (a: number, b: number) => a * b,
240
- };
241
-
242
- const sender = createWorker<typeof methods, MyEvents>(methods);
243
- export default sender;
244
-
245
- // main.ts (메인 파일)
246
- import { Worker } from "@simplysm/core-node";
247
- import type * as MyWorker from "./worker";
248
-
249
- const worker = Worker.create<typeof MyWorker>("./worker.ts");
250
-
251
- const sum = await worker.add(10, 20); // 30
252
- const product = await worker.multiply(5, 6); // 30
253
-
254
- worker.on("progress", (value) => {
255
- console.log(`Progress: ${value}%`);
256
- });
257
-
258
- await worker.terminate();
259
- ```
@@ -1,453 +0,0 @@
1
- # Core Classes
2
-
3
- ## `ExcelWorkbook`
4
-
5
- Excel 워크북 처리 클래스. 내부적으로 ZIP 리소스를 관리하므로 사용 후 반드시 `try-finally` 블록에서 `close()`를 호출해야 한다.
6
-
7
- ```typescript
8
- export class ExcelWorkbook {
9
- readonly zipCache: ZipCache;
10
-
11
- constructor(arg?: Blob | Bytes);
12
-
13
- async getWorksheetNames(): Promise<string[]>;
14
- async addWorksheet(name: string): Promise<ExcelWorksheet>;
15
- async getWorksheet(nameOrIndex: string | number): Promise<ExcelWorksheet>;
16
- async toBytes(): Promise<Bytes>;
17
- async toBlob(): Promise<Blob>;
18
- async close(): Promise<void>;
19
- }
20
- ```
21
-
22
- ### Constructor
23
-
24
- | Parameter | Type | Description |
25
- |-----------|------|-------------|
26
- | `arg` | `Blob \| Bytes \| undefined` | 기존 Excel 파일 데이터. 생략하면 새 워크북을 생성한다 |
27
-
28
- ### Methods
29
-
30
- #### `getWorksheetNames()`
31
-
32
- 워크북의 모든 워크시트 이름을 배열로 반환한다.
33
-
34
- #### `addWorksheet(name)`
35
-
36
- 새 워크시트를 생성하여 `ExcelWorksheet` 인스턴스를 반환한다.
37
-
38
- | Parameter | Type | Description |
39
- |-----------|------|-------------|
40
- | `name` | `string` | 워크시트 이름 |
41
-
42
- #### `getWorksheet(nameOrIndex)`
43
-
44
- 이름 또는 0 기반 인덱스로 워크시트를 조회하여 반환한다. 찾을 수 없으면 에러를 던진다.
45
-
46
- | Parameter | Type | Description |
47
- |-----------|------|-------------|
48
- | `nameOrIndex` | `string \| number` | 워크시트 이름 또는 0 기반 인덱스 |
49
-
50
- #### `toBytes()`
51
-
52
- 워크북을 `Bytes`(Uint8Array)로 내보낸다.
53
-
54
- #### `toBlob()`
55
-
56
- 워크북을 `Blob`으로 내보낸다. MIME 타입은 `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`이다.
57
-
58
- #### `close()`
59
-
60
- ZIP 리더와 내부 캐시를 정리한다. 이미 닫힌 워크북에 대해 호출해도 안전하다 (no-op). 닫힌 워크북의 메서드를 호출하면 에러가 발생한다.
61
-
62
- ---
63
-
64
- ## `ExcelWorksheet`
65
-
66
- Excel 워크시트를 나타내는 클래스. 셀 접근, 행/열 복사, 데이터 테이블 처리, 이미지 삽입, 뷰 설정 기능을 제공한다.
67
-
68
- ```typescript
69
- export class ExcelWorksheet {
70
- constructor(zipCache: ZipCache, relId: number, targetFileName: string);
71
-
72
- // Name
73
- async getName(): Promise<string>;
74
- async setName(newName: string): Promise<void>;
75
-
76
- // Cell Access (0 기반)
77
- row(r: number): ExcelRow;
78
- cell(r: number, c: number): ExcelCell;
79
- col(c: number): ExcelCol;
80
-
81
- // Copy
82
- async copyRowStyle(srcR: number, targetR: number): Promise<void>;
83
- async copyCellStyle(srcAddr: ExcelAddressPoint, targetAddr: ExcelAddressPoint): Promise<void>;
84
- async copyRow(srcR: number, targetR: number): Promise<void>;
85
- async copyCell(srcAddr: ExcelAddressPoint, targetAddr: ExcelAddressPoint): Promise<void>;
86
- async insertCopyRow(srcR: number, targetR: number): Promise<void>;
87
-
88
- // Range
89
- async getRange(): Promise<ExcelAddressRangePoint>;
90
- async getCells(): Promise<ExcelCell[][]>;
91
-
92
- // Data
93
- async getDataTable(opt?: {
94
- headerRowIndex?: number;
95
- checkEndColIndex?: number;
96
- usableHeaderNameFn?: (headerName: string) => boolean;
97
- }): Promise<Record<string, ExcelValueType>[]>;
98
- async setDataMatrix(matrix: ExcelValueType[][]): Promise<void>;
99
- async setRecords(records: Record<string, ExcelValueType>[]): Promise<void>;
100
-
101
- // View
102
- async setZoom(percent: number): Promise<void>;
103
- async freezeAt(point: { r?: number; c?: number }): Promise<void>;
104
-
105
- // Image
106
- async addImage(opts: {
107
- bytes: Bytes;
108
- ext: string;
109
- from: { r: number; c: number; rOff?: number | string; cOff?: number | string };
110
- to?: { r: number; c: number; rOff?: number | string; cOff?: number | string };
111
- }): Promise<void>;
112
- }
113
- ```
114
-
115
- ### Name Methods
116
-
117
- #### `getName()`
118
-
119
- 워크시트 이름을 반환한다.
120
-
121
- #### `setName(newName)`
122
-
123
- 워크시트 이름을 변경한다.
124
-
125
- | Parameter | Type | Description |
126
- |-----------|------|-------------|
127
- | `newName` | `string` | 새 워크시트 이름 |
128
-
129
- ### Cell Access Methods
130
-
131
- 모든 좌표는 0 기반 인덱스이다.
132
-
133
- #### `row(r)`
134
-
135
- 행 객체를 반환한다.
136
-
137
- | Parameter | Type | Description |
138
- |-----------|------|-------------|
139
- | `r` | `number` | 행 인덱스 (0 기반) |
140
-
141
- #### `cell(r, c)`
142
-
143
- 셀 객체를 반환한다. 동일 좌표에 대해 항상 동일한 `ExcelCell` 인스턴스를 반환한다.
144
-
145
- | Parameter | Type | Description |
146
- |-----------|------|-------------|
147
- | `r` | `number` | 행 인덱스 (0 기반) |
148
- | `c` | `number` | 열 인덱스 (0 기반) |
149
-
150
- #### `col(c)`
151
-
152
- 열 객체를 반환한다.
153
-
154
- | Parameter | Type | Description |
155
- |-----------|------|-------------|
156
- | `c` | `number` | 열 인덱스 (0 기반) |
157
-
158
- ### Copy Methods
159
-
160
- #### `copyRowStyle(srcR, targetR)`
161
-
162
- 원본 행의 스타일을 대상 행으로 복사한다. 데이터 범위 내의 모든 열에 대해 셀 스타일을 복사한다.
163
-
164
- | Parameter | Type | Description |
165
- |-----------|------|-------------|
166
- | `srcR` | `number` | 원본 행 인덱스 (0 기반) |
167
- | `targetR` | `number` | 대상 행 인덱스 (0 기반) |
168
-
169
- #### `copyCellStyle(srcAddr, targetAddr)`
170
-
171
- 원본 셀의 스타일을 대상 셀로 복사한다.
172
-
173
- | Parameter | Type | Description |
174
- |-----------|------|-------------|
175
- | `srcAddr` | `ExcelAddressPoint` | 원본 셀 좌표 |
176
- | `targetAddr` | `ExcelAddressPoint` | 대상 셀 좌표 |
177
-
178
- #### `copyRow(srcR, targetR)`
179
-
180
- 원본 행을 대상 행으로 복사한다 (덮어쓰기).
181
-
182
- | Parameter | Type | Description |
183
- |-----------|------|-------------|
184
- | `srcR` | `number` | 원본 행 인덱스 (0 기반) |
185
- | `targetR` | `number` | 대상 행 인덱스 (0 기반) |
186
-
187
- #### `copyCell(srcAddr, targetAddr)`
188
-
189
- 원본 셀을 대상 셀로 복사한다.
190
-
191
- | Parameter | Type | Description |
192
- |-----------|------|-------------|
193
- | `srcAddr` | `ExcelAddressPoint` | 원본 셀 좌표 |
194
- | `targetAddr` | `ExcelAddressPoint` | 대상 셀 좌표 |
195
-
196
- #### `insertCopyRow(srcR, targetR)`
197
-
198
- 원본 행을 대상 위치에 삽입 복사한다. 대상 위치 이하의 기존 행은 한 칸 아래로 밀린다. 병합 셀도 자동으로 이동/확장된다.
199
-
200
- | Parameter | Type | Description |
201
- |-----------|------|-------------|
202
- | `srcR` | `number` | 복사할 원본 행 인덱스 (0 기반) |
203
- | `targetR` | `number` | 삽입할 대상 행 인덱스 (0 기반) |
204
-
205
- **병합 셀 처리:**
206
- - 삽입 지점을 관통하는 다중행 병합은 자동으로 1행 확장됨
207
- - 원본 행의 단일행 병합만 대상 행에 복사됨
208
-
209
- ### Range Methods
210
-
211
- #### `getRange()`
212
-
213
- 워크시트의 데이터 범위를 `ExcelAddressRangePoint`로 반환한다.
214
-
215
- #### `getCells()`
216
-
217
- 모든 셀을 2차원 배열(`ExcelCell[][]`)로 반환한다.
218
-
219
- ### Data Methods
220
-
221
- #### `getDataTable(opt?)`
222
-
223
- 워크시트 데이터를 테이블(레코드 배열)로 반환한다. 지정된 헤더 행(기본값: 첫 번째 행)을 기준으로 이하의 데이터를 읽는다.
224
-
225
- | Parameter | Type | Description |
226
- |-----------|------|-------------|
227
- | `opt.headerRowIndex` | `number \| undefined` | 헤더 행 인덱스 (기본값: 데이터 범위의 시작 행) |
228
- | `opt.checkEndColIndex` | `number \| undefined` | 데이터 끝을 판단할 열 인덱스. 이 열이 비어있는 행을 만나면 데이터가 끝난 것으로 판단한다 |
229
- | `opt.usableHeaderNameFn` | `(headerName: string) => boolean \| undefined` | 사용 가능한 헤더를 필터링하는 함수. 반환값이 `false`인 헤더는 제외된다 |
230
-
231
- **반환값:** `Record<string, ExcelValueType>[]` - 헤더를 키로 하는 레코드 배열
232
-
233
- #### `setDataMatrix(matrix)`
234
-
235
- 2차원 배열 데이터를 워크시트에 쓴다. (0, 0) 위치부터 시작하여 데이터를 기록한다.
236
-
237
- | Parameter | Type | Description |
238
- |-----------|------|-------------|
239
- | `matrix` | `ExcelValueType[][]` | 2차원 배열 데이터 (행 우선, `matrix[0]`이 첫 번째 행) |
240
-
241
- #### `setRecords(records)`
242
-
243
- 레코드 배열을 워크시트에 쓴다. 첫 번째 행(r=0)에 헤더가 자동 생성되고, 이후 행(r=1...)에 데이터가 기록된다. 모든 레코드의 필드를 수집하여 헤더로 사용한다.
244
-
245
- | Parameter | Type | Description |
246
- |-----------|------|-------------|
247
- | `records` | `Record<string, ExcelValueType>[]` | 레코드 배열 |
248
-
249
- ### View Methods
250
-
251
- #### `setZoom(percent)`
252
-
253
- 워크시트 확대/축소 비율을 설정한다.
254
-
255
- | Parameter | Type | Description |
256
- |-----------|------|-------------|
257
- | `percent` | `number` | 확대/축소 퍼센트 |
258
-
259
- #### `freezeAt(point)`
260
-
261
- 행/열 틀 고정을 설정한다.
262
-
263
- | Parameter | Type | Description |
264
- |-----------|------|-------------|
265
- | `point.r` | `number \| undefined` | 고정할 행 인덱스 (0 기반) |
266
- | `point.c` | `number \| undefined` | 고정할 열 인덱스 (0 기반) |
267
-
268
- ### Image Methods
269
-
270
- #### `addImage(opts)`
271
-
272
- 워크시트에 이미지를 삽입한다. 같은 시트의 첫 이미지 호출 시 `drawing1.xml` 생성, 이후 이미지는 동일 drawing에 추가된다.
273
-
274
- | Parameter | Type | Description |
275
- |-----------|------|-------------|
276
- | `opts.bytes` | `Bytes` | 이미지 바이너리 데이터 |
277
- | `opts.ext` | `string` | 이미지 확장자 (예: `"png"`, `"jpg"`, `"gif"`) |
278
- | `opts.from` | `{ r: number; c: number; rOff?: number \| string; cOff?: number \| string }` | 이미지 시작 위치. `r`/`c`는 0 기반 행/열 인덱스, `rOff`/`cOff`는 선택적 EMU 오프셋 |
279
- | `opts.to` | `{ r: number; c: number; rOff?: number \| string; cOff?: number \| string } \| undefined` | 이미지 끝 위치. 생략 시 기본값은 `{ r: from.r + 1, c: from.c + 1 }`이다 |
280
-
281
- **이미지 파일 관리:**
282
- - 이미지는 `xl/media/image1.ext`, `xl/media/image2.ext` 등으로 자동 관리됨
283
- - 기존 파일명과 중복되지 않도록 인덱스 자동 증가
284
-
285
- ---
286
-
287
- ## `ExcelCell`
288
-
289
- Excel 셀을 나타내는 클래스. 값 읽기/쓰기, 수식, 스타일, 셀 병합 기능을 제공한다. 모든 메서드가 `async`인 이유는 셀 타입에 따라 필요한 XML만 선택적으로 로드하는 Lazy Loading 아키텍처 때문이다.
290
-
291
- ```typescript
292
- export class ExcelCell {
293
- readonly addr: ExcelAddressPoint;
294
-
295
- constructor(zipCache: ZipCache, targetFileName: string, r: number, c: number);
296
-
297
- // Value
298
- async setValue(val: ExcelValueType): Promise<void>;
299
- async getValue(): Promise<ExcelValueType>;
300
- async setFormula(val: string | undefined): Promise<void>;
301
- async getFormula(): Promise<string | undefined>;
302
-
303
- // Merge
304
- async merge(r: number, c: number): Promise<void>;
305
-
306
- // Style
307
- async getStyleId(): Promise<string | undefined>;
308
- async setStyleId(styleId: string | undefined): Promise<void>;
309
- async setStyle(opts: ExcelStyleOptions): Promise<void>;
310
- }
311
- ```
312
-
313
- ### Properties
314
-
315
- | Property | Type | Description |
316
- |----------|------|-------------|
317
- | `addr` | `ExcelAddressPoint` | 셀 주소 (0 기반 행/열 인덱스) |
318
-
319
- ### Value Methods
320
-
321
- #### `setValue(val)`
322
-
323
- 셀 값을 설정한다. `undefined`를 전달하면 셀이 삭제된다. `DateOnly`, `DateTime`, `Time` 인스턴스를 전달하면 내부적으로 Excel 날짜 숫자로 변환하고 적절한 numFmt를 설정한다.
324
-
325
- | Parameter | Type | Description |
326
- |-----------|------|-------------|
327
- | `val` | `ExcelValueType` | 셀 값 (`number \| string \| DateOnly \| DateTime \| Time \| boolean \| undefined`) |
328
-
329
- #### `getValue()`
330
-
331
- 셀 값을 반환한다. 셀 타입과 스타일에 따라 적절한 JavaScript 타입으로 변환한다. 비어있는 셀은 `undefined`를 반환한다.
332
-
333
- #### `setFormula(val)`
334
-
335
- 셀에 수식을 설정한다. `undefined`를 전달하면 수식이 제거된다.
336
-
337
- | Parameter | Type | Description |
338
- |-----------|------|-------------|
339
- | `val` | `string \| undefined` | 수식 문자열 (예: `"SUM(A1:A10)"`) |
340
-
341
- #### `getFormula()`
342
-
343
- 셀 수식을 반환한다. 수식이 없으면 `undefined`를 반환한다.
344
-
345
- ### Merge Methods
346
-
347
- #### `merge(r, c)`
348
-
349
- 현재 셀에서 지정된 끝 좌표까지 셀을 병합한다.
350
-
351
- | Parameter | Type | Description |
352
- |-----------|------|-------------|
353
- | `r` | `number` | 병합 끝 행 인덱스 (0 기반) |
354
- | `c` | `number` | 병합 끝 열 인덱스 (0 기반) |
355
-
356
- ### Style Methods
357
-
358
- #### `getStyleId()`
359
-
360
- 셀의 스타일 ID를 반환한다. 스타일이 없으면 `undefined`를 반환한다.
361
-
362
- #### `setStyleId(styleId)`
363
-
364
- 셀의 스타일 ID를 직접 설정한다.
365
-
366
- | Parameter | Type | Description |
367
- |-----------|------|-------------|
368
- | `styleId` | `string \| undefined` | 스타일 ID |
369
-
370
- #### `setStyle(opts)`
371
-
372
- 셀 스타일을 설정한다. 기존 스타일이 있으면 클론 후 병합한다.
373
-
374
- 커스텀 Excel formatCode를 지정하려면 `numberFormatCode`를 사용한다:
375
-
376
- ```typescript
377
- await cell.setStyle({ numberFormatCode: "0.000000" }); // 소수점 6자리
378
- await cell.setStyle({ numberFormatCode: "#,##0.00" }); // 천 단위 구분 + 2자리
379
- await cell.setStyle({ numberFormatCode: "0.00%" }); // 퍼센트
380
- ```
381
-
382
- `numberFormat`(프리셋)과 `numberFormatCode`(커스텀)가 동시에 지정되면 `numberFormatCode`가 우선 적용된다.
383
-
384
- | Parameter | Type | Description |
385
- |-----------|------|-------------|
386
- | `opts` | `ExcelStyleOptions` | 스타일 옵션 (배경색, 테두리, 정렬, 숫자 형식) |
387
-
388
- ---
389
-
390
- ## `ExcelRow`
391
-
392
- Excel 워크시트의 행을 나타내는 클래스. 셀 접근 기능을 제공한다.
393
-
394
- ```typescript
395
- export class ExcelRow {
396
- constructor(zipCache: ZipCache, targetFileName: string, r: number, cellFactory: (c: number) => ExcelCell);
397
-
398
- cell(c: number): ExcelCell;
399
- async getCells(): Promise<ExcelCell[]>;
400
- }
401
- ```
402
-
403
- ### Methods
404
-
405
- #### `cell(c)`
406
-
407
- 지정된 열 인덱스의 셀을 반환한다.
408
-
409
- | Parameter | Type | Description |
410
- |-----------|------|-------------|
411
- | `c` | `number` | 열 인덱스 (0 기반) |
412
-
413
- #### `getCells()`
414
-
415
- 행의 모든 셀을 배열로 반환한다. 데이터 범위 내의 모든 열에 대한 셀이 포함된다.
416
-
417
- ---
418
-
419
- ## `ExcelCol`
420
-
421
- Excel 워크시트의 열을 나타내는 클래스. 셀 접근 및 열 너비 설정 기능을 제공한다.
422
-
423
- ```typescript
424
- export class ExcelCol {
425
- constructor(zipCache: ZipCache, targetFileName: string, c: number, cellFactory: (r: number) => ExcelCell);
426
-
427
- cell(r: number): ExcelCell;
428
- async getCells(): Promise<ExcelCell[]>;
429
- async setWidth(size: number): Promise<void>;
430
- }
431
- ```
432
-
433
- ### Methods
434
-
435
- #### `cell(r)`
436
-
437
- 지정된 행 인덱스의 셀을 반환한다.
438
-
439
- | Parameter | Type | Description |
440
- |-----------|------|-------------|
441
- | `r` | `number` | 행 인덱스 (0 기반) |
442
-
443
- #### `getCells()`
444
-
445
- 열의 모든 셀을 배열로 반환한다. 데이터 범위 내의 모든 행에 대한 셀이 포함된다.
446
-
447
- #### `setWidth(size)`
448
-
449
- 열 너비를 설정한다.
450
-
451
- | Parameter | Type | Description |
452
- |-----------|------|-------------|
453
- | `size` | `number` | 열 너비 |