@cj-tech-master/excelts 2.0.0 → 2.0.1

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.
@@ -24,12 +24,6 @@ export type RowTransformFunction<I = Row, O = Row> = ((row: I) => O | null) | ((
24
24
  export type RowValidateCallback = (error?: Error | null, isValid?: boolean, reason?: string) => void;
25
25
  /** Row validate function - sync or async */
26
26
  export type RowValidateFunction<T = Row> = ((row: T) => boolean) | ((row: T, callback: RowValidateCallback) => void);
27
- /** Validation result */
28
- export interface RowValidationResult<T = Row> {
29
- row: T | null;
30
- isValid: boolean;
31
- reason?: string;
32
- }
33
27
  /**
34
28
  * CSV parsing options
35
29
  */
@@ -51,7 +51,7 @@ interface EntryPayload {
51
51
  id?: string;
52
52
  }
53
53
  /** Parse event types */
54
- export type ParseEventType = "shared-strings" | "worksheet" | "hyperlinks";
54
+ export type ParseEventType = EntryPayload["type"];
55
55
  export interface SharedStringEvent {
56
56
  eventType: "shared-strings";
57
57
  value: {
@@ -10,7 +10,7 @@ export interface WorksheetHyperlink {
10
10
  rId: string;
11
11
  }
12
12
  /** Events emitted during worksheet parsing */
13
- export type WorksheetEventType = "row" | "hyperlink";
13
+ export type WorksheetEventType = RowEvent["eventType"] | HyperlinkEvent["eventType"];
14
14
  /** Row event emitted during parsing */
15
15
  export interface RowEvent {
16
16
  eventType: "row";
@@ -6,35 +6,6 @@
6
6
  */
7
7
  /** Supported date format strings */
8
8
  export type DateFormat = "YYYY-MM-DD[T]HH:mm:ssZ" | "YYYY-MM-DD[T]HH:mm:ss" | "YYYY-MM-DD[T]HH:mm:ss.SSSZ" | "YYYY-MM-DD" | "YYYY-MM-DD HH:mm:ss" | "MM-DD-YYYY" | "MM-DD-YYYY HH:mm:ss" | "MM/DD/YYYY HH:mm:ss" | "DD-MM-YYYY" | "DD-MM-YYYY HH:mm:ss" | "DD/MM/YYYY HH:mm:ss";
9
- /**
10
- * Quick pre-filter to reject non-date strings
11
- */
12
- export declare function mightBeDate(s: string): boolean;
13
- /**
14
- * Parse a date string
15
- *
16
- * @param value - String to parse
17
- * @param formats - Specific formats to try (optional, auto-detects ISO if omitted)
18
- * @returns Date object or null
19
- *
20
- * @example
21
- * parseDate("2024-12-26") // auto-detect ISO
22
- * parseDate("12-26-2024", ["MM-DD-YYYY"]) // explicit US format
23
- */
24
- export declare function parseDate(value: string, formats?: DateFormat[]): Date | null;
25
- /**
26
- * Format a Date to string
27
- *
28
- * @param date - Date to format
29
- * @param format - Format template (optional, defaults to ISO)
30
- * @param utc - Use UTC time (default: false)
31
- * @returns Formatted string or empty string if invalid
32
- *
33
- * @example
34
- * formatDate(date) // "2024-12-26T10:30:00.000+08:00"
35
- * formatDate(date, "YYYY-MM-DD", true) // "2024-12-26"
36
- */
37
- export declare function formatDate(date: Date, format?: string, utc?: boolean): string;
38
9
  /**
39
10
  * Optimized date parser for batch processing
40
11
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cj-tech-master/excelts",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.",
5
5
  "type": "module",
6
6
  "publishConfig": {