@venizia/ignis-helpers 0.2.1 → 0.2.2-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.
Files changed (77) hide show
  1. package/dist/cjs/modules/error/index.d.ts +1 -1
  2. package/dist/cjs/modules/error/index.d.ts.map +1 -1
  3. package/dist/cjs/modules/error/index.js +2 -1
  4. package/dist/cjs/modules/error/index.js.map +1 -1
  5. package/dist/cjs/modules/temporal/adapters/index.d.ts +1 -0
  6. package/dist/cjs/modules/temporal/adapters/index.d.ts.map +1 -1
  7. package/dist/cjs/modules/temporal/adapters/index.js +1 -0
  8. package/dist/cjs/modules/temporal/adapters/index.js.map +1 -1
  9. package/dist/cjs/modules/temporal/adapters/intl.d.ts +16 -0
  10. package/dist/cjs/modules/temporal/adapters/intl.d.ts.map +1 -0
  11. package/dist/cjs/modules/temporal/adapters/intl.js +83 -0
  12. package/dist/cjs/modules/temporal/adapters/intl.js.map +1 -0
  13. package/dist/cjs/modules/temporal/common/constants.d.ts +12 -0
  14. package/dist/cjs/modules/temporal/common/constants.d.ts.map +1 -1
  15. package/dist/cjs/modules/temporal/common/constants.js +15 -1
  16. package/dist/cjs/modules/temporal/common/constants.js.map +1 -1
  17. package/dist/cjs/modules/temporal/common/types.d.ts +9 -0
  18. package/dist/cjs/modules/temporal/common/types.d.ts.map +1 -1
  19. package/dist/cjs/modules/temporal/duration.d.ts +19 -0
  20. package/dist/cjs/modules/temporal/duration.d.ts.map +1 -0
  21. package/dist/cjs/modules/temporal/duration.js +64 -0
  22. package/dist/cjs/modules/temporal/duration.js.map +1 -0
  23. package/dist/cjs/modules/temporal/helper.d.ts +90 -4
  24. package/dist/cjs/modules/temporal/helper.d.ts.map +1 -1
  25. package/dist/cjs/modules/temporal/helper.js +213 -3
  26. package/dist/cjs/modules/temporal/helper.js.map +1 -1
  27. package/dist/cjs/modules/temporal/locale.d.ts +40 -0
  28. package/dist/cjs/modules/temporal/locale.d.ts.map +1 -0
  29. package/dist/cjs/modules/temporal/locale.js +124 -0
  30. package/dist/cjs/modules/temporal/locale.js.map +1 -0
  31. package/dist/cjs/modules/temporal/pattern.d.ts +2 -0
  32. package/dist/cjs/modules/temporal/pattern.d.ts.map +1 -1
  33. package/dist/cjs/modules/temporal/pattern.js +15 -2
  34. package/dist/cjs/modules/temporal/pattern.js.map +1 -1
  35. package/dist/cjs/modules/temporal/tokens.d.ts +19 -6
  36. package/dist/cjs/modules/temporal/tokens.d.ts.map +1 -1
  37. package/dist/cjs/modules/temporal/tokens.js +49 -17
  38. package/dist/cjs/modules/temporal/tokens.js.map +1 -1
  39. package/dist/esm/modules/error/index.d.ts +1 -1
  40. package/dist/esm/modules/error/index.d.ts.map +1 -1
  41. package/dist/esm/modules/error/index.js +1 -1
  42. package/dist/esm/modules/error/index.js.map +1 -1
  43. package/dist/esm/modules/temporal/adapters/index.d.ts +1 -0
  44. package/dist/esm/modules/temporal/adapters/index.d.ts.map +1 -1
  45. package/dist/esm/modules/temporal/adapters/index.js +1 -0
  46. package/dist/esm/modules/temporal/adapters/index.js.map +1 -1
  47. package/dist/esm/modules/temporal/adapters/intl.d.ts +16 -0
  48. package/dist/esm/modules/temporal/adapters/intl.d.ts.map +1 -0
  49. package/dist/esm/modules/temporal/adapters/intl.js +79 -0
  50. package/dist/esm/modules/temporal/adapters/intl.js.map +1 -0
  51. package/dist/esm/modules/temporal/common/constants.d.ts +12 -0
  52. package/dist/esm/modules/temporal/common/constants.d.ts.map +1 -1
  53. package/dist/esm/modules/temporal/common/constants.js +13 -0
  54. package/dist/esm/modules/temporal/common/constants.js.map +1 -1
  55. package/dist/esm/modules/temporal/common/types.d.ts +9 -0
  56. package/dist/esm/modules/temporal/common/types.d.ts.map +1 -1
  57. package/dist/esm/modules/temporal/duration.d.ts +19 -0
  58. package/dist/esm/modules/temporal/duration.d.ts.map +1 -0
  59. package/dist/esm/modules/temporal/duration.js +60 -0
  60. package/dist/esm/modules/temporal/duration.js.map +1 -0
  61. package/dist/esm/modules/temporal/helper.d.ts +90 -4
  62. package/dist/esm/modules/temporal/helper.d.ts.map +1 -1
  63. package/dist/esm/modules/temporal/helper.js +215 -5
  64. package/dist/esm/modules/temporal/helper.js.map +1 -1
  65. package/dist/esm/modules/temporal/locale.d.ts +40 -0
  66. package/dist/esm/modules/temporal/locale.d.ts.map +1 -0
  67. package/dist/esm/modules/temporal/locale.js +120 -0
  68. package/dist/esm/modules/temporal/locale.js.map +1 -0
  69. package/dist/esm/modules/temporal/pattern.d.ts +2 -0
  70. package/dist/esm/modules/temporal/pattern.d.ts.map +1 -1
  71. package/dist/esm/modules/temporal/pattern.js +16 -3
  72. package/dist/esm/modules/temporal/pattern.js.map +1 -1
  73. package/dist/esm/modules/temporal/tokens.d.ts +19 -6
  74. package/dist/esm/modules/temporal/tokens.d.ts.map +1 -1
  75. package/dist/esm/modules/temporal/tokens.js +47 -16
  76. package/dist/esm/modules/temporal/tokens.js.map +1 -1
  77. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  /** Error layer lives in `@venizia/ignis-inversion` so browser apps (DI-only, no helpers) share the same class; re-exported by NAME, not `export *`, to keep inversion's DI container off the helpers surface. */
