cyc-type-def 6.4.0 → 6.5.0

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/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  MsjJoinStatus: () => MsjJoinStatus,
43
43
  MsjJoinStatusInfo: () => MsjJoinStatusInfo,
44
44
  PERMISSION: () => PERMISSION,
45
+ Period: () => Period,
45
46
  ReportSheep: () => ReportSheep,
46
47
  Session: () => Session,
47
48
  SessionAttendance: () => SessionAttendance,
@@ -557,6 +558,32 @@ var AppUser = class {
557
558
  }
558
559
  };
559
560
 
561
+ // src/classes/Period.ts
562
+ var Period = class {
563
+ constructor(period) {
564
+ Object.assign(this, period);
565
+ }
566
+ /**
567
+ * Calculates and sets the millisecond timestamps for the start and end of the period.
568
+ * * Uses the instance's `year` and `month` (1-based) to compute:
569
+ * - `startTimestamp`: The absolute first millisecond of the month (00:00:00.000).
570
+ * - `endTimestamp`: The absolute last millisecond of the month (23:59:59.999).
571
+ * * @throws This method will produce invalid timestamps (`NaN`) if `year` or `month` are undefined.
572
+ */
573
+ setBounds() {
574
+ const start = new Date(this.year, this.month - 1, 1, 0, 0, 0, 0);
575
+ const end = new Date(this.year, this.month, 0, 23, 59, 59, 999);
576
+ this.startTimestamp = start.getTime();
577
+ this.endTimestamp = end.getTime();
578
+ }
579
+ get dtStart() {
580
+ return new Date(this.startTimestamp);
581
+ }
582
+ get dtEnd() {
583
+ return new Date(this.endTimestamp);
584
+ }
585
+ };
586
+
560
587
  // src/constants/click.constant.ts
