@simplysm/sd-claude 14.0.98 → 14.0.99
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/claude/references/sd-simplysm14/README.md +16 -16
- package/claude/references/sd-simplysm14/apis/angular/README.md +81 -153
- package/claude/references/sd-simplysm14/apis/angular/controls.md +179 -205
- package/claude/references/sd-simplysm14/apis/angular/crud.md +71 -57
- package/claude/references/sd-simplysm14/apis/angular/directives.md +49 -109
- package/claude/references/sd-simplysm14/apis/angular/features.md +58 -86
- package/claude/references/sd-simplysm14/apis/angular/kanban.md +32 -40
- package/claude/references/sd-simplysm14/apis/angular/layout.md +38 -52
- package/claude/references/sd-simplysm14/apis/angular/overlay.md +86 -110
- package/claude/references/sd-simplysm14/apis/angular/routing-appstructure.md +54 -86
- package/claude/references/sd-simplysm14/apis/angular/shared-data.md +82 -74
- package/claude/references/sd-simplysm14/apis/angular/sheet.md +56 -80
- package/claude/references/sd-simplysm14/apis/capacitor-plugin-auto-update/README.md +15 -15
- package/claude/references/sd-simplysm14/apis/capacitor-plugin-file-system/README.md +21 -21
- package/claude/references/sd-simplysm14/apis/capacitor-plugin-intent/README.md +79 -53
- package/claude/references/sd-simplysm14/apis/capacitor-plugin-usb-storage/README.md +9 -11
- package/claude/references/sd-simplysm14/apis/core-browser/README.md +15 -15
- package/claude/references/sd-simplysm14/apis/core-browser/dom-element.md +20 -20
- package/claude/references/sd-simplysm14/apis/core-browser/indexed-db.md +18 -18
- package/claude/references/sd-simplysm14/apis/core-common/README.md +20 -49
- package/claude/references/sd-simplysm14/apis/core-common/async-runtime.md +66 -55
- package/claude/references/sd-simplysm14/apis/core-common/collection-ext.md +83 -56
- package/claude/references/sd-simplysm14/apis/core-common/errors.md +32 -21
- package/claude/references/sd-simplysm14/apis/core-common/obj.md +57 -39
- package/claude/references/sd-simplysm14/apis/core-common/serialization.md +36 -30
- package/claude/references/sd-simplysm14/apis/core-common/value-types.md +69 -41
- package/claude/references/sd-simplysm14/apis/core-node/README.md +4 -4
- package/claude/references/sd-simplysm14/apis/core-node/consola.md +15 -13
- package/claude/references/sd-simplysm14/apis/core-node/cpx.md +11 -7
- package/claude/references/sd-simplysm14/apis/core-node/fs-watcher.md +8 -8
- package/claude/references/sd-simplysm14/apis/core-node/fsx.md +29 -20
- package/claude/references/sd-simplysm14/apis/core-node/pathx.md +14 -6
- package/claude/references/sd-simplysm14/apis/core-node/worker.md +3 -3
- package/claude/references/sd-simplysm14/apis/excel/README.md +3 -3
- package/claude/references/sd-simplysm14/apis/excel/cell.md +32 -32
- package/claude/references/sd-simplysm14/apis/excel/conditional-format.md +23 -24
- package/claude/references/sd-simplysm14/apis/excel/style.md +24 -30
- package/claude/references/sd-simplysm14/apis/excel/utils.md +20 -23
- package/claude/references/sd-simplysm14/apis/excel/workbook-worksheet.md +60 -71
- package/claude/references/sd-simplysm14/apis/excel/wrapper.md +36 -36
- package/claude/references/sd-simplysm14/apis/lint/README.md +7 -9
- package/claude/references/sd-simplysm14/apis/lint/recommended.md +59 -37
- package/claude/references/sd-simplysm14/apis/lint/rules.md +81 -74
- package/claude/references/sd-simplysm14/apis/orm-common/README.md +6 -6
- package/claude/references/sd-simplysm14/apis/orm-common/db-context.md +112 -78
- package/claude/references/sd-simplysm14/apis/orm-common/expr.md +131 -75
- package/claude/references/sd-simplysm14/apis/orm-common/queryable.md +126 -82
- package/claude/references/sd-simplysm14/apis/orm-common/schema.md +170 -113
- package/claude/references/sd-simplysm14/apis/orm-common/types.md +102 -48
- package/claude/references/sd-simplysm14/apis/orm-node/README.md +12 -13
- package/claude/references/sd-simplysm14/apis/orm-node/db-conn.md +3 -3
- package/claude/references/sd-simplysm14/apis/sd-cli/README.md +5 -5
- package/claude/references/sd-simplysm14/apis/sd-cli/SdTsCompiler.md +67 -65
- package/claude/references/sd-simplysm14/apis/sd-cli/sd-config-types.md +130 -123
- package/claude/references/sd-simplysm14/apis/service-client/README.md +63 -63
- package/claude/references/sd-simplysm14/apis/service-client/orm.md +22 -22
- package/claude/references/sd-simplysm14/apis/service-client/transport.md +30 -26
- package/claude/references/sd-simplysm14/apis/service-common/README.md +8 -8
- package/claude/references/sd-simplysm14/apis/service-common/app-structure.md +13 -6
- package/claude/references/sd-simplysm14/apis/service-common/protocol.md +1 -1
- package/claude/references/sd-simplysm14/apis/service-server/README.md +43 -47
- package/claude/references/sd-simplysm14/apis/service-server/built-in-services.md +35 -0
- package/claude/references/sd-simplysm14/apis/service-server/service-authoring.md +20 -19
- package/claude/references/sd-simplysm14/apis/service-server/transport-internals.md +23 -25
- package/claude/references/sd-simplysm14/apis/service-server/v1-legacy.md +9 -9
- package/claude/references/sd-simplysm14/apis/storage/README.md +26 -26
- package/claude/references/sd-simplysm14/manuals/client-component.md +9 -1
- package/claude/references/sd-simplysm14/manuals/client-crud.md +1 -1
- package/claude/references/sd-simplysm14/manuals/client-orm.md +1 -0
- package/claude/references/sd-simplysm14/manuals/client-service.md +1 -0
- package/claude/references/sd-simplysm14/manuals/client-shared-data.md +1 -0
- package/claude/references/sd-simplysm14/manuals/client-ssg.md +1 -0
- package/claude/sd-system-prompt.md +11 -26
- package/claude/skills/sd-docs/references/subagent-prompt.md +4 -3
- package/claude/skills/sd-spec/SKILL.md +87 -18
- package/claude/skills/sd-spec/references/format.md +2 -2
- package/package.json +1 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
# @simplysm/excel — ExcelCell / ExcelRow / ExcelCol
|
|
2
2
|
|
|
3
|
-
개별 셀의 값·수식·병합·스타일을 읽고 쓰거나, 행/열 단위로 셀을 순회하고 열 너비를 줄 때 함께 읽는 묶음.
|
|
3
|
+
개별 셀의 값·수식·병합·스타일을 읽고 쓰거나, 행/열 단위로 셀을 순회하고 열 너비를 줄 때 함께 읽는 묶음. 핸들은 `ws.cell(r,c)` / `ws.row(r)` / `ws.col(c)` 로 얻으며(모두 0 기반, 동기 반환·인스턴스 캐시), 실제 I/O 는 셀의 `async` 메서드에서 일어난다.
|
|
4
4
|
|
|
5
5
|
## ExcelCell
|
|
6
6
|
|
|
7
|
-
`ws.cell(r, c)`
|
|
7
|
+
`ws.cell(r, c)` 가 반환. 셀 타입에 필요한 XML(SharedStrings/Styles)만 그때그때 로드하므로 모든 메서드가 `async`.
|
|
8
8
|
|
|
9
|
-
- `readonly addr: ExcelAddressPoint` —
|
|
9
|
+
- `readonly addr: ExcelAddressPoint` — 셀 0 기반 `{r,c}` 좌표.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### 값·수식
|
|
12
12
|
|
|
13
|
-
- `getValue(): Promise<ExcelValueType>` — 셀
|
|
14
|
-
- `setValue(val: ExcelValueType): Promise<void>` — 값
|
|
15
|
-
- `getFormula(): Promise<string | undefined>` — 셀 수식 문자열
|
|
16
|
-
- `setFormula(val: string | undefined): Promise<void>` — 수식 설정.
|
|
13
|
+
- `getValue(): Promise<ExcelValueType>` — 셀 값 반환. 셀 타입·numFmt 를 보고 `string`/`boolean`/`number`/`DateOnly`/`DateTime`/`Time` 로 자동 변환. 빈 셀은 `undefined`. 에러 셀(`t="e"`)은 throw.
|
|
14
|
+
- `setValue(val: ExcelValueType): Promise<void>` — 셀 값 설정. `string` → SharedString, `boolean` → `b`, `number` → 숫자, `DateOnly`/`DateTime`/`Time` → 시리얼 숫자 + 날짜 numFmt 자동 부여. `undefined` → 셀 삭제. 그 외 타입은 throw.
|
|
15
|
+
- `getFormula(): Promise<string | undefined>` — 셀 수식 문자열 반환.
|
|
16
|
+
- `setFormula(val: string | undefined): Promise<void>` — 셀 수식 설정. `undefined` 면 셀 삭제(수식 제거).
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
### 병합
|
|
19
19
|
|
|
20
|
-
- `merge(r: number, c: number): Promise<void>` — 현재
|
|
20
|
+
- `merge(r: number, c: number): Promise<void>` — 현재 셀을 좌상단으로 끝 좌표 `(r,c)`(0 기반, inclusive)까지 병합.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
### 스타일
|
|
23
23
|
|
|
24
|
-
- `getStyleId(): Promise<string | undefined>` —
|
|
25
|
-
- `setStyleId(styleId: string | undefined): Promise<void>` — 셀 스타일 ID 직접
|
|
26
|
-
- `setStyle(opts: ExcelStyleOptions): Promise<void>` —
|
|
24
|
+
- `getStyleId(): Promise<string | undefined>` — 셀 스타일 ID 반환.
|
|
25
|
+
- `setStyleId(styleId: string | undefined): Promise<void>` — 셀 스타일 ID 직접 설정(다른 셀에서 얻은 ID 재사용 등).
|
|
26
|
+
- `setStyle(opts: ExcelStyleOptions): Promise<void>` — 셀 스타일 설정. 기존 셀 스타일을 clone 후 지정 필드만 병합(부분 갱신). 옵션 상세는 [style.md](./style.md).
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
### 사용 예
|
|
29
29
|
|
|
30
30
|
```typescript
|
|
31
|
-
await ws.cell(0, 0).setValue("
|
|
32
|
-
await ws.cell(1, 0).setValue(new DateOnly(
|
|
33
|
-
await ws.cell(
|
|
34
|
-
const v = await ws.cell(1, 0).getValue(); // DateOnly 로 복원
|
|
31
|
+
await ws.cell(0, 0).setValue("이름");
|
|
32
|
+
await ws.cell(1, 0).setValue(new DateOnly(2024, 6, 15)); // 날짜 numFmt 자동
|
|
33
|
+
await ws.cell(0, 0).merge(0, 2); // A1:C1 병합
|
|
35
34
|
```
|
|
36
35
|
|
|
37
36
|
## ExcelRow
|
|
38
37
|
|
|
39
|
-
`ws.row(r)`
|
|
38
|
+
`ws.row(r)` 가 반환. 한 행의 셀 접근.
|
|
40
39
|
|
|
41
|
-
- `cell(c: number): ExcelCell` — 이 행의 0 기반 열
|
|
42
|
-
- `getCells(): Promise<ExcelCell[]>` —
|
|
40
|
+
- `cell(c: number): ExcelCell` — 이 행의 0 기반 열 셀.
|
|
41
|
+
- `getCells(): Promise<ExcelCell[]>` — 시트 데이터 범위 열 폭만큼 셀 배열(열 인덱스 위치에 채움).
|
|
43
42
|
|
|
44
43
|
## ExcelCol
|
|
45
44
|
|
|
46
|
-
`ws.col(c)`
|
|
45
|
+
`ws.col(c)` 가 반환. 한 열의 셀 접근 및 너비.
|
|
47
46
|
|
|
48
|
-
- `cell(r: number): ExcelCell` — 이 열의 0 기반 행
|
|
49
|
-
- `getCells(): Promise<ExcelCell[]>` —
|
|
50
|
-
- `setWidth(size: number): Promise<void>` — 열 너비
|
|
51
|
-
|
|
52
|
-
열 너비 예:
|
|
47
|
+
- `cell(r: number): ExcelCell` — 이 열의 0 기반 행 셀.
|
|
48
|
+
- `getCells(): Promise<ExcelCell[]>` — 시트 데이터 범위 행 높이만큼 셀 배열.
|
|
49
|
+
- `setWidth(size: number): Promise<void>` — 열 너비 설정.
|
|
53
50
|
|
|
54
51
|
```typescript
|
|
55
|
-
await ws.col(
|
|
52
|
+
await ws.col(2).setWidth(20);
|
|
53
|
+
for (const cell of await ws.row(0).getCells()) {
|
|
54
|
+
// 헤더 셀 순회
|
|
55
|
+
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## 주의사항
|
|
59
59
|
|
|
60
|
-
-
|
|
61
|
-
- `
|
|
62
|
-
- `
|
|
60
|
+
- 좌표·인덱스는 모두 0 기반. `cell(0,0)` = A1.
|
|
61
|
+
- `getValue` 의 결측은 `undefined` 로 보존된다(빈 셀과 "값 없음" 을 같은 것으로 다룸).
|
|
62
|
+
- 날짜 값은 `setValue` 에 `DateOnly`/`DateTime`/`Time` 인스턴스를 직접 넣으면 numFmt 가 자동 부여되므로, 별도 `setStyle({ numberFormat })` 가 보통 불필요하다.
|
|
@@ -8,28 +8,27 @@
|
|
|
8
8
|
ws.addConditionalFormat(opts: { ref: string; rules: ExcelConditionalRule[] }): Promise<void>
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
- `
|
|
12
|
-
- `
|
|
11
|
+
- `ref` — 단일 셀(`"A1"`) 또는 범위(`"A1:B10"`) 엑셀 주소. text/expression 규칙의 수식은 범위 좌상단(`ref` 의 `:` 앞 토큰)을 기준 셀로 삼는다.
|
|
12
|
+
- `rules` — 적용할 규칙 배열. 배열 순서가 priority(앞이 우선)이며, 같은 시트에 여러 번 호출하면 priority 가 시트 전역 카운터로 이어붙는다(1,2,3,…). 빈 배열이면 no-op.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
값 비교(단일):
|
|
17
|
-
|
|
18
|
-
- `{ type: "cellIs"; op: "<" | ">" | "<=" | ">=" | "=" | "<>"; value: number | string; style }` — 셀 값과 `value` 의 단일 비교. `op` = 비교 연산자(`"<>"` = 같지 않음). `value: number` 는 raw formula(`4999`), `value: string` 은 따옴표 리터럴(`"OK"`)로 emit. 수치 임계·특정 텍스트 일치 강조에.
|
|
19
|
-
|
|
20
|
-
값 비교(구간):
|
|
21
|
-
|
|
22
|
-
- `{ type: "cellIs"; op: "between" | "notBetween"; value: [number, number] | [string, string]; style }` — 두 값 사이 구간 비교(양 끝 inclusive). `op` = `"between"`(구간 안)/`"notBetween"`(구간 밖). `value` = `[a, b]` 튜플.
|
|
14
|
+
같은 시트에 여러 번 호출하면 호출마다 `<conditionalFormatting>` 블록이 누적되고, 동일 `style` 의 규칙은 dxf 가 dedupe 되어 1개로 등록된다.
|
|
23
15
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- `{ type: "text"; op: "contains" | "notContains" | "beginsWith" | "endsWith"; value: string; style }` — 문자열 매칭. `op` = `"contains"`(포함)/`"notContains"`(미포함)/`"beginsWith"`(시작)/`"endsWith"`(끝). 내부적으로 SEARCH 기반(대소문자 무시) formula 로 변환되며 비교 기준은 ref 좌상단 셀. 부분 문자열·접두/접미 강조에.
|
|
16
|
+
## ExcelConditionalRule
|
|
27
17
|
|
|
28
|
-
|
|
18
|
+
네 가지 변형의 유니온.
|
|
29
19
|
|
|
30
|
-
|
|
20
|
+
```typescript
|
|
21
|
+
type ExcelConditionalRule =
|
|
22
|
+
| { type: "cellIs"; op: "<" | ">" | "<=" | ">=" | "=" | "<>"; value: number | string; style: ExcelConditionalRuleStyle }
|
|
23
|
+
| { type: "cellIs"; op: "between" | "notBetween"; value: [number, number] | [string, string]; style: ExcelConditionalRuleStyle }
|
|
24
|
+
| { type: "text"; op: "contains" | "notContains" | "beginsWith" | "endsWith"; value: string; style: ExcelConditionalRuleStyle }
|
|
25
|
+
| { type: "expression"; formula: string; style: ExcelConditionalRuleStyle };
|
|
26
|
+
```
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
- `type: "cellIs"` 단일 비교 — `op` 가 `<`/`>`/`<=`/`>=`/`=`/`<>`. `value` 는 `number`(raw formula `<formula>4999</formula>`) 또는 `string`(따옴표 리터럴 `<formula>"OK"</formula>`). OOXML operator(`lessThan`/`greaterThan`/`lessThanOrEqual`/`greaterThanOrEqual`/`equal`/`notEqual`)로 매핑.
|
|
29
|
+
- `type: "cellIs"` 구간 — `op` 가 `between`/`notBetween`. `value` 는 `[a, b]` 튜플(양 끝 inclusive), number 튜플은 `["1000","2000"]`, string 튜플은 `['"A"','"M"']` 두 formula 로 emit.
|
|
30
|
+
- `type: "text"` 텍스트 매칭 — `op` 가 `contains`/`notContains`/`beginsWith`/`endsWith`. `value` 는 string. `contains` 는 `NOT(ISERROR(SEARCH(...)))`, `notContains` 는 `ISERROR(SEARCH(...))`, `beginsWith` 는 `LEFT(...)=v`, `endsWith` 는 `RIGHT(...)=v` 수식으로 emit(SEARCH 기반, 대소문자 무시 고정). 따옴표는 OOXML escape 규칙대로 두 배(`a"b` → `a""b`).
|
|
31
|
+
- `type: "expression"` — 임의 수식. `formula` 문자열을 raw 그대로 1개 formula 로 emit(operator 미부여). `AND($F2<>"",$F2-TODAY()<=7)` 같은 복합 조건에 사용.
|
|
33
32
|
|
|
34
33
|
## ExcelConditionalRuleStyle
|
|
35
34
|
|
|
@@ -41,11 +40,11 @@ interface ExcelConditionalRuleStyle {
|
|
|
41
40
|
}
|
|
42
41
|
```
|
|
43
42
|
|
|
44
|
-
- `background
|
|
45
|
-
- `fontColor
|
|
46
|
-
- `fontWeight
|
|
43
|
+
- `background` — 강조 배경색(ARGB 8자리, 예 `"00FFFF00"`).
|
|
44
|
+
- `fontColor` — 강조 글자색(ARGB 8자리).
|
|
45
|
+
- `fontWeight` — `"bold"` = 굵게, `"normal"` = base 가 bold 라도 강제 normal.
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
미지정 필드는 base 셀 스타일을 그대로 두고, 지정 필드만 OOXML dxf 로 emit 되어 native CF 오버레이로 합성된다.
|
|
49
48
|
|
|
50
49
|
## 사용 예
|
|
51
50
|
|
|
@@ -62,6 +61,6 @@ await ws.addConditionalFormat({
|
|
|
62
61
|
|
|
63
62
|
## 주의사항
|
|
64
63
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
64
|
+
- 규칙 배열 순서 = priority. 앞 규칙이 먼저 평가된다.
|
|
65
|
+
- `value` 의 number/string 구분이 formula emit 방식을 바꾼다 — 비교 대상이 텍스트면 반드시 `string` 으로 줄 것.
|
|
66
|
+
- toBytes → 재오픈 roundtrip 에서 type/operator/text/formula/dxf 가 보존된다.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @simplysm/excel — 셀 스타일
|
|
2
2
|
|
|
3
|
-
셀(`cell.setStyle(opts)`)이나 워크북 default(`wb.setDefaultStyle(opts)`)에 배경·테두리·정렬·숫자형식·폰트를 줄 때 참조. 두 호출 모두 동일한 `ExcelStyleOptions` 를 받는다. 미지정 필드는 emit 하지 않아 엑셀 기본값으로 표시되며, `cell.setStyle` 은 기존 셀 스타일을 clone 후 지정 필드만 병합(부분 갱신)한다.
|
|
3
|
+
셀(`cell.setStyle(opts)`)이나 워크북 default(`wb.setDefaultStyle(opts)`)에 배경·테두리·정렬·숫자형식·폰트를 줄 때 참조. 두 호출 모두 동일한 `ExcelStyleOptions` 를 받는다. 미지정 필드는 OOXML 자식 엘리먼트로 emit 하지 않아 엑셀 기본값으로 표시되며, `cell.setStyle` 은 기존 셀 스타일을 clone 후 지정 필드만 병합(부분 갱신)한다.
|
|
4
4
|
|
|
5
5
|
## ExcelStyleOptions
|
|
6
6
|
|
|
@@ -16,13 +16,13 @@ interface ExcelStyleOptions {
|
|
|
16
16
|
}
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
- `background
|
|
20
|
-
- `border
|
|
21
|
-
- `horizontalAlign
|
|
22
|
-
- `verticalAlign
|
|
23
|
-
- `numberFormat
|
|
24
|
-
- `numberFormatCode
|
|
25
|
-
- `font
|
|
19
|
+
- `background` — 배경색(ARGB 8자리 16진수, 예 `"00FF0000"` = 빨강). solid fill 로 채운다.
|
|
20
|
+
- `border: ExcelBorderPosition[]` — 테두리를 그릴 변(`"left"|"right"|"top"|"bottom"`)의 배열. 4변 전부면 4개를 모두 넣는다.
|
|
21
|
+
- `horizontalAlign` — 가로 정렬(`"center"|"left"|"right"`). 미지정 시 엑셀 기본.
|
|
22
|
+
- `verticalAlign` — 세로 정렬(`"center"|"top"|"bottom"`). 미지정 시 엑셀 기본.
|
|
23
|
+
- `numberFormat: ExcelNumberFormat` — 숫자형식 프리셋(`"number"|"string"|"DateOnly"|"DateTime"|"Time"`). 내장 numFmtId(0/49/14/22/18)로 매핑된다.
|
|
24
|
+
- `numberFormatCode` — 임의 Excel formatCode 문자열(예 `"0.000000"`, `"#,##0.00"`, `"0.00%"`). `numberFormat` 과 동시 지정 시 이 필드가 우선 적용된다.
|
|
25
|
+
- `font: ExcelFont` — 폰트 속성(아래). 미지정 폰트 속성은 워크북 default 폰트로 표시된다.
|
|
26
26
|
|
|
27
27
|
## ExcelFont
|
|
28
28
|
|
|
@@ -38,36 +38,30 @@ interface ExcelFont {
|
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
- `size
|
|
42
|
-
- `family
|
|
43
|
-
- `bold
|
|
44
|
-
- `italic
|
|
45
|
-
- `underline
|
|
46
|
-
- `color
|
|
47
|
-
- `strike
|
|
41
|
+
- `size` — 폰트 크기(pt).
|
|
42
|
+
- `family` — 폰트명(예 `"맑은 고딕"`, `"Calibri"`).
|
|
43
|
+
- `bold` — 굵게.
|
|
44
|
+
- `italic` — 기울임.
|
|
45
|
+
- `underline: ExcelFontUnderline` — 밑줄 종류(`"single"|"double"|"singleAccounting"|"doubleAccounting"`). `<u val="...">` 의 val 에 그대로 매핑.
|
|
46
|
+
- `color` — 글자색(ARGB 8자리, 예 `"00FF0000"`).
|
|
47
|
+
- `strike` — 취소선.
|
|
48
|
+
|
|
49
|
+
`ExcelFont` 은 셀 단위 override(`ExcelStyleOptions.font`)와 워크북 default(`wb.setDefaultStyle({ font })`) 양쪽이 공유한다. 미지정 속성은 `<font>` 자식 엘리먼트로 emit 되지 않으며 엑셀 자체 기본값으로 표시된다.
|
|
48
50
|
|
|
49
51
|
## 사용 예
|
|
50
52
|
|
|
51
53
|
```typescript
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
background: "00FFFF00", // 노랑 헤더
|
|
54
|
+
await cell.setStyle({
|
|
55
|
+
background: "00FFFF00",
|
|
55
56
|
border: ["left", "right", "top", "bottom"],
|
|
56
57
|
horizontalAlign: "center",
|
|
57
|
-
|
|
58
|
-
font: { family: "맑은 고딕", bold: true },
|
|
58
|
+
numberFormatCode: "#,##0",
|
|
59
|
+
font: { family: "맑은 고딕", size: 10, bold: true },
|
|
59
60
|
});
|
|
60
|
-
|
|
61
|
-
// 커스텀 숫자 형식
|
|
62
|
-
await ws.cell(1, 2).setStyle({ numberFormatCode: "#,##0.00" });
|
|
63
|
-
|
|
64
|
-
// 워크북 전역 default
|
|
65
|
-
await wb.setDefaultStyle({ font: { family: "맑은 고딕", size: 10 } });
|
|
66
61
|
```
|
|
67
62
|
|
|
68
63
|
## 주의사항
|
|
69
64
|
|
|
70
|
-
- `
|
|
71
|
-
- `
|
|
72
|
-
- 색상은 모두 ARGB 8자리(알파
|
|
73
|
-
- 날짜/시간 셀은 값으로 `DateOnly`/`DateTime`/`Time` 을 넣으면 numFmt 가 자동 부여되므로 보통 `numberFormat` 을 따로 줄 필요가 없다.
|
|
65
|
+
- `cell.setStyle` 은 부분 갱신(clone + merge)이므로, 같은 셀에 두 번 호출하면 두 호출의 지정 필드가 누적된다.
|
|
66
|
+
- `wb.setDefaultStyle` 은 0번 자원 슬롯 자체를 덮어쓰는 전역 설정이라 동작이 다르다 — `font`/`background`/`border` 미지정 슬롯은 빈 슬롯으로 reset 되고, `horizontalAlign`/`verticalAlign`/`numberFormat`/`numberFormatCode` 는 `cellXfs[0]` 에 박힌다(상세는 [workbook-worksheet.md](./workbook-worksheet.md)).
|
|
67
|
+
- 색상은 모두 ARGB 8자리(앞 2자리 알파). 6자리 RGB 가 아님.
|
|
@@ -4,42 +4,39 @@
|
|
|
4
4
|
|
|
5
5
|
## 주소 변환
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- `
|
|
10
|
-
- `
|
|
11
|
-
- `
|
|
12
|
-
- `
|
|
13
|
-
- `
|
|
14
|
-
- `
|
|
15
|
-
- `parseRangeAddr(rangeAddr: string): ExcelAddressRangePoint` — 범위 주소를 좌표로(예 `"A1:C3"` → `{s:{r:0,c:0}, e:{r:2,c:2}}`). `:` 없는 단일 주소면 `s`=`e`.
|
|
16
|
-
- `stringifyRangeAddr(point: ExcelAddressRangePoint): string` — 범위 좌표를 문자열로. `s`=`e` 면 단일 주소 1개만 반환.
|
|
7
|
+
- `stringifyAddr(point: ExcelAddressPoint): string` — 좌표 `{r,c}`(0 기반)를 `"A1"` 형식으로. 예 `{r:0,c:0}` → `"A1"`.
|
|
8
|
+
- `stringifyRowAddr(r: number): string` — 행 인덱스(0 기반)를 행 주소 문자열로. 예 `0` → `"1"`.
|
|
9
|
+
- `stringifyColAddr(c: number): string` — 열 인덱스(0 기반)를 열 문자로. 예 `0` → `"A"`, `26` → `"AA"`. 범위 `0~16383` 밖이면 throw.
|
|
10
|
+
- `parseRowAddr(addr: string): number` — 주소에서 행 인덱스(0 기반) 추출. 예 `"A3"` → `2`.
|
|
11
|
+
- `parseColAddr(addr: string): number` — 주소에서 열 인덱스 추출. 예 `"B3"` → `1`.
|
|
12
|
+
- `parseCellAddr(addr: string): ExcelAddressPoint` — 주소를 좌표로. 예 `"B3"` → `{r:2,c:1}`.
|
|
13
|
+
- `parseRangeAddr(rangeAddr: string): ExcelAddressRangePoint` — 범위 주소를 좌표로. 예 `"A1:C3"` → `{s:{r:0,c:0}, e:{r:2,c:2}}`. `:` 없으면 단일 셀을 `s`/`e` 양쪽에 채움.
|
|
14
|
+
- `stringifyRangeAddr(point: ExcelAddressRangePoint): string` — 범위 좌표를 주소로. `s`==`e` 면 단일 주소로 축약.
|
|
17
15
|
|
|
18
16
|
## 날짜 시리얼 변환
|
|
19
17
|
|
|
20
|
-
엑셀은
|
|
18
|
+
엑셀은 1899-12-30 을 날짜 0(1900-01-01 = 1)으로 계산한다. 로컬 타임존 보정을 포함한다.
|
|
21
19
|
|
|
22
|
-
- `convertTimeTickToNumber(tick: number): number` — JS 타임스탬프(ms)를 엑셀 날짜 시리얼 숫자로.
|
|
23
|
-
- `convertNumberToTimeTick(value: number): number` — 엑셀 날짜 시리얼 숫자를 JS 타임스탬프(ms)로.
|
|
20
|
+
- `convertTimeTickToNumber(tick: number): number` — JS 타임스탬프(ms)를 엑셀 날짜 시리얼 숫자로.
|
|
21
|
+
- `convertNumberToTimeTick(value: number): number` — 엑셀 날짜 시리얼 숫자를 JS 타임스탬프(ms)로.
|
|
24
22
|
|
|
25
23
|
## 숫자형식 변환
|
|
26
24
|
|
|
27
|
-
`ExcelNumberFormat`
|
|
25
|
+
`ExcelNumberFormat`(`"number"|"string"|"DateOnly"|"DateTime"|"Time"`) 과 엑셀 numFmtId/formatCode 사이 변환.
|
|
28
26
|
|
|
29
|
-
- `convertNumFmtCodeToName(numFmtCode: string): ExcelNumberFormat` — formatCode 문자열을
|
|
30
|
-
- `convertNumFmtIdToName(numFmtId: number): ExcelNumberFormat` —
|
|
31
|
-
- `convertNumFmtNameToId(numFmtName: ExcelNumberFormat): number` — 이름을
|
|
27
|
+
- `convertNumFmtCodeToName(numFmtCode: string): ExcelNumberFormat` — formatCode 문자열을 프리셋 이름으로. `"General"` → `"number"`, `yy`/`dd`/`mm`(시간 문맥 제외) 포함 → 날짜, `h`/`hh`/`ss` 포함 → 시간, 날짜+시간 동시 → `"DateTime"`. 순수 숫자 패턴은 `"number"`. 어느 것도 아니면 throw.
|
|
28
|
+
- `convertNumFmtIdToName(numFmtId: number): ExcelNumberFormat` — 내장 형식 ID 를 이름으로. 0~13/37~40/48 → `"number"`, 14~17/27~31/34~36/50~58 → `"DateOnly"`, 22 → `"DateTime"`, 18~21/32~33/45~47 → `"Time"`, 49 → `"string"`. 그 외 throw.
|
|
29
|
+
- `convertNumFmtNameToId(numFmtName: ExcelNumberFormat): number` — 이름을 ID 로. `"number"`→0, `"DateOnly"`→14, `"DateTime"`→22, `"Time"`→18, `"string"`→49.
|
|
32
30
|
|
|
33
31
|
## 사용 예
|
|
34
32
|
|
|
35
33
|
```typescript
|
|
36
|
-
ExcelUtils.parseRangeAddr("A1:C3"); // {
|
|
37
|
-
ExcelUtils.stringifyAddr({ r:
|
|
38
|
-
ExcelUtils.convertNumFmtIdToName(22); // "DateTime"
|
|
34
|
+
const { s, e } = ExcelUtils.parseRangeAddr("A1:C3"); // {s:{r:0,c:0}, e:{r:2,c:2}}
|
|
35
|
+
const addr = ExcelUtils.stringifyAddr({ r: 0, c: 27 }); // "AB1"
|
|
39
36
|
```
|
|
40
37
|
|
|
41
38
|
## 주의사항
|
|
42
39
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
40
|
+
- 모든 좌표·인덱스는 0 기반, 주소 문자열은 1 기반(엑셀 표기).
|
|
41
|
+
- 날짜 변환은 타임존 보정을 포함하므로 시리얼 ↔ tick 왕복이 로컬 기준으로 일관된다.
|
|
42
|
+
- 알 수 없는 numFmtCode/numFmtId 는 silent fallback 없이 throw — 외부 생성 파일의 비정형 형식을 만나면 예외로 드러난다.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @simplysm/excel — ExcelWorkbook / ExcelWorksheet
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`.xlsx` 워크북을 열거나(기존 바이트/Blob) 새로 만들고, 시트를 추가·조회하고, 시트 단위로 데이터·뷰·이미지·복사·내보내기를 다루는 핵심 클래스 군. 워크북은 내부적으로 ZIP 리소스를 lazy-load 로 관리하므로 사용 후 반드시 `close()` 로 해제해야 한다. 행/열·단일 셀 핸들은 [cell.md](./cell.md) 참조.
|
|
4
4
|
|
|
5
5
|
## ExcelWorkbook
|
|
6
6
|
|
|
@@ -8,20 +8,22 @@
|
|
|
8
8
|
new ExcelWorkbook(arg?: Blob | Bytes)
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
- `arg
|
|
11
|
+
- `arg` — 기존 Excel 파일 데이터(`Blob` 또는 `Uint8Array`/`Bytes`). 생략하면 빈 워크북을 새로 생성한다(ContentTypes/rels/workbook 기본 파트 자동 구성).
|
|
12
|
+
- `readonly zipCache: ZipCache` — 내부 ZIP 파트 캐시. 일반 사용에서 직접 만질 일은 없다.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
### 메서드
|
|
14
15
|
|
|
15
|
-
- `getWorksheetNames(): Promise<string[]>` — 워크북의 모든
|
|
16
|
-
- `addWorksheet(name: string): Promise<ExcelWorksheet>` — 새
|
|
17
|
-
- `getWorksheet(nameOrIndex: string | number): Promise<ExcelWorksheet>` — 이름(string) 또는 0 기반 인덱스(number)로
|
|
18
|
-
- `setDefaultStyle(opts: ExcelStyleOptions): Promise<void>` — 워크북
|
|
19
|
-
- `toBytes(): Promise<Bytes>` — 워크북을
|
|
20
|
-
- `toBlob(): Promise<Blob>` — 워크북을 `.
|
|
21
|
-
- `close(): Promise<void>` — ZIP 리더·내부 캐시 해제.
|
|
22
|
-
- `readonly zipCache: ZipCache` — 내부 ZIP 캐시 핸들(저수준). 일반 사용에서 직접 만질 일 없음.
|
|
16
|
+
- `getWorksheetNames(): Promise<string[]>` — 워크북의 모든 워크시트 이름을 순서대로 반환.
|
|
17
|
+
- `addWorksheet(name: string): Promise<ExcelWorksheet>` — 새 워크시트를 생성해 반환. ContentTypes/rels/workbook 파트를 함께 갱신한다.
|
|
18
|
+
- `getWorksheet(nameOrIndex: string | number): Promise<ExcelWorksheet>` — 이름(string) 또는 0 기반 인덱스(number)로 워크시트 조회. 못 찾으면 throw. 같은 시트를 다시 요청하면 동일 인스턴스를 캐시 반환.
|
|
19
|
+
- `setDefaultStyle(opts: ExcelStyleOptions): Promise<void>` — 워크북 default cell style 설정. `styles.xml` 의 `fonts[0]`/`fills[0]`/`borders[0]`(OOXML 0번 자원 슬롯) 자체를 덮어써, fontId/fillId/borderId 를 명시하지 않은 모든 셀에 전역 적용된다. 옵션이 없는 자원 슬롯은 빈 슬롯으로 reset. 옵션 상세는 [style.md](./style.md).
|
|
20
|
+
- `toBytes(): Promise<Bytes>` — 워크북을 바이트 배열로 직렬화.
|
|
21
|
+
- `toBlob(): Promise<Blob>` — 워크북을 `.xlsx` MIME 의 `Blob` 으로 직렬화(다운로드용).
|
|
22
|
+
- `close(): Promise<void>` — ZIP 리더·내부 캐시 해제. 호출 후 인스턴스 사용 불가. 이미 닫힌 워크북에 호출해도 안전(no-op).
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
닫힌 워크북의 시트/스타일/내보내기 메서드를 호출하면 throw 된다.
|
|
25
|
+
|
|
26
|
+
### 사용 예
|
|
25
27
|
|
|
26
28
|
```typescript
|
|
27
29
|
const wb = new ExcelWorkbook(bytes);
|
|
@@ -33,89 +35,76 @@ try {
|
|
|
33
35
|
}
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
쓰기 예:
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
const wb = new ExcelWorkbook();
|
|
40
|
-
try {
|
|
41
|
-
await wb.setDefaultStyle({ font: { family: "맑은 고딕", size: 10 } });
|
|
42
|
-
const ws = await wb.addWorksheet("결과");
|
|
43
|
-
await ws.setRecords([{ 코드: "A1", 수량: 3 }]);
|
|
44
|
-
return await wb.toBytes();
|
|
45
|
-
} finally {
|
|
46
|
-
await wb.close();
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
38
|
## ExcelWorksheet
|
|
51
39
|
|
|
52
|
-
`
|
|
40
|
+
`getWorksheet`/`addWorksheet` 가 반환. 셀/행/열 접근, 데이터 일괄 입출력, 복사, 뷰, 조건부 서식, 이미지 삽입을 제공한다.
|
|
53
41
|
|
|
54
|
-
|
|
42
|
+
### 이름
|
|
55
43
|
|
|
56
|
-
- `getName(): Promise<string>` — 시트 이름 반환.
|
|
44
|
+
- `getName(): Promise<string>` — 시트 이름 반환.
|
|
57
45
|
- `setName(newName: string): Promise<void>` — 시트 이름 변경.
|
|
58
46
|
|
|
59
|
-
|
|
47
|
+
### 셀·행·열 접근
|
|
60
48
|
|
|
61
|
-
- `cell(r: number, c: number): ExcelCell` — 0 기반
|
|
62
|
-
- `row(r: number): ExcelRow` — 0 기반 행
|
|
63
|
-
- `col(c: number): ExcelCol` — 0 기반 열
|
|
49
|
+
- `cell(r: number, c: number): ExcelCell` — 0 기반 행/열 셀 핸들. 동일 좌표는 같은 인스턴스 캐시 반환.
|
|
50
|
+
- `row(r: number): ExcelRow` — 0 기반 행 핸들.
|
|
51
|
+
- `col(c: number): ExcelCol` — 0 기반 열 핸들.
|
|
64
52
|
|
|
65
|
-
|
|
53
|
+
(셀/행/열 API 상세는 [cell.md](./cell.md))
|
|
66
54
|
|
|
67
|
-
|
|
68
|
-
- `getCells(): Promise<ExcelCell[][]>` — 데이터 범위 전체 셀을 행 우선 2차원 배열로 반환. 채워지는 인덱스는 range 기준(앞쪽 빈 행/열은 비어 있음).
|
|
55
|
+
### 범위·일괄 입출력
|
|
69
56
|
|
|
70
|
-
데이터(
|
|
57
|
+
- `getRange(): Promise<ExcelAddressRangePoint>` — 시트 데이터 범위(`{s,e}`, 양 끝 inclusive) 반환.
|
|
58
|
+
- `getCells(): Promise<ExcelCell[][]>` — 데이터 범위 전체를 행 우선 2차원 셀 배열로 반환.
|
|
59
|
+
- `getDataTable(opt?): Promise<Record<string, ExcelValueType>[]>` — 헤더 행을 키로 하는 레코드 배열 반환.
|
|
60
|
+
- `opt.headerRowIndex` — 헤더 행 인덱스(기본: 데이터 범위 첫 행).
|
|
61
|
+
- `opt.checkEndColIndex` — 이 열이 비면 데이터 끝으로 판단해 이후 행을 끊는다.
|
|
62
|
+
- `opt.usableHeaderNameFn: (headerName: string) => boolean` — `true` 인 헤더명만 컬럼으로 채택(필터링). 중복 헤더는 throw.
|
|
63
|
+
- `setDataMatrix(matrix: ExcelValueType[][]): Promise<void>` — 2차원 배열을 행 우선(인덱스 0 = 첫 행)으로 기록. `undefined` 셀은 삭제.
|
|
64
|
+
- `setRecords(records: Record<string, ExcelValueType>[]): Promise<void>` — 레코드 배열 기록. 0 행에 키 합집합 헤더를 자동 생성하고 이후 행에 값 기록(빈 헤더 제외).
|
|
71
65
|
|
|
72
|
-
|
|
73
|
-
- `opt.headerRowIndex?: number` — 헤더로 쓸 행 인덱스. 미지정 시 range 시작 행. 상단에 제목 행이 있으면 실제 헤더 행 인덱스를 지정.
|
|
74
|
-
- `opt.checkEndColIndex?: number` — 데이터 끝 판정 열. 그 열 셀이 비면 이후 행을 더 읽지 않고 종료. 빈 행으로 데이터가 끊기는 양식에서 사용.
|
|
75
|
-
- `opt.usableHeaderNameFn?: (headerName: string) => boolean` — 헤더 채택 필터. `true` 인 헤더만 키로 사용. 일부 열만 읽을 때. 채택된 헤더가 한 행 내 중복이면 throw.
|
|
76
|
-
- `setDataMatrix(matrix: ExcelValueType[][]): Promise<void>` — 2차원 배열을 0,0 부터 행 우선으로 쓰기. 헤더 없이 좌표 그대로 채울 때. `undefined` 원소는 해당 셀 삭제.
|
|
77
|
-
- `setRecords(records: Record<string, ExcelValueType>[]): Promise<void>` — 0행에 헤더(전 레코드 키 합집합, 빈 키 제외)를 자동 생성하고 1행부터 값 기록. 키 순서는 첫 등장 순. 표 형태 출력의 기본 수단.
|
|
66
|
+
### 복사·삽입
|
|
78
67
|
|
|
79
|
-
|
|
68
|
+
- `copyCellStyle(srcAddr, targetAddr): Promise<void>` — 셀 스타일 ID 만 복사.
|
|
69
|
+
- `copyRowStyle(srcR, targetR): Promise<void>` — 데이터 범위 폭만큼 행 셀 스타일 복사.
|
|
70
|
+
- `copyCell(srcAddr, targetAddr): Promise<void>` — 셀 전체 복사.
|
|
71
|
+
- `copyRow(srcR, targetR): Promise<void>` — 원본 행을 대상 행에 복사(덮어쓰기).
|
|
72
|
+
- `insertCopyRow(srcR: number, targetR: number): Promise<void>` — 원본 행을 대상 위치에 삽입 복사. 대상 이하 기존 행은 한 칸 아래로 밀리고, 삽입 지점을 관통하는 다중행 병합은 1행 확장, 원본의 단일행 병합은 대상 행에 복사된다.
|
|
80
73
|
|
|
81
|
-
|
|
82
|
-
- `setZoom(percent: number): Promise<void>` — 확대/축소 비율(퍼센트). 워크북 뷰를 함께 초기화한다.
|
|
83
|
-
- `freezeAt(point: { r?: number; c?: number }): Promise<void>` — 틀 고정. `r` = 위쪽 고정할 행 분할 지점, `c` = 왼쪽 고정할 열 분할 지점(0 기반). 헤더 한 줄 고정이면 `{ r: 0 }`(0행까지 위가 고정되고 1행부터 스크롤). 워크북 뷰를 함께 초기화한다.
|
|
84
|
-
- `setAutoFilter(range: ExcelAddressRangePoint): Promise<void>` — 헤더 자동 필터(드롭다운) 설정. `range`(`{s,e}`, 0 기반, 양끝 inclusive) = 필터를 거는 범위로 보통 헤더행~데이터 끝 전체를 덮는다. `getRange()` 반환값을 그대로 넘겨 표 전체에 적용할 수 있다.
|
|
74
|
+
(`srcAddr`/`targetAddr` 는 `ExcelAddressPoint`)
|
|
85
75
|
|
|
86
|
-
|
|
76
|
+
### 뷰
|
|
87
77
|
|
|
88
|
-
- `
|
|
78
|
+
- `setTabColor(color: string): Promise<void>` — 시트 탭 색(ARGB 8자리, 예 `"00FF0000"`).
|
|
79
|
+
- `setZoom(percent: number): Promise<void>` — 확대/축소 비율(퍼센트).
|
|
80
|
+
- `freezeAt(point: { r?: number; c?: number }): Promise<void>` — 행/열 틀 고정. `r` 만 주면 가로 틀고정, `c` 만 주면 세로 틀고정, 둘 다 주면 교차 고정.
|
|
81
|
+
- `setAutoFilter(range: ExcelAddressRangePoint): Promise<void>` — 헤더 자동 필터(드롭다운). 범위는 헤더행~데이터 끝 전체를 덮도록 지정. 단일 셀 범위는 단일 주소로 축약 emit.
|
|
89
82
|
|
|
90
|
-
|
|
83
|
+
### 조건부 서식
|
|
91
84
|
|
|
92
|
-
- `
|
|
93
|
-
- `copyRowStyle(srcR: number, targetR: number): Promise<void>` — range 내 모든 열에 대해 행 스타일 복사.
|
|
94
|
-
- `copyCell(srcAddr: ExcelAddressPoint, targetAddr: ExcelAddressPoint): Promise<void>` — 셀(값+스타일)을 대상에 복사.
|
|
95
|
-
- `copyRow(srcR: number, targetR: number): Promise<void>` — 행 전체를 대상 행에 복사(대상 기존 내용 덮어쓰기).
|
|
96
|
-
- `insertCopyRow(srcR: number, targetR: number): Promise<void>` — 원본 행을 대상 위치에 "삽입" 복사. 대상 이하 기존 행은 1칸 아래로 밀리고, 삽입 지점을 관통하는 다중행 병합은 1행 확장, 원본의 단일행 병합은 대상 행에 복제된다. 템플릿 행을 반복 펼칠 때 사용(덮어쓰기 방지).
|
|
85
|
+
- `addConditionalFormat(opts: { ref: string; rules: ExcelConditionalRule[] }): Promise<void>` — 셀/범위에 native CF 규칙 추가. 상세는 [conditional-format.md](./conditional-format.md).
|
|
97
86
|
|
|
98
|
-
|
|
87
|
+
### 이미지
|
|
99
88
|
|
|
100
|
-
- `addImage(opts): Promise<void>` —
|
|
89
|
+
- `addImage(opts): Promise<void>` — 워크시트에 이미지 삽입.
|
|
101
90
|
- `opts.bytes: Bytes` — 이미지 바이너리.
|
|
102
|
-
- `opts.ext: string` — 확장자(`
|
|
103
|
-
- `opts.from: { r
|
|
104
|
-
- `opts.to?: { r
|
|
91
|
+
- `opts.ext: string` — 확장자(`png`/`jpg` 등). MIME 결정 불가 시 throw.
|
|
92
|
+
- `opts.from: { r; c; rOff?: number | string; cOff?: number | string }` — 시작 위치(0 기반 행/열, `rOff`/`cOff` 는 EMU 오프셋).
|
|
93
|
+
- `opts.to?: { r; c; rOff?; cOff? }` — 끝 위치. 생략 시 `from` 의 1행 1열 아래(원본 1셀 크기)로 삽입.
|
|
105
94
|
|
|
106
|
-
|
|
95
|
+
### 사용 예
|
|
107
96
|
|
|
108
97
|
```typescript
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
98
|
+
const wb = new ExcelWorkbook();
|
|
99
|
+
const ws = await wb.addWorksheet("목록");
|
|
100
|
+
await ws.setRecords([{ 이름: "홍길동", 나이: 30 }]);
|
|
101
|
+
await ws.freezeAt({ r: 0 });
|
|
102
|
+
const blob = await wb.toBlob();
|
|
103
|
+
await wb.close();
|
|
115
104
|
```
|
|
116
105
|
|
|
117
106
|
## 주의사항
|
|
118
107
|
|
|
119
|
-
-
|
|
120
|
-
- `
|
|
121
|
-
-
|
|
108
|
+
- 모든 워크북 I/O 는 `close()` 로 마무리할 것. 예외 경로에서도 누락되지 않게 `try/finally` 사용.
|
|
109
|
+
- `getDataTable`/`setRecords`/`getValue` 는 모두 결측을 `undefined` 로 보존한다(빈 셀 = `undefined`).
|
|
110
|
+
- 셀 좌표·범위·시트 인덱스는 전부 0 기반.
|