cyc-type-def 4.0.0 → 5.1.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/README.md +6 -2
- package/dist/index.cjs +26 -0
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +23 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,13 @@ Run these commands to use the package:
|
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm run build
|
|
7
|
+
npm config set //registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN
|
|
7
8
|
npm publish --access public
|
|
9
|
+
npm config delete //registry.npmjs.org/:_authToken
|
|
8
10
|
```
|
|
11
|
+
|
|
9
12
|
---
|
|
13
|
+
|
|
10
14
|
# TypeScript Package Setup Guide
|
|
11
15
|
|
|
12
16
|
This guide outlines how to set up a simple TypeScript package with build and test scripts.
|
|
@@ -48,8 +52,8 @@ my-ts-package/
|
|
|
48
52
|
### `src/index.ts`
|
|
49
53
|
|
|
50
54
|
```ts
|
|
51
|
-
export * from
|
|
52
|
-
export * from
|
|
55
|
+
export * from "./utils";
|
|
56
|
+
export * from "./types";
|
|
53
57
|
```
|
|
54
58
|
|
|
55
59
|
### `src/utils.ts`
|
package/dist/index.cjs
CHANGED
|
@@ -46,7 +46,10 @@ __export(index_exports, {
|
|
|
46
46
|
SmallTeam: () => SmallTeam,
|
|
47
47
|
Title: () => Title,
|
|
48
48
|
TitleAttendance: () => TitleAttendance,
|
|
49
|
+
cgNum: () => cgNum,
|
|
50
|
+
compareCG: () => compareCG,
|
|
49
51
|
formatDateDDMMYY: () => formatDateDDMMYY,
|
|
52
|
+
getDayMonthSortKey: () => getDayMonthSortKey,
|
|
50
53
|
isDateInRangeIgnoreYear: () => isDateInRangeIgnoreYear,
|
|
51
54
|
monthStr: () => monthStr,
|
|
52
55
|
parseYYMMDD: () => parseYYMMDD,
|
|
@@ -603,6 +606,16 @@ var MsjJoinStatusInfo = {
|
|
|
603
606
|
}
|
|
604
607
|
};
|
|
605
608
|
|
|
609
|
+
// src/util/common.util.ts
|
|
610
|
+
function cgNum(cgName) {
|
|
611
|
+
var num = cgName.match(/\d+/g);
|
|
612
|
+
if (num) {
|
|
613
|
+
return parseInt(num[0]);
|
|
614
|
+
} else {
|
|
615
|
+
return 0;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
606
619
|
// src/util/date.util.ts
|
|
607
620
|
function formatDateDDMMYY(date) {
|
|
608
621
|
const day = String(date.getDate()).padStart(2, "0");
|
|
@@ -637,6 +650,16 @@ function yearStr(timestamp) {
|
|
|
637
650
|
function monthStr(timestamp) {
|
|
638
651
|
return new Date(timestamp).toLocaleString("default", { month: "long" });
|
|
639
652
|
}
|
|
653
|
+
function getDayMonthSortKey(timestamp) {
|
|
654
|
+
const d = new Date(timestamp);
|
|
655
|
+
return d.getMonth() * 31 + d.getDate();
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// src/util/sort.util.ts
|
|
659
|
+
function compareCG(a, b) {
|
|
660
|
+
let v = cgNum(a.name) - cgNum(b.name);
|
|
661
|
+
return v;
|
|
662
|
+
}
|
|
640
663
|
// Annotate the CommonJS export names for ESM import in node:
|
|
641
664
|
0 && (module.exports = {
|
|
642
665
|
AppUser,
|
|
@@ -665,7 +688,10 @@ function monthStr(timestamp) {
|
|
|
665
688
|
SmallTeam,
|
|
666
689
|
Title,
|
|
667
690
|
TitleAttendance,
|
|
691
|
+
cgNum,
|
|
692
|
+
compareCG,
|
|
668
693
|
formatDateDDMMYY,
|
|
694
|
+
getDayMonthSortKey,
|
|
669
695
|
isDateInRangeIgnoreYear,
|
|
670
696
|
monthStr,
|
|
671
697
|
parseYYMMDD,
|
package/dist/index.d.cts
CHANGED
|
@@ -190,6 +190,10 @@ interface Attendance extends Title {
|
|
|
190
190
|
idSt: string;
|
|
191
191
|
idCluster: string;
|
|
192
192
|
timestamp: number;
|
|
193
|
+
/**
|
|
194
|
+
* time taken to fill in attendance (in seconds)
|
|
195
|
+
*/
|
|
196
|
+
timeTaken?: number;
|
|
193
197
|
arrSessionAttendance: SessionAttendance[];
|
|
194
198
|
}
|
|
195
199
|
/**
|
|
@@ -529,6 +533,8 @@ declare const MsjJoinStatusInfo: Record<MsjJoinStatus, {
|
|
|
529
533
|
short: string;
|
|
530
534
|
}>;
|
|
531
535
|
|
|
536
|
+
declare function cgNum(cgName: string): number;
|
|
537
|
+
|
|
532
538
|
declare function formatDateDDMMYY(date: Date): string;
|
|
533
539
|
declare function parseYYMMDD(str: string): Date;
|
|
534
540
|
/**
|
|
@@ -539,5 +545,8 @@ declare function parseYYMMDD(str: string): Date;
|
|
|
539
545
|
declare function isDateInRangeIgnoreYear(d: Date, start: Date, end: Date): boolean;
|
|
540
546
|
declare function yearStr(timestamp: number): string;
|
|
541
547
|
declare function monthStr(timestamp: number): string;
|
|
548
|
+
declare function getDayMonthSortKey(timestamp: number): number;
|
|
549
|
+
|
|
550
|
+
declare function compareCG(a: CG, b: CG): number;
|
|
542
551
|
|
|
543
|
-
export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, type Device, 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, formatDateDDMMYY, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
|
|
552
|
+
export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, type Device, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -190,6 +190,10 @@ interface Attendance extends Title {
|
|
|
190
190
|
idSt: string;
|
|
191
191
|
idCluster: string;
|
|
192
192
|
timestamp: number;
|
|
193
|
+
/**
|
|
194
|
+
* time taken to fill in attendance (in seconds)
|
|
195
|
+
*/
|
|
196
|
+
timeTaken?: number;
|
|
193
197
|
arrSessionAttendance: SessionAttendance[];
|
|
194
198
|
}
|
|
195
199
|
/**
|
|
@@ -529,6 +533,8 @@ declare const MsjJoinStatusInfo: Record<MsjJoinStatus, {
|
|
|
529
533
|
short: string;
|
|
530
534
|
}>;
|
|
531
535
|
|
|
536
|
+
declare function cgNum(cgName: string): number;
|
|
537
|
+
|
|
532
538
|
declare function formatDateDDMMYY(date: Date): string;
|
|
533
539
|
declare function parseYYMMDD(str: string): Date;
|
|
534
540
|
/**
|
|
@@ -539,5 +545,8 @@ declare function parseYYMMDD(str: string): Date;
|
|
|
539
545
|
declare function isDateInRangeIgnoreYear(d: Date, start: Date, end: Date): boolean;
|
|
540
546
|
declare function yearStr(timestamp: number): string;
|
|
541
547
|
declare function monthStr(timestamp: number): string;
|
|
548
|
+
declare function getDayMonthSortKey(timestamp: number): number;
|
|
549
|
+
|
|
550
|
+
declare function compareCG(a: CG, b: CG): number;
|
|
542
551
|
|
|
543
|
-
export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, type Device, 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, formatDateDDMMYY, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
|
|
552
|
+
export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, type Device, 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 };
|
package/dist/index.js
CHANGED
|
@@ -547,6 +547,16 @@ var MsjJoinStatusInfo = {
|
|
|
547
547
|
}
|
|
548
548
|
};
|
|
549
549
|
|
|
550
|
+
// src/util/common.util.ts
|
|
551
|
+
function cgNum(cgName) {
|
|
552
|
+
var num = cgName.match(/\d+/g);
|
|
553
|
+
if (num) {
|
|
554
|
+
return parseInt(num[0]);
|
|
555
|
+
} else {
|
|
556
|
+
return 0;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
550
560
|
// src/util/date.util.ts
|
|
551
561
|
function formatDateDDMMYY(date) {
|
|
552
562
|
const day = String(date.getDate()).padStart(2, "0");
|
|
@@ -581,6 +591,16 @@ function yearStr(timestamp) {
|
|
|
581
591
|
function monthStr(timestamp) {
|
|
582
592
|
return new Date(timestamp).toLocaleString("default", { month: "long" });
|
|
583
593
|
}
|
|
594
|
+
function getDayMonthSortKey(timestamp) {
|
|
595
|
+
const d = new Date(timestamp);
|
|
596
|
+
return d.getMonth() * 31 + d.getDate();
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
// src/util/sort.util.ts
|
|
600
|
+
function compareCG(a, b) {
|
|
601
|
+
let v = cgNum(a.name) - cgNum(b.name);
|
|
602
|
+
return v;
|
|
603
|
+
}
|
|
584
604
|
export {
|
|
585
605
|
AppUser,
|
|
586
606
|
AssignedCG,
|
|
@@ -608,7 +628,10 @@ export {
|
|
|
608
628
|
SmallTeam,
|
|
609
629
|
Title,
|
|
610
630
|
TitleAttendance,
|
|
631
|
+
cgNum,
|
|
632
|
+
compareCG,
|
|
611
633
|
formatDateDDMMYY,
|
|
634
|
+
getDayMonthSortKey,
|
|
612
635
|
isDateInRangeIgnoreYear,
|
|
613
636
|
monthStr,
|
|
614
637
|
parseYYMMDD,
|