561
588
  var ClickAction = /* @__PURE__ */ ((ClickAction2) => {
562
589
  ClickAction2[ClickAction2["P_WeeklyAttendance"] = 0] = "P_WeeklyAttendance";
@@ -725,6 +752,7 @@ function compareCG(a, b) {
725
752
  MsjJoinStatus,
726
753
  MsjJoinStatusInfo,
727
754
  PERMISSION,
755
+ Period,
728
756
  ReportSheep,
729
757
  Session,
730
758
  SessionAttendance,
package/dist/index.d.cts CHANGED
@@ -540,6 +540,31 @@ interface BaseDialogInput {
540
540
  action: DialogAction;
541
541
  }
542
542
 
543
+ declare class Period implements Base {
544
+ id: string;
545
+ deleted: boolean;
546
+ createdAt?: number | undefined;
547
+ createdBy?: string | undefined;
548
+ updatedAt?: number | undefined;
549
+ updatedBy?: string | undefined;
550
+ remark?: string | undefined;
551
+ year: number;
552
+ month: number;
553
+ startTimestamp: number;
554
+ endTimestamp: number;
555
+ constructor(period: Partial<Period>);
556
+ /**
557
+ * Calculates and sets the millisecond timestamps for the start and end of the period.
558
+ * * Uses the instance's `year` and `month` (1-based) to compute:
559
+ * - `startTimestamp`: The absolute first millisecond of the month (00:00:00.000).
560
+ * - `endTimestamp`: The absolute last millisecond of the month (23:59:59.999).
561
+ * * @throws This method will produce invalid timestamps (`NaN`) if `year` or `month` are undefined.
562
+ */
563
+ setBounds(): void;
564
+ get dtStart(): Date;
565
+ get dtEnd(): Date;
566
+ }
567
+
543
568
  declare const METHOD: {
544
569
  SKY: string;
545
570
  GROUND: string;
@@ -589,4 +614,4 @@ declare function getDayMonthSortKey(timestamp: number): number;
589
614
 
590
615
  declare function compareCG(a: CG, b: CG): number;
591
616
 
592
- export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, type BaseDialogInput, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, DateEvent, DatePrecision, type Device, DialogAction, DisplayAttendance, FollowUpStatus, LIST_STATUS, METHOD, type MsjClassBatch, type MsjClassTime, type MsjClassType, MsjJoinStatus, MsjJoinStatusInfo, type MsjStudBatch, type MsjStudClass, PERMISSION, type PastoralTeam, ReportSheep, Session, SessionAttendance, Sheep, SmallTeam, Title, TitleAttendance, cgNum, compareCG, formatDateDDMMYY, getDayMonthSortKey, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
617
+ export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, type BaseDialogInput, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, DateEvent, DatePrecision, type Device, DialogAction, DisplayAttendance, FollowUpStatus, LIST_STATUS, METHOD, type MsjClassBatch, type MsjClassTime, type MsjClassType, MsjJoinStatus, MsjJoinStatusInfo, type MsjStudBatch, type MsjStudClass, PERMISSION, type PastoralTeam, Period, ReportSheep, Session, SessionAttendance, Sheep, SmallTeam, Title, TitleAttendance, cgNum, compareCG, formatDateDDMMYY, getDayMonthSortKey, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
package/dist/index.d.ts CHANGED
@@ -540,6 +540,31 @@ interface BaseDialogInput {
540
540
  action: DialogAction;
541
541
  }
542
542
 
543
+ declare class Period implements Base {
544
+ id: string;
545
+ deleted: boolean;
546
+ createdAt?: number | undefined;
547
+ createdBy?: string | undefined;
548
+ updatedAt?: number | undefined;
549
+ updatedBy?: string | undefined;
550
+ remark?: string | undefined;
551
+ year: number;
552
+ month: number;
553
+ startTimestamp: number;
554
+ endTimestamp: number;
555
+ constructor(period: Partial<Period>);
556
+ /**
557
+ * Calculates and sets the millisecond timestamps for the start and end of the period.
558
+ * * Uses the instance's `year` and `month` (1-based) to compute:
559
+ * - `startTimestamp`: The absolute first millisecond of the month (00:00:00.000).
560
+ * - `endTimestamp`: The absolute last millisecond of the month (23:59:59.999).
561
+ * * @throws This method will produce invalid timestamps (`NaN`) if `year` or `month` are undefined.
562
+ */
563
+ setBounds(): void;
564
+ get dtStart(): Date;
565
+ get dtEnd(): Date;
566
+ }
567
+
543
568
  declare const METHOD: {
544
569
  SKY: string;
545
570
  GROUND: string;
@@ -589,4 +614,4 @@ declare function getDayMonthSortKey(timestamp: number): number;
589
614
 
590
615
  declare function compareCG(a: CG, b: CG): number;
591
616
 
592
- export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, type BaseDialogInput, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, DateEvent, DatePrecision, type Device, DialogAction, DisplayAttendance, FollowUpStatus, LIST_STATUS, METHOD, type MsjClassBatch, type MsjClassTime, type MsjClassType, MsjJoinStatus, MsjJoinStatusInfo, type MsjStudBatch, type MsjStudClass, PERMISSION, type PastoralTeam, ReportSheep, Session, SessionAttendance, Sheep, SmallTeam, Title, TitleAttendance, cgNum, compareCG, formatDateDDMMYY, getDayMonthSortKey, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
617
+ export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, type BaseDialogInput, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, DateEvent, DatePrecision, type Device, DialogAction, DisplayAttendance, FollowUpStatus, LIST_STATUS, METHOD, type MsjClassBatch, type MsjClassTime, type MsjClassType, MsjJoinStatus, MsjJoinStatusInfo, type MsjStudBatch, type MsjStudClass, PERMISSION, type PastoralTeam, Period, ReportSheep, Session, SessionAttendance, Sheep, SmallTeam, Title, TitleAttendance, cgNum, compareCG, formatDateDDMMYY, getDayMonthSortKey, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
package/dist/index.js CHANGED
@@ -495,6 +495,32 @@ var AppUser = class {
495
495
  }
496
496
  };
497
497
 
498
+ // src/classes/Period.ts
499
+ var Period = class {
500
+ constructor(period) {
501
+ Object.assign(this, period);
502
+ }
503
+ /**
504
+ * Calculates and sets the millisecond timestamps for the start and end of the period.
505
+ * * Uses the instance's `year` and `month` (1-based) to compute:
506
+ * - `startTimestamp`: The absolute first millisecond of the month (00:00:00.000).
507
+ * - `endTimestamp`: The absolute last millisecond of the month (23:59:59.999).
508
+ * * @throws This method will produce invalid timestamps (`NaN`) if `year` or `month` are undefined.
509
+ */
510
+ setBounds() {
511
+ const start = new Date(this.year, this.month - 1, 1, 0, 0, 0, 0);
512
+ const end = new Date(this.year, this.month, 0, 23, 59, 59, 999);
513
+ this.startTimestamp = start.getTime();
514
+ this.endTimestamp = end.getTime();
515
+ }
516
+ get dtStart() {
517
+ return new Date(this.startTimestamp);
518
+ }
519
+ get dtEnd() {
520
+ return new Date(this.endTimestamp);
521
+ }
522
+ };
523
+
498
524
  // src/constants/click.constant.ts
499
525
  var ClickAction = /* @__PURE__ */ ((ClickAction2) => {
500
526
  ClickAction2[ClickAction2["P_WeeklyAttendance"] = 0] = "P_WeeklyAttendance";
@@ -662,6 +688,7 @@ export {
662
688
  MsjJoinStatus,
663
689
  MsjJoinStatusInfo,
664
690
  PERMISSION,
691
+ Period,
665
692
  ReportSheep,
666
693
  Session,
667
694
  SessionAttendance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyc-type-def",
3
- "version": "6.4.0",
3
+ "version": "6.5.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",