2
2
  /** Augment `IErrorKeyRegistry` via whichever module the file imports - see `registry-augmentation.test.ts`. */
3
- export { ApplicationError, ErrorScopes, fromError, getError, isApplicationError, MessageCode, } from '@venizia/ignis-inversion';
3
+ export { ApplicationError, ErrorScopes, fromError, getError, isApplicationError, MessageCode, MessageTemplate, } from '@venizia/ignis-inversion';
4
4
  export type { IErrorKeyRegistry, TError, TErrorByDefinition, TErrorByField, TErrorDefinition, TErrorDefinitionMessage, TErrorKey, TErrorLogLevel, TErrorMessage, TErrorMessageInput, TErrorMessageOverride, TErrorNormalized, TErrorNormalizeTransformFn, TErrorScope, TRegisterErrors, TResponsedError, } from '@venizia/ignis-inversion';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,iNAAiN;AACjN,+GAA+G;AAC/G,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,WAAW,GACZ,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,iNAAiN;AACjN,+GAA+G;AAC/G,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,WAAW,EACX,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,0BAA0B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessageCode = exports.isApplicationError = exports.getError = exports.fromError = exports.ErrorScopes = exports.ApplicationError = void 0;
3
+ exports.MessageTemplate = exports.MessageCode = exports.isApplicationError = exports.getError = exports.fromError = exports.ErrorScopes = exports.ApplicationError = void 0;
4
4
  /** Error layer lives in `@venizia/ignis-inversion` so browser apps (DI-only, no helpers) share the same class; re-exported by NAME, not `export *`, to keep inversion's DI container off the helpers surface. */
5
5
  /** Augment `IErrorKeyRegistry` via whichever module the file imports - see `registry-augmentation.test.ts`. */
6
6
  var ignis_inversion_1 = require("@venizia/ignis-inversion");
