esday 0.0.2 → 0.0.3

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.
@@ -0,0 +1,37 @@
1
+ declare class EsDay {
2
+ private $d;
3
+ private $y;
4
+ private $M;
5
+ private $D;
6
+ private $W;
7
+ private $H;
8
+ private $m;
9
+ private $s;
10
+ private $ms;
11
+ private $u;
12
+ constructor(cfg: {
13
+ d: Date;
14
+ utc: boolean;
15
+ });
16
+ init(): void;
17
+ utc(): EsDay;
18
+ valueOf(): number;
19
+ unix(): number;
20
+ clone(): EsDay;
21
+ format(formatStr: string): string;
22
+ startOf(units: UnitType): EsDay;
23
+ endOf(units: UnitType): EsDay;
24
+ set(units: UnitType, value: number): EsDay;
25
+ private $set;
26
+ }
27
+
28
+ type DateType = Date | string | number | EsDay;
29
+ type PrettyUnitType = 'date' | 'day' | 'week' | 'month' | 'year' | 'hour' | 'minute' | 'second' | 'millisecond';
30
+ type UnitType = 'y' | 'M' | 'D' | 'W' | 'H' | 'm' | 's' | 'ms' | PrettyUnitType;
31
+ interface EsDayFactory {
32
+ (d?: DateType): EsDay;
33
+ extend: (plugin: EsDayPlugin, option?: any) => EsDayFactory;
34
+ }
35
+ type EsDayPlugin = (option: any, dayTsClass: typeof EsDay, esday: EsDayFactory) => void;
36
+
37
+ export { type DateType as D, type EsDayFactory as E, type PrettyUnitType as P, type UnitType as U, EsDay as a, type EsDayPlugin as b };
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { E as EsDayFactory } from './index-BTR52rAY.js';
2
+ export { D as DateType, a as EsDay, b as EsDayPlugin, P as PrettyUnitType, U as UnitType } from './index-BTR52rAY.js';
3
+
4
+ declare const esday: EsDayFactory;
5
+
6
+ export { EsDayFactory, esday };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "esday",
3
3
  "type": "module",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "description": "A simple date library fully written in TypeScript",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
@@ -19,7 +19,9 @@
19
19
  "module": "index.js",
20
20
  "types": "index.d.ts",
21
21
  "typesVersions": {},
22
- "files": [],
22
+ "files": [
23
+ "*"
24
+ ],
23
25
  "dependencies": {
24
26
  "radash": "^12.1.0"
25
27
  },
@@ -0,0 +1,10 @@
1
+ import { b as EsDayPlugin } from '../../index-BTR52rAY.js';
2
+
3
+ declare module 'esday' {
4
+ interface EsDay {
5
+ isToday: () => boolean;
6
+ }
7
+ }
8
+ declare const isTodayPlugin: EsDayPlugin;
9
+
10
+ export { isTodayPlugin };
@@ -0,0 +1,8 @@
1
+ // src/plugins/isToday/index.ts
2
+ var isTodayPlugin = (_, dayClass) => {
3
+ dayClass.prototype.isToday = function() {
4
+ return true;
5
+ };
6
+ };
7
+
8
+ export { isTodayPlugin };