@simplysm/excel 14.0.48 → 14.0.50
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 +26 -48
- package/dist/xml/excel-xml-workbook.js +2 -2
- package/dist/xml/excel-xml-workbook.js.map +1 -1
- package/docs/core-classes/excel-cell.md +73 -0
- package/docs/core-classes/excel-col.md +36 -0
- package/docs/core-classes/excel-row.md +34 -0
- package/docs/core-classes/excel-workbook.md +59 -0
- package/docs/core-classes/excel-worksheet.md +139 -0
- package/docs/types/excel-address-point.md +33 -0
- package/docs/types/excel-style-options.md +57 -0
- package/docs/types/excel-value-type.md +28 -0
- package/docs/types/excel-xml-content-type-data.md +23 -0
- package/docs/types/excel-xml-drawing-data.md +29 -0
- package/docs/types/excel-xml-relationship-data.md +39 -0
- package/docs/types/excel-xml-shared-string-data.md +42 -0
- package/docs/types/excel-xml-style-data.md +97 -0
- package/docs/types/excel-xml-workbook-data.md +22 -0
- package/docs/types/excel-xml-worksheet-data.md +68 -0
- package/docs/types/excel-xml.md +15 -0
- package/docs/utilities/excel-utils.md +93 -0
- package/docs/wrapper/excel-wrapper.md +100 -0
- package/package.json +2 -2
- package/src/xml/excel-xml-workbook.ts +2 -2
- package/docs/core-classes.md +0 -453
- package/docs/types.md +0 -459
- package/docs/utilities.md +0 -194
- package/docs/wrapper.md +0 -73
package/docs/wrapper.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Wrapper
|
|
2
|
-
|
|
3
|
-
## `ExcelWrapper`
|
|
4
|
-
|
|
5
|
-
Zod 스키마 기반 타입 안전한 Excel 읽기/쓰기 래퍼. 스키마에서 타입 정보를 추론하여 타입 안전한 읽기/쓰기를 제공한다.
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
export class ExcelWrapper<TSchema extends z.ZodObject<z.ZodRawShape>> {
|
|
9
|
-
constructor(schema: TSchema);
|
|
10
|
-
|
|
11
|
-
async read(
|
|
12
|
-
file: Bytes | Blob,
|
|
13
|
-
wsNameOrIndex?: string | number,
|
|
14
|
-
options?: { excludes?: (keyof z.infer<TSchema>)[] },
|
|
15
|
-
): Promise<z.infer<TSchema>[]>;
|
|
16
|
-
|
|
17
|
-
async write(
|
|
18
|
-
wsName: string,
|
|
19
|
-
records: Partial<z.infer<TSchema>>[],
|
|
20
|
-
options?: { excludes?: (keyof z.infer<TSchema>)[] },
|
|
21
|
-
): Promise<ExcelWorkbook>;
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Constructor
|
|
26
|
-
|
|
27
|
-
| Parameter | Type | Description |
|
|
28
|
-
|-----------|------|-------------|
|
|
29
|
-
| `schema` | `TSchema extends z.ZodObject<z.ZodRawShape>` | Zod 스키마. `.describe()`로 Excel 헤더 이름을 지정한다 |
|
|
30
|
-
|
|
31
|
-
### Methods
|
|
32
|
-
|
|
33
|
-
#### `read(file, wsNameOrIndex?, options?)`
|
|
34
|
-
|
|
35
|
-
Excel 파일을 레코드 배열로 읽는다. 헤더 행의 텍스트를 스키마의 `.describe()` 값과 매칭하여 필드를 연결한다. Zod 스키마로 유효성 검사를 수행하며, 실패 시 에러를 던진다.
|
|
36
|
-
|
|
37
|
-
| Parameter | Type | Description |
|
|
38
|
-
|-----------|------|-------------|
|
|
39
|
-
| `file` | `Bytes \| Blob` | Excel 파일 데이터 |
|
|
40
|
-
| `wsNameOrIndex` | `string \| number` | 워크시트 이름 또는 0 기반 인덱스 (기본값: `0`) |
|
|
41
|
-
| `options.excludes` | `(keyof z.infer<TSchema>)[]` | 읽기에서 제외할 필드 키 배열 |
|
|
42
|
-
|
|
43
|
-
**반환값:** `z.infer<TSchema>[]` - 스키마 타입으로 추론된 레코드 배열
|
|
44
|
-
|
|
45
|
-
**타입 변환 규칙:**
|
|
46
|
-
|
|
47
|
-
| 스키마 타입 | 변환 동작 |
|
|
48
|
-
|------------|-----------|
|
|
49
|
-
| `z.string()` | 문자열로 변환 (`String(rawValue)`) |
|
|
50
|
-
| `z.number()` | 숫자로 파싱 (`num.parseFloat`) |
|
|
51
|
-
| `z.boolean()` | `"1"`, `"true"` -> `true`, `"0"`, `"false"` -> `false` |
|
|
52
|
-
| `z.optional()` / `z.nullable()` | 빈 셀을 `undefined`로 반환 |
|
|
53
|
-
| `z.default(value)` | 빈 셀에 기본값 적용 |
|
|
54
|
-
| `DateOnly` / `DateTime` / `Time` | `instanceof`로 직접 전달 |
|
|
55
|
-
|
|
56
|
-
#### `write(wsName, records, options?)`
|
|
57
|
-
|
|
58
|
-
레코드 배열을 Excel 워크북으로 변환한다. 반환된 `ExcelWorkbook`의 리소스 관리는 호출자의 책임이다. 내부에서 에러 발생 시 워크북이 자동으로 `close()`된다.
|
|
59
|
-
|
|
60
|
-
| Parameter | Type | Description |
|
|
61
|
-
|-----------|------|-------------|
|
|
62
|
-
| `wsName` | `string` | 워크시트 이름 |
|
|
63
|
-
| `records` | `Partial<z.infer<TSchema>>[]` | 레코드 배열 |
|
|
64
|
-
| `options.excludes` | `(keyof z.infer<TSchema>)[]` | 쓰기에서 제외할 필드 키 배열 |
|
|
65
|
-
|
|
66
|
-
**반환값:** `ExcelWorkbook` - 호출자가 `try-finally` 블록에서 `close()`를 호출하여 리소스를 관리해야 한다
|
|
67
|
-
|
|
68
|
-
**쓰기 동작:**
|
|
69
|
-
|
|
70
|
-
- 첫 번째 행에 헤더 자동 생성 (스키마의 `.describe()` 값 사용)
|
|
71
|
-
- 모든 셀에 테두리 스타일 자동 적용
|
|
72
|
-
- 필수 비boolean 필드의 헤더에 노란색 배경(`00FFFF00`) 강조
|
|
73
|
-
- 확대/축소 85%, 첫 번째 행 틀 고정 자동 설정
|