@@ -10,4 +10,5 @@ Object.defineProperty(exports, "fromError", { enumerable: true, get: function ()
10
10
  Object.defineProperty(exports, "getError", { enumerable: true, get: function () { return ignis_inversion_1.getError; } });
11
11
  Object.defineProperty(exports, "isApplicationError", { enumerable: true, get: function () { return ignis_inversion_1.isApplicationError; } });
12
12
  Object.defineProperty(exports, "MessageCode", { enumerable: true, get: function () { return ignis_inversion_1.MessageCode; } });
13
+ Object.defineProperty(exports, "MessageTemplate", { enumerable: true, get: function () { return ignis_inversion_1.MessageTemplate; } });
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":";;;AAAA,iNAAiN;AACjN,+GAA+G;AAC/G,4DAOkC;AANhC,mHAAA,gBAAgB,OAAA;AAChB,8GAAA,WAAW,OAAA;AACX,4GAAA,SAAS,OAAA;AACT,2GAAA,QAAQ,OAAA;AACR,qHAAA,kBAAkB,OAAA;AAClB,8GAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/error/index.ts"],"names":[],"mappings":";;;AAAA,iNAAiN;AACjN,+GAA+G;AAC/G,4DAQkC;AAPhC,mHAAA,gBAAgB,OAAA;AAChB,8GAAA,WAAW,OAAA;AACX,4GAAA,SAAS,OAAA;AACT,2GAAA,QAAQ,OAAA;AACR,qHAAA,kBAAkB,OAAA;AAClB,8GAAA,WAAW,OAAA;AACX,kHAAA,eAAe,OAAA"}
@@ -1,4 +1,5 @@
1
1
  export * from './dayjs';
2
2
  export * from './luxon';
3
3
  export * from './native';
4
+ export * from './intl';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/temporal/adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/temporal/adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./dayjs"), exports);
18
18
  __exportStar(require("./luxon"), exports);
19
19
  __exportStar(require("./native"), exports);
20
+ __exportStar(require("./intl"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/temporal/adapters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/temporal/adapters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,yCAAuB"}
@@ -0,0 +1,16 @@
1
+ import type { ITemporalAdapter } from '../common/types';
2
+ /**
3
+ * Time zones through `Intl.DateTimeFormat` alone - no `Temporal`, no polyfill, no date library - so
4
+ * it runs in every browser and every server runtime. The offset is the zone's wall clock at the
5
+ * instant, read field by field, minus the instant itself.
6
+ */
7
+ export declare class IntlTemporalAdapter implements ITemporalAdapter {
8
+ private static readonly formatters;
9
+ /** The zone's formatter, and how it spells the common era - so any other era is before year 1, whatever the engine calls it. */
10
+ private static formatterOf;
11
+ getOffsetMilliseconds(opts: {
12
+ value: Date;
13
+ timeZone: string;
14
+ }): number;
15
+ }
16
+ //# sourceMappingURL=intl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intl.d.ts","sourceRoot":"","sources":["../../../../../src/modules/temporal/adapters/intl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOxD;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,gBAAgB;IAC1D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAG9B;IAEJ,gIAAgI;IAChI,OAAO,CAAC,MAAM,CAAC,WAAW;IA4C1B,qBAAqB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;CA+BvE"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IntlTemporalAdapter = void 0;
4
+ const http_1 = require("../../../common/constants/http");
5
+ const error_1 = require("../../error");
6
+ /** One formatter per zone: building an `Intl.DateTimeFormat` costs far more than using one. */
7
+ const MAX_CACHED_FORMATTERS = 256;
8
+ const SECOND_MILLISECONDS = 1000;
9
+ /**
10
+ * Time zones through `Intl.DateTimeFormat` alone - no `Temporal`, no polyfill, no date library - so
11
+ * it runs in every browser and every server runtime. The offset is the zone's wall clock at the
12
+ * instant, read field by field, minus the instant itself.
13
+ */
14
+ class IntlTemporalAdapter {
15
+ static { this.formatters = new Map(); }
16
+ /** The zone's formatter, and how it spells the common era - so any other era is before year 1, whatever the engine calls it. */
17
+ static formatterOf(opts) {
18
+ const { timeZone } = opts;
19
+ const cached = IntlTemporalAdapter.formatters.get(timeZone);
20
+ if (cached) {
21
+ return cached;
22
+ }
23
+ let formatter;
24
+ try {
25
+ formatter = new Intl.DateTimeFormat('en-US', {
26
+ timeZone,
27
+ hourCycle: 'h23',
28
+ era: 'short',
29
+ year: 'numeric',
30
+ month: 'numeric',
31
+ day: 'numeric',
32
+ hour: 'numeric',
33
+ minute: 'numeric',
34
+ second: 'numeric',
35
+ });
36
+ }
37
+ catch (error) {
38
+ throw (0, error_1.getError)({
39
+ statusCode: http_1.HTTP.ResultCodes.RS_4.BadRequest,
40
+ message: `[IntlTemporalAdapter] unknown time zone '${timeZone}' | ${error instanceof Error ? error.message : String(error)}`,
41
+ });
42
+ }
43
+ const commonEra = formatter.formatToParts(new Date(0)).find(part => part.type === 'era')?.value;
44
+ // Full: the oldest zone makes room, so zone 257 is not rebuilt on every call.
45
+ if (IntlTemporalAdapter.formatters.size >= MAX_CACHED_FORMATTERS) {
46
+ const oldest = IntlTemporalAdapter.formatters.keys().next().value;
47
+ if (oldest !== undefined) {
48
+ IntlTemporalAdapter.formatters.delete(oldest);
49
+ }
50
+ }
51
+ const entry = { formatter, commonEra };
52
+ IntlTemporalAdapter.formatters.set(timeZone, entry);
53
+ return entry;
54
+ }
55
+ getOffsetMilliseconds(opts) {
56
+ const { value, timeZone } = opts;
57
+ const epoch = value.getTime();
58
+ const fields = { year: 0, month: 1, day: 1, hour: 0, minute: 0, second: 0 };
59
+ let isBeforeCommonEra = false;
60
+ const { formatter, commonEra } = IntlTemporalAdapter.formatterOf({ timeZone });
61
+ for (const part of formatter.formatToParts(value)) {
62
+ if (part.type === 'era') {
63
+ isBeforeCommonEra = commonEra !== undefined && part.value !== commonEra;
64
+ continue;
65
+ }
66
+ if (part.type in fields) {
67
+ Reflect.set(fields, part.type, Number(part.value));
68
+ }
69
+ }
70
+ // Before year 1 the formatter counts eras: 1 BC is year 0 on the proleptic calendar.
71
+ const year = isBeforeCommonEra ? 1 - fields.year : fields.year;
72
+ // Some engines still write midnight as hour 24 under h23.
73
+ const hour = fields.hour === 24 ? 0 : fields.hour;
74
+ const wallClock = new Date(0);
75
+ wallClock.setUTCFullYear(year, fields.month - 1, fields.day);
76
+ wallClock.setUTCHours(hour, fields.minute, fields.second, 0);
77
+ // The formatter writes whole seconds: compare against the instant truncated the same way.
78
+ const wholeSecond = epoch - (((epoch % SECOND_MILLISECONDS) + SECOND_MILLISECONDS) % SECOND_MILLISECONDS);
79
+ return wallClock.getTime() - wholeSecond;
80
+ }
81
+ }
82
+ exports.IntlTemporalAdapter = IntlTemporalAdapter;
83
+ //# sourceMappingURL=intl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intl.js","sourceRoot":"","sources":["../../../../../src/modules/temporal/adapters/intl.ts"],"names":[],"mappings":";;;AAAA,kDAA+C;AAC/C,2CAA2C;AAG3C,+FAA+F;AAC/F,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC;;;;GAIG;AACH,MAAa,mBAAmB;aACN,eAAU,GAAG,IAAI,GAAG,EAGzC,CAAC;IAEJ,gIAAgI;IACxH,MAAM,CAAC,WAAW,CAAC,IAA0B;QAInD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,MAAM,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5D,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,SAA8B,CAAC;QACnC,IAAI,CAAC;YACH,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;gBAC3C,QAAQ;gBACR,SAAS,EAAE,KAAK;gBAChB,GAAG,EAAE,OAAO;gBACZ,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;gBAChB,GAAG,EAAE,SAAS;gBACd,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAA,gBAAQ,EAAC;gBACb,UAAU,EAAE,WAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU;gBAC5C,OAAO,EAAE,4CAA4C,QAAQ,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAA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MPORAL_TIME_ZONE = "UTC";
18
18
  /** `format` with no pattern writes ISO 8601 with the zone's offset: `2026-09-19T12:00:00.000+07:00`. */
19
19
  export declare const DEFAULT_TEMPORAL_PATTERN = "YYYY-MM-DDTHH:mm:ss.SSSZ";
20
+ /** The locale name tokens and `formatIntl` write in when a helper is built without one. */
21
+ export declare const DEFAULT_TEMPORAL_LOCALE = "en-US";
22
+ /** How `formatDuration` writes: `compact` is `1d1h30m`; the others are the locale's own unit words. */
23
+ export declare class TemporalDurationStyles {
24
+ static readonly COMPACT = "compact";
25
+ static readonly NARROW = "narrow";
26
+ static readonly SHORT = "short";
27
+ static readonly LONG = "long";
28
+ static readonly SCHEME_SET: Set<string>;
29
+ static isValid(input: string): input is TTemporalDurationStyle;
30
+ }
31
+ export type TTemporalDurationStyle = TConstValue<typeof TemporalDurationStyles>;
20
32
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/modules/temporal/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,yGAAyG;AACzG,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAiB;IAC5C,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAE9B,MAAM,CAAC,QAAQ,CAAC,UAAU,cASvB;IAEH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa;CAGtD;AAED,MAAM,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AAC,QAAQ,CAAC,IAAI,UAAU;IAE9B,MAAM,CAAC,QAAQ,CAAC,UAAU,cAA+D;IAEzF,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,sBAAsB;CAG/D;AAED,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_TEMPORAL_PATTERN = exports.DEFAULT_TEMPORAL_TIME_ZONE = exports.TemporalUnits = void 0;
3
+ exports.TemporalDurationStyles = exports.DEFAULT_TEMPORAL_LOCALE = exports.DEFAULT_TEMPORAL_PATTERN = exports.DEFAULT_TEMPORAL_TIME_ZONE = exports.TemporalUnits = void 0;
4
4
  /** Units `add`, `subtract`, `startOf` and `endOf` accept. Weeks are ISO weeks - they start on Monday. */
5
5
  class TemporalUnits {
6
6
  static { this.MILLISECOND = 'millisecond'; }
@@ -30,4 +30,18 @@ exports.TemporalUnits = TemporalUnits;
30
30
  exports.DEFAULT_TEMPORAL_TIME_ZONE = 'UTC';
31
31
  /** `format` with no pattern writes ISO 8601 with the zone's offset: `2026-09-19T12:00:00.000+07:00`. */
32
32
  exports.DEFAULT_TEMPORAL_PATTERN = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
33
+ /** The locale name tokens and `formatIntl` write in when a helper is built without one. */
34
+ exports.DEFAULT_TEMPORAL_LOCALE = 'en-US';
35
+ /** How `formatDuration` writes: `compact` is `1d1h30m`; the others are the locale's own unit words. */
36
+ class TemporalDurationStyles {
37
+ static { this.COMPACT = 'compact'; }
38
+ static { this.NARROW = 'narrow'; }
39
+ static { this.SHORT = 'short'; }
40
+ static { this.LONG = 'long'; }
41
+ static { this.SCHEME_SET = new Set([this.COMPACT, this.NARROW, this.SHORT, this.LONG]); }
42
+ static isValid(input) {
43
+ return this.SCHEME_SET.has(input);
44
+ }
45
+ }
46
+ exports.TemporalDurationStyles = TemporalDurationStyles;
33
47
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/modules/temporal/common/constants.ts"],"names":[],"mappings":";;;AAEA,yGAAyG;AACzG,MAAa,aAAa;aACR,gBAAW,GAAG,aAAa,CAAC;aAC5B,WAAM,GAAG,QAAQ,CAAC;aAClB,WAAM,GAAG,QAAQ,CAAC;aAClB,SAAI,GAAG,MAAM,CAAC;aACd,QAAG,GAAG,KAAK,CAAC;aACZ,SAAI,GAAG,MAAM,CAAC;aACd,UAAK,GAAG,OAAO,CAAC;aAChB,SAAI,GAAG,MAAM,CAAC;aAEd,eAAU,GAAG,IAAI,GAAG,CAAC;QACnC,IAAI,CAAC,WAAW;QAChB,IAAI,CAAC,MAAM;QACX,IAAI,CAAC,MAAM;QACX,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,GAAG;QACR,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,IAAI;KACV,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAvBH,sCAwBC;AAID,iHAAiH;AACpG,QAAA,0BAA0B,GAAG,KAAK,CAAC;AAEhD,wGAAwG;AAC3F,QAAA,wBAAwB,GAAG,0BAA0B,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/modules/temporal/common/constants.ts"],"names":[],"mappings":";;;AAEA,yGAAyG;AACzG,MAAa,aAAa;aACR,gBAAW,GAAG,aAAa,CAAC;aAC5B,WAAM,GAAG,QAAQ,CAAC;aAClB,WAAM,GAAG,QAAQ,CAAC;aAClB,SAAI,GAAG,MAAM,CAAC;aACd,QAAG,GAAG,KAAK,CAAC;aACZ,SAAI,GAAG,MAAM,CAAC;aACd,UAAK,GAAG,OAAO,CAAC;aAChB,SAAI,GAAG,MAAM,CAAC;aAEd,eAAU,GAAG,IAAI,GAAG,CAAC;QACnC,IAAI,CAAC,WAAW;QAChB,IAAI,CAAC,MAAM;QACX,IAAI,CAAC,MAAM;QACX,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,GAAG;QACR,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,IAAI;KACV,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAvBH,sCAwBC;AAID,iHAAiH;AACpG,QAAA,0BAA0B,GAAG,KAAK,CAAC;AAEhD,wGAAwG;AAC3F,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AAEnE,2FAA2F;AAC9E,QAAA,uBAAuB,GAAG,OAAO,CAAC;AAE/C,uGAAuG;AACvG,MAAa,sBAAsB;aACjB,YAAO,GAAG,SAAS,CAAC;aACpB,WAAM,GAAG,QAAQ,CAAC;aAClB,UAAK,GAAG,OAAO,CAAC;aAChB,SAAI,GAAG,MAAM,CAAC;aAEd,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAEzF,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAVH,wDAWC"}
@@ -66,4 +66,13 @@ export interface ILuxonDateTimeFactory {
66
66
  zone: string;
67
67
  }): ILuxonDateTime;
68
68
  }
69
+ /** A span of time split into whole units, every field non-negative; `isNegative` carries the sign. */
70
+ export interface ITemporalDurationParts {
71
+ isNegative: boolean;
72
+ days: number;
73
+ hours: number;
74
+ minutes: number;
75
+ seconds: number;
76
+ milliseconds: number;
77
+ }
69
78
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/modules/temporal/common/types.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,iGAAiG;AACjG,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+FAA+F;IAC/F,qBAAqB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;CACxE;AAID,iEAAiE;AACjE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE;QACP,qBAAqB,CAAC,iBAAiB,EAAE,MAAM,GAAG;YAChD,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,sBAAsB,CAAC;SAC9D,CAAC;KACH,CAAC;CACH;AAED,uDAAuD;AACvD,MAAM,WAAW,cAAc;IAC7B,SAAS,IAAI,MAAM,CAAC;IACpB,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAC;CACtC;AAED,4GAA4G;AAC5G,MA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ationStyle } from './common/constants';
2
+ import type { ITemporalDurationParts } from './common/types';
3
+ /** A span of milliseconds, split into days to milliseconds and written out. A day is always 24 hours here. */
4
+ export declare class TemporalDuration {
5
+ static parts(opts: {
6
+ milliseconds: number;
7
+ }): ITemporalDurationParts;
8
+ /**
9
+ * Days, hours, minutes and seconds, zero units left out and milliseconds dropped: `compact` is
10
+ * `1d1h30m`, the other styles use the locale's unit words (`1 ngày 1 giờ 30 phút`). Under a
11
+ * second writes `0s` or `0 seconds`.
12
+ */
13
+ static format(opts: {
14
+ milliseconds: number;
15
+ style?: TTemporalDurationStyle;
16
+ locale: string;
17
+ }): string;
18
+ }
19
+ //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../../src/modules/temporal/duration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAe7D,8GAA8G;AAC9G,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,sBAAsB;IAoBpE;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,sBAAsB,CAAC;QAC/B,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,MAAM;CA0BX"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TemporalDuration = void 0;
4
+ const http_1 = require("../../common/constants/http");
5
+ const error_1 = require("../error");
6
+ const constants_1 = require("./common/constants");
7
+ const SECOND_MILLISECONDS = 1000;
8
+ const MINUTE_MILLISECONDS = 60 * SECOND_MILLISECONDS;
9
+ const HOUR_MILLISECONDS = 60 * MINUTE_MILLISECONDS;
10
+ const DAY_MILLISECONDS = 24 * HOUR_MILLISECONDS;
11
+ /** Largest first: the order a written duration reads in. */
12
+ const FIELDS = [
13
+ { field: 'days', unit: 'day', letter: 'd' },
14
+ { field: 'hours', unit: 'hour', letter: 'h' },
15
+ { field: 'minutes', unit: 'minute', letter: 'm' },
16
+ { field: 'seconds', unit: 'second', letter: 's' },
17
+ ];
18
+ /** A span of milliseconds, split into days to milliseconds and written out. A day is always 24 hours here. */
19
+ class TemporalDuration {
20
+ static parts(opts) {
21
+ const { milliseconds } = opts;
22
+ if (!Number.isSafeInteger(milliseconds)) {
23
+ throw (0, error_1.getError)({
24
+ statusCode: http_1.HTTP.ResultCodes.RS_4.BadRequest,
25
+ message: `[TemporalDuration] milliseconds must be a safe integer - received ${milliseconds}`,
26
+ });
27
+ }
28
+ const total = Math.abs(milliseconds);
29
+ return {
30
+ isNegative: milliseconds < 0,
31
+ days: Math.floor(total / DAY_MILLISECONDS),
32
+ hours: Math.floor((total % DAY_MILLISECONDS) / HOUR_MILLISECONDS),
33
+ minutes: Math.floor((total % HOUR_MILLISECONDS) / MINUTE_MILLISECONDS),
34
+ seconds: Math.floor((total % MINUTE_MILLISECONDS) / SECOND_MILLISECONDS),
35
+ milliseconds: total % SECOND_MILLISECONDS,
36
+ };
37
+ }
38
+ /**
39
+ * Days, hours, minutes and seconds, zero units left out and milliseconds dropped: `compact` is
40
+ * `1d1h30m`, the other styles use the locale's unit words (`1 ngày 1 giờ 30 phút`). Under a
41
+ * second writes `0s` or `0 seconds`.
42
+ */
43
+ static format(opts) {
44
+ const { style = constants_1.TemporalDurationStyles.COMPACT, locale } = opts;
45
+ if (!constants_1.TemporalDurationStyles.isValid(style)) {
46
+ throw (0, error_1.getError)({
47
+ statusCode: http_1.HTTP.ResultCodes.RS_4.BadRequest,
48
+ message: `[TemporalDuration] unknown style '${style}' | Supported: ${[...constants_1.TemporalDurationStyles.SCHEME_SET].join(', ')}`,
49
+ });
50
+ }
51
+ const parts = TemporalDuration.parts({ milliseconds: opts.milliseconds });
52
+ const present = FIELDS.filter(({ field }) => parts[field] > 0);
53
+ const written = present.length > 0 ? present : [FIELDS[FIELDS.length - 1]];
54
+ // Under a second writes `0s` whatever the sign: there is no negative zero to show.
55
+ const sign = parts.isNegative && present.length > 0 ? '-' : '';
56
+ if (style === constants_1.TemporalDurationStyles.COMPACT) {
57
+ return sign + written.map(({ field, letter }) => `${parts[field]}${letter}`).join('');
58
+ }
59
+ const words = written.map(({ field, unit }) => new Intl.NumberFormat(locale, { style: 'unit', unit, unitDisplay: style }).format(parts[field]));
60
+ return sign + new Intl.ListFormat(locale, { type: 'unit', style }).format(words);
61
+ }
62
+ }
63
+ exports.TemporalDuration = TemporalDuration;
64
+ //# sourceMappingURL=duration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.js","sourceRoot":"","sources":["../../../../src/modules/temporal/duration.ts"],"names":[],"mappings":";;;AAAA,kDAA+C;AAC/C,2CAA2C;AAC3C,kDAA4D;AAI5D,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACjC,MAAM,mBAAmB,GAAG,EAAE,GAAG,mBAAmB,CAAC;AACrD,MAAM,iBAAiB,GAAG,EAAE,GAAG,mBAAmB,CAAC;AACnD,MAAM,gBAAgB,GAAG,EAAE,GAAG,iBAAiB,CAAC;AAEhD,4DAA4D;AAC5D,MAAM,MAAM,GAAG;IACb,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE;IAC3C,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE;IAC7C,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE;IACjD,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE;CACzC,CAAC;AAEX,8GAA8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MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnF,CAAC;CACF;AAxDD,4CAwDC"}
@@ -1,9 +1,9 @@
1
1
  import { BaseHelper } from '../base';
2
- import type { TTemporalUnit } from './common/constants';
3
- import type { ITemporalAdapter, IZonedTemporalParts, TTemporalInput } from './common/types';
2
+ import type { TTemporalDurationStyle, TTemporalUnit } from './common/constants';
3
+ import type { ITemporalAdapter, ITemporalDurationParts, IZonedTemporalParts, TTemporalInput } from './common/types';
4
4
  /**
5
5
  * Dates in one time zone, through whichever library you choose: pass an adapter - the runtime's
6
- * `Temporal` (the default), your own dayjs, your own Luxon. The adapter only reports a zone's UTC
6
+ * `Temporal` (the default where the runtime has it, `Intl` everywhere else), your own dayjs, your own Luxon. The adapter only reports a zone's UTC
7
7
  * offset at an instant; the wall clock, daylight-saving gaps and repeats, and the calendar math all
8
8
  * live here, so every adapter shares one behaviour.
9
9
  *
@@ -14,13 +14,25 @@ import type { ITemporalAdapter, IZonedTemporalParts, TTemporalInput } from './co
14
14
  export declare class TemporalHelper extends BaseHelper {
15
15
  /** Validated once per process: `Intl` answers the same for a zone name every time. */
16
16
  private static readonly knownTimeZones;
17
+ private static readonly intlFormatters;
17
18
  private readonly adapter;
18
19
  private readonly timeZone;
20
+ private readonly locale;
21
+ /**
22
+ * `locale` (default `en-US`) spells month and weekday names, AM/PM, relative time and durations,
23
+ * unless a call passes its own.
24
+ */
19
25
  constructor(opts?: {
20
26
  adapter?: ITemporalAdapter;
21
27
  timeZone?: string;
28
+ locale?: string;
22
29
  scope?: string;
23
30
  });
31
+ /** The runtime's `Temporal` where it has one; `Intl`, which every runtime has, everywhere else. */
32
+ private static defaultAdapter;
33
+ private static ensureLocale;
34
+ /** A parse or input error the caller may treat as "not a date"; anything else is a bug and still throws. */
35
+ private static isRefusal;
24
36
  private static ensureTimeZone;
25
37
  private static ensureUnit;
26
38
  /** Every result passes here: an overflowing `add` is refused, never an Invalid Date. */
@@ -45,6 +57,7 @@ export declare class TemporalHelper extends BaseHelper {
45
57
  */
46
58
  private unitBounds;
47
59
  getTimeZone(): string;
60
+ getLocale(): string;
48
61
  now(): Date;
49
62
  /** The instant a value names. An ISO string without an offset is read as wall clock in the zone. */
50
63
  toDate(opts: {
@@ -67,11 +80,34 @@ export declare class TemporalHelper extends BaseHelper {
67
80
  timeZone?: string;
68
81
  }): Date;
69
82
  private readIso;
70
- /** Writes the value in the zone. Without a `pattern`: ISO 8601 with the zone's offset. */
83
+ /** `parse`, answering `null` where `parse` refuses the value. A pattern that does not compile still throws. */
84
+ tryParse(opts: {
85
+ value: string;
86
+ pattern?: string;
87
+ timeZone?: string;
88
+ }): Date | null;
89
+ /** Whether the value names an instant in years 1-9999 - a string read as `parse` reads it. */
90
+ isValid(opts: {
91
+ value: TTemporalInput;
92
+ pattern?: string;
93
+ timeZone?: string;
94
+ }): boolean;
95
+ /**
96
+ * Writes the value in the zone. Without a `pattern`: ISO 8601 with the zone's offset. The locale
97
+ * tokens `MMMM MMM dddd ddd A a hh h LL L` are spelled in `locale`.
98
+ */
71
99
  format(opts: {
72
100
  value: TTemporalInput;
73
101
  pattern?: string;
74
102
  timeZone?: string;
103
+ locale?: string;
104
+ }): string;
105
+ /** Writes the value with `Intl.DateTimeFormat` options, in the zone - for what the pattern tokens cannot say. */
106
+ formatIntl(opts: {
107
+ value: TTemporalInput;
108
+ options?: Omit<Intl.DateTimeFormatOptions, 'timeZone'>;
109
+ timeZone?: string;
110
+ locale?: string;
75
111
  }): string;
76
112
  /**
77
113
  * Moves the value by whole units. Hours and smaller are elapsed time; days and larger move the
@@ -116,5 +152,55 @@ export declare class TemporalHelper extends BaseHelper {
116
152
  timeZone?: string;
117
153
  }): Date;
118
154
  private stepToWeekday;
155
+ /**
156
+ * How many whole units `value` is past `other` - negative when it is before - truncated toward
157
+ * zero. Hours and smaller count elapsed time. Days and larger count the calendar in the zone, as
158
+ * `add` moves it: the answer is the largest `n` that `add` can move `other` by without passing
159
+ * `value`, so `diff(add(x, n), x)` is `n` wherever the zone skips no whole day.
160
+ */
161
+ diff(opts: {
162
+ value: TTemporalInput;
163
+ other: TTemporalInput;
164
+ unit: TTemporalUnit;
165
+ timeZone?: string;
166
+ }): number;
167
+ /**
168
+ * `-1`, `0` or `1` as `value` is before, in, or after the unit that holds `other`, in the zone.
169
+ * Without a unit the two instants are compared to the millisecond.
170
+ */
171
+ compare(opts: {
172
+ value: TTemporalInput;
173
+ other: TTemporalInput;
174
+ unit?: TTemporalUnit;
175
+ timeZone?: string;
176
+ }): -1 | 0 | 1;
177
+ /**
178
+ * `value` relative to `base` (default: now) in words, through `Intl.RelativeTimeFormat`:
179
+ * `3 hours ago`, `in 2 days`. With a `unit`, it counts the unit's boundaries in the zone, so
180
+ * 23:00 yesterday seen at 01:00 is `yesterday` under `numeric: 'auto'`. Without one it says the
181
+ * largest whole unit that has elapsed, from years down to seconds.
182
+ */
183
+ relative(opts: {
184
+ value: TTemporalInput;
185
+ base?: TTemporalInput;
186
+ unit?: TTemporalUnit;
187
+ numeric?: Intl.RelativeTimeFormatNumeric;
188
+ style?: Intl.RelativeTimeFormatStyle;
189
+ timeZone?: string;
190
+ locale?: string;
191
+ }): string;
192
+ /** A span of milliseconds as days, hours, minutes, seconds and milliseconds. A day is 24 hours. */
193
+ durationParts(opts: {
194
+ milliseconds: number;
195
+ }): ITemporalDurationParts;
196
+ /**
197
+ * A span of milliseconds written out: `compact` (the default) is `1d1h30m`; `narrow`, `short` and
198
+ * `long` use the locale's unit words. Zero units are left out and milliseconds dropped.
199
+ */
200
+ formatDuration(opts: {
201
+ milliseconds: number;
202
+ style?: TTemporalDurationStyle;
203
+ locale?: string;
204
+ }): string;
119
205
  }
120
206
  //# sourceMappingURL=helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../../src/modules/temporal/helper.ts"],"names":[],"mappings":"AACA,OAAO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