svell_jerry 3 năm trước cách đây
mục cha
commit
1f3f014ef3
9 tập tin đã thay đổi với 99 bổ sung20 xóa
  1. 5 2
      .eslintignore
  2. 9 10
      jest.config.js
  3. 61 2
      src/core/WorkBook.ts
  4. 2 2
      src/core/WorkSheet.ts
  5. 0 0
      src/cvs/CVS.ts
  6. 1 0
      src/index.ts
  7. 9 0
      src/internal.ts
  8. 2 2
      src/libs/ZipWriter.ts
  9. 10 2
      src/xlsx/XLSX.ts

+ 5 - 2
.eslintignore

@@ -1,7 +1,10 @@
 dist
-build
 esbuild
+build
 
-.eslintrc.js
 package.json
+typedoc.json
 tsconfig.json
+.eslintrc.js
+jest.config.js
+jest.transfer.js

+ 9 - 10
jest.config.js

@@ -1,11 +1,10 @@
 module.exports = {
-    testEnvironment: 'jsdom',
-    collectCoverage: true,
-    preset: 'ts-jest',
-    setupFiles: ["jest-canvas-mock"],
-    coverageReporters: ['json', 'html'],
-    transform: {
-      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/jest.transfer.js",
-    },
-  };
-  
+  testEnvironment: 'jsdom',
+  collectCoverage: true,
+  preset: 'ts-jest',
+  setupFiles: ["jest-canvas-mock"],
+  coverageReporters: ['json', 'html'],
+  transform: {
+    "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/jest.transfer.js",
+  },
+};

+ 61 - 2
src/core/WorkBook.ts

@@ -1,3 +1,62 @@
+import {
+  XLSX,
+} from "../internal";
+
 export class WorkBook {
-    
-}
+  protected _category: string;
+  protected _created: Date;
+  protected _company: string;
+  protected _xlsx: XLSX;
+  protected _subject: string;
+  protected _title: string;
+  protected _keywords: string;
+  protected _modified: Date;
+  protected _description: string;
+
+  public constructor() {
+    this._category = '';
+    this._created = new Date();
+    this._company = '';
+    this._subject = '';
+    this._title = '';
+    this._keywords = '';
+    this._modified = this._created;
+    this._xlsx = null;
+    this._description = '';
+  }
+
+  public getKeywords(): string {
+    return this._keywords;
+  }
+
+  public getXLSX(): XLSX {
+    if (!this._xlsx) {
+      this._xlsx = new XLSX(this);
+    }
+    return this._xlsx;
+  }
+
+  public getModified(): Date {
+    return this._modified;
+  }
+
+  public getCategory(): string {
+    return this._category;
+  }
+
+  public getTitle(): string {
+    return this._title;
+  }
+
+  public getSubject(): string {
+    return this._subject;
+  }
+
+  public getCreated(): Date {
+    return this._created;
+  }
+
+  public getCompany(): string {
+    return this._company;
+  }
+}

+ 2 - 2
src/core/WorkSheet.ts

@@ -1,3 +1,3 @@
 export class WorkSheet {
-    
-}
+
+}

+ 0 - 0
src/cvs/CVS.ts


+ 1 - 0
src/index.ts

@@ -0,0 +1 @@
+export * from './internal';

+ 9 - 0
src/internal.ts

@@ -0,0 +1,9 @@
+//= ===============================xlsx
+export * from './xlsx/XLSX';
+
+//= ===============================core
+export * from './core/WorkBook';
+export * from './core/WorkSheet';
+
+//= ===============================libs
+export * from './libs/ZipWriter';

+ 2 - 2
src/libs/ZipWriter.ts

@@ -1,3 +1,3 @@
 export class ZipWriter {
-    
-}
+
+}

+ 10 - 2
src/xlsx/XLSX.ts

@@ -1,3 +1,11 @@
+import {
+  WorkBook,
+} from "../internal";
+
 export class XLSX {
-    
-}
+  protected _workbook: WorkBook;
+
+  public constructor(workbook: WorkBook) {
+    this._workbook = workbook;
+  }
+}