@nubjs/nub-linux-x64 0.0.7 → 0.0.9
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/bin/nub +0 -0
- package/package.json +1 -1
- package/runtime/addons/nub-native.node +0 -0
- package/runtime/node_modules/@js-temporal/polyfill/CHANGELOG.md +453 -0
- package/runtime/node_modules/@js-temporal/polyfill/LICENSE +13 -0
- package/runtime/node_modules/@js-temporal/polyfill/README.md +90 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.cjs +2 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.cjs.map +1 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.esm.js +2 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.esm.js.map +1 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.umd.js +2 -0
- package/runtime/node_modules/@js-temporal/polyfill/dist/index.umd.js.map +1 -0
- package/runtime/node_modules/@js-temporal/polyfill/index.d.cts +1215 -0
- package/runtime/node_modules/@js-temporal/polyfill/index.d.ts +1215 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/assert.ts +8 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/bigintmath.ts +39 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/calendar.ts +2424 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/debug.ts +7 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/duration.ts +438 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/durationformat.d.ts +93 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/ecmascript.ts +4973 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/index.ts +34 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/init.ts +43 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/instant.ts +138 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/internaltypes.d.ts +242 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/intl.ts +758 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/intrinsicclass.ts +162 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/legacydate.ts +17 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/math.ts +96 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/now.ts +48 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plaindate.ts +212 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plaindatetime.ts +274 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plainmonthday.ts +110 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plaintime.ts +154 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/plainyearmonth.ts +157 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/regex.ts +59 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/slots.ts +341 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/temporal.ts +10 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/timeduration.ts +149 -0
- package/runtime/node_modules/@js-temporal/polyfill/lib/zoneddatetime.ts +492 -0
- package/runtime/node_modules/@js-temporal/polyfill/package.json +143 -0
- package/runtime/node_modules/@oxc-project/runtime/CHANGELOG.md +88 -0
- package/runtime/node_modules/@oxc-project/runtime/LICENSE +22 -0
- package/runtime/node_modules/@oxc-project/runtime/README.md +5 -0
- package/runtime/node_modules/@oxc-project/runtime/package.json +1066 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/AwaitValue.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecoratedDescriptor.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs.js +236 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2203.js +184 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2203R.js +191 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2301.js +222 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2305.js +133 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/applyDecs2311.js +124 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayLikeToArray.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayWithHoles.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/arrayWithoutHoles.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/assertClassBrand.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/assertThisInitialized.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js +24 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js +45 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/asyncToGenerator.js +26 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/callSuper.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/checkInRHS.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/checkPrivateRedeclaration.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorDestructureSet.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorGet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classApplyDescriptorSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCallCheck.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCheckPrivateStaticAccess.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classCheckPrivateStaticFieldDescriptor.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classExtractFieldDescriptor.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classNameTDZError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldDestructureSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldGet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldGet2.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldInitSpec.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldLooseBase.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldLooseKey.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateFieldSet2.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateGetter.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodGet.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodInitSpec.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateMethodSet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classPrivateSetter.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldDestructureSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldSpecGet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateFieldSpecSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateMethodGet.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/classStaticPrivateMethodSet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/construct.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/createClass.js +13 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/createForOfIteratorHelper.js +50 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/createForOfIteratorHelperLoose.js +19 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/createSuper.js +16 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorate.js +23 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorateMetadata.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/decorateParam.js +11 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/defaults.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineAccessor.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineEnumerableProperties.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/dispose.js +28 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/AwaitValue.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/OverloadYield.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecoratedDescriptor.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs.js +236 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2203.js +184 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2203R.js +191 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2301.js +222 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2305.js +133 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/applyDecs2311.js +124 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayLikeToArray.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayWithHoles.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/arrayWithoutHoles.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/assertClassBrand.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/assertThisInitialized.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncGeneratorDelegate.js +24 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncIterator.js +45 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/asyncToGenerator.js +26 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/awaitAsyncGenerator.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/callSuper.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/checkInRHS.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/checkPrivateRedeclaration.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorDestructureSet.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorGet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classApplyDescriptorSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCallCheck.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCheckPrivateStaticAccess.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classExtractFieldDescriptor.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classNameTDZError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldDestructureSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldGet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldGet2.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldInitSpec.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldLooseBase.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldLooseKey.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateFieldSet2.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateGetter.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodGet.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodInitSpec.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateMethodSet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classPrivateSetter.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldDestructureSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldSpecGet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateFieldSpecSet.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateMethodGet.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/classStaticPrivateMethodSet.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/construct.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createClass.js +13 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createForOfIteratorHelper.js +50 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createForOfIteratorHelperLoose.js +19 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/createSuper.js +16 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorate.js +21 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorateMetadata.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/decorateParam.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defaults.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineAccessor.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineEnumerableProperties.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/defineProperty.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/dispose.js +28 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/extends.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/get.js +11 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/getPrototypeOf.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/identity.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/importDeferProxy.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/inherits.js +14 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/inheritsLoose.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/initializerDefineProperty.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/initializerWarningHelper.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/instanceof.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/interopRequireDefault.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/interopRequireWildcard.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/isNativeFunction.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/isNativeReflectConstruct.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/iterableToArray.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/iterableToArrayLimit.js +28 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/jsx.js +22 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/maybeArrayLike.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/newArrowCheck.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nonIterableRest.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nonIterableSpread.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/nullishReceiverError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectDestructuringEmpty.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread.js +14 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectSpread2.js +23 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectWithoutProperties.js +13 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/objectWithoutPropertiesLoose.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/package.json +3 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/possibleConstructorReturn.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/readOnlyError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/regeneratorRuntime.js +304 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/set.js +22 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/setFunctionName.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/setPrototypeOf.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/skipFirstGeneratorNext.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/slicedToArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropBase.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropGet.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/superPropSet.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/taggedTemplateLiteral.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/taggedTemplateLiteralLoose.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/tdz.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/temporalRef.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/temporalUndefined.js +2 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toConsumableArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toPrimitive.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toPropertyKey.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/toSetter.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/typeof.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/unsupportedIterableToArray.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/using.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/usingCtx.js +59 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapAsyncGenerator.js +69 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapNativeSuper.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/wrapRegExp.js +51 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/esm/writeOnlyError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/extends.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/get.js +11 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/getPrototypeOf.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/identity.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/importDeferProxy.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/inherits.js +14 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/inheritsLoose.js +5 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/initializerDefineProperty.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/initializerWarningHelper.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/instanceof.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/interopRequireDefault.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/interopRequireWildcard.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/isNativeFunction.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/isNativeReflectConstruct.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/iterableToArray.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/iterableToArrayLimit.js +28 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/jsx.js +22 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/maybeArrayLike.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/newArrowCheck.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/nonIterableRest.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/nonIterableSpread.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/nullishReceiverError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectDestructuringEmpty.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectSpread.js +14 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js +23 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js +13 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/possibleConstructorReturn.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/readOnlyError.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/regeneratorRuntime.js +304 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/set.js +22 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/setFunctionName.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/setPrototypeOf.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/skipFirstGeneratorNext.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/slicedToArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropBase.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropGet.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/superPropSet.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/taggedTemplateLiteral.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/taggedTemplateLiteralLoose.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/tdz.js +4 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/temporalRef.js +6 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/temporalUndefined.js +2 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toConsumableArray.js +8 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js +7 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/toSetter.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/typeof.js +10 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/unsupportedIterableToArray.js +9 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/using.js +12 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js +59 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js +69 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapNativeSuper.js +27 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/wrapRegExp.js +51 -0
- package/runtime/node_modules/@oxc-project/runtime/src/helpers/writeOnlyError.js +4 -0
- package/runtime/node_modules/@oxc-project/types/LICENSE +22 -0
- package/runtime/node_modules/@oxc-project/types/README.md +3 -0
- package/runtime/node_modules/@oxc-project/types/package.json +26 -0
- package/runtime/node_modules/@oxc-project/types/types.d.ts +1912 -0
- package/runtime/node_modules/@petamoriken/float16/LICENSE +21 -0
- package/runtime/node_modules/@petamoriken/float16/README.md +413 -0
- package/runtime/node_modules/@petamoriken/float16/browser/float16.js +1340 -0
- package/runtime/node_modules/@petamoriken/float16/browser/float16.mjs +1325 -0
- package/runtime/node_modules/@petamoriken/float16/index.d.ts +546 -0
- package/runtime/node_modules/@petamoriken/float16/index.v5.6.d.ts +546 -0
- package/runtime/node_modules/@petamoriken/float16/index.v5.7.d.ts +555 -0
- package/runtime/node_modules/@petamoriken/float16/inspect/node.cjs +25 -0
- package/runtime/node_modules/@petamoriken/float16/inspect/node.mjs +23 -0
- package/runtime/node_modules/@petamoriken/float16/lib/DataView.cjs +16 -0
- package/runtime/node_modules/@petamoriken/float16/lib/Float16Array.cjs +690 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/arrayIterator.cjs +52 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/brand.cjs +27 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/converter.cjs +111 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/is.cjs +78 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/messages.cjs +18 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/primordials.cjs +150 -0
- package/runtime/node_modules/@petamoriken/float16/lib/_util/spec.cjs +84 -0
- package/runtime/node_modules/@petamoriken/float16/lib/f16round.cjs +10 -0
- package/runtime/node_modules/@petamoriken/float16/lib/index.cjs +16 -0
- package/runtime/node_modules/@petamoriken/float16/lib/isTypedArray.cjs +11 -0
- package/runtime/node_modules/@petamoriken/float16/package.json +115 -0
- package/runtime/node_modules/@petamoriken/float16/src/DataView.mjs +35 -0
- package/runtime/node_modules/@petamoriken/float16/src/Float16Array.mjs +1194 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/arrayIterator.mjs +86 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/brand.mjs +31 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/converter.mjs +173 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/is.mjs +151 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/messages.mjs +22 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/primordials.mjs +254 -0
- package/runtime/node_modules/@petamoriken/float16/src/_util/spec.mjs +137 -0
- package/runtime/node_modules/@petamoriken/float16/src/f16round.mjs +10 -0
- package/runtime/node_modules/@petamoriken/float16/src/index.mjs +7 -0
- package/runtime/node_modules/@petamoriken/float16/src/isTypedArray.mjs +10 -0
- package/runtime/node_modules/get-tsconfig/LICENSE +21 -0
- package/runtime/node_modules/get-tsconfig/README.md +268 -0
- package/runtime/node_modules/get-tsconfig/dist/index.cjs +7 -0
- package/runtime/node_modules/get-tsconfig/dist/index.d.cts +2116 -0
- package/runtime/node_modules/get-tsconfig/dist/index.d.mts +2116 -0
- package/runtime/node_modules/get-tsconfig/dist/index.mjs +7 -0
- package/runtime/node_modules/get-tsconfig/package.json +46 -0
- package/runtime/node_modules/jsbi/LICENSE +176 -0
- package/runtime/node_modules/jsbi/README.md +173 -0
- package/runtime/node_modules/jsbi/dist/jsbi-cjs.js +2 -0
- package/runtime/node_modules/jsbi/dist/jsbi-cjs.js.map +1 -0
- package/runtime/node_modules/jsbi/dist/jsbi-umd.js +2 -0
- package/runtime/node_modules/jsbi/dist/jsbi-umd.js.map +1 -0
- package/runtime/node_modules/jsbi/dist/jsbi.mjs +2 -0
- package/runtime/node_modules/jsbi/dist/jsbi.mjs.map +1 -0
- package/runtime/node_modules/jsbi/jsbi.d.ts +43 -0
- package/runtime/node_modules/jsbi/package.json +35 -0
- package/runtime/node_modules/oxc-parser/LICENSE +22 -0
- package/runtime/node_modules/oxc-parser/README.md +167 -0
- package/runtime/node_modules/oxc-parser/package.json +153 -0
- package/runtime/node_modules/oxc-parser/src-js/bindings.js +601 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/constants.js +105 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/js.js +5862 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/js_range.js +6403 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/ts.js +6154 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/ts_range.js +6723 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/lazy/constructors.js +13875 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/lazy/type_ids.js +191 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/lazy/walk.js +5810 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/visit/keys.js +220 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/visit/type_ids.js +177 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts +387 -0
- package/runtime/node_modules/oxc-parser/src-js/generated/visit/walk.js +2455 -0
- package/runtime/node_modules/oxc-parser/src-js/index.d.ts +312 -0
- package/runtime/node_modules/oxc-parser/src-js/index.js +108 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/common.js +301 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/eager.js +255 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/lazy-common.js +11 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/lazy.js +162 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/node-array.js +365 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/supported.js +52 -0
- package/runtime/node_modules/oxc-parser/src-js/raw-transfer/visitor.js +127 -0
- package/runtime/node_modules/oxc-parser/src-js/visit/index.js +41 -0
- package/runtime/node_modules/oxc-parser/src-js/visit/visitor.js +405 -0
- package/runtime/node_modules/oxc-parser/src-js/wasm.js +13 -0
- package/runtime/node_modules/oxc-parser/src-js/webcontainer-fallback.cjs +21 -0
- package/runtime/node_modules/oxc-parser/src-js/wrap.js +57 -0
- package/runtime/node_modules/oxc-transform/LICENSE +22 -0
- package/runtime/node_modules/oxc-transform/README.md +84 -0
- package/runtime/node_modules/oxc-transform/browser.js +1 -0
- package/runtime/node_modules/oxc-transform/index.d.ts +658 -0
- package/runtime/node_modules/oxc-transform/index.js +598 -0
- package/runtime/node_modules/oxc-transform/package.json +114 -0
- package/runtime/node_modules/oxc-transform/webcontainer-fallback.cjs +21 -0
- package/runtime/node_modules/resolve-pkg-maps/LICENSE +21 -0
- package/runtime/node_modules/resolve-pkg-maps/README.md +216 -0
- package/runtime/node_modules/resolve-pkg-maps/dist/index.cjs +1 -0
- package/runtime/node_modules/resolve-pkg-maps/dist/index.d.cts +11 -0
- package/runtime/node_modules/resolve-pkg-maps/dist/index.d.mts +11 -0
- package/runtime/node_modules/resolve-pkg-maps/dist/index.mjs +1 -0
- package/runtime/node_modules/resolve-pkg-maps/package.json +42 -0
- package/runtime/node_modules/urlpattern-polyfill/LICENSE +19 -0
- package/runtime/node_modules/urlpattern-polyfill/README.md +242 -0
- package/runtime/node_modules/urlpattern-polyfill/dist/index.d.ts +9 -0
- package/runtime/node_modules/urlpattern-polyfill/dist/types.d.ts +49 -0
- package/runtime/node_modules/urlpattern-polyfill/dist/urlpattern.cjs +1 -0
- package/runtime/node_modules/urlpattern-polyfill/dist/urlpattern.js +1 -0
- package/runtime/node_modules/urlpattern-polyfill/index.cjs +7 -0
- package/runtime/node_modules/urlpattern-polyfill/index.js +7 -0
- package/runtime/node_modules/urlpattern-polyfill/package.json +149 -0
- package/runtime/version.mjs +1 -1
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import { DEBUG } from './debug';
|
|
2
|
+
import { assert } from './assert';
|
|
3
|
+
import * as ES from './ecmascript';
|
|
4
|
+
import { ModifiedIntlDurationFormatPrototypeFormat } from './intl';
|
|
5
|
+
import { MakeIntrinsicClass } from './intrinsicclass';
|
|
6
|
+
import {
|
|
7
|
+
YEARS,
|
|
8
|
+
MONTHS,
|
|
9
|
+
WEEKS,
|
|
10
|
+
DAYS,
|
|
11
|
+
HOURS,
|
|
12
|
+
MINUTES,
|
|
13
|
+
SECONDS,
|
|
14
|
+
MILLISECONDS,
|
|
15
|
+
MICROSECONDS,
|
|
16
|
+
NANOSECONDS,
|
|
17
|
+
CALENDAR,
|
|
18
|
+
EPOCHNANOSECONDS,
|
|
19
|
+
CreateSlots,
|
|
20
|
+
GetSlot,
|
|
21
|
+
ISO_DATE,
|
|
22
|
+
SetSlot,
|
|
23
|
+
TIME_ZONE
|
|
24
|
+
} from './slots';
|
|
25
|
+
import { TimeDuration } from './timeduration';
|
|
26
|
+
import type { Temporal } from '..';
|
|
27
|
+
import type { DurationParams as Params, DurationReturn as Return } from './internaltypes';
|
|
28
|
+
import JSBI from 'jsbi';
|
|
29
|
+
|
|
30
|
+
export class Duration implements Temporal.Duration {
|
|
31
|
+
constructor(
|
|
32
|
+
yearsParam: Params['constructor'][0] = 0,
|
|
33
|
+
monthsParam: Params['constructor'][1] = 0,
|
|
34
|
+
weeksParam: Params['constructor'][2] = 0,
|
|
35
|
+
daysParam: Params['constructor'][3] = 0,
|
|
36
|
+
hoursParam: Params['constructor'][4] = 0,
|
|
37
|
+
minutesParam: Params['constructor'][5] = 0,
|
|
38
|
+
secondsParam: Params['constructor'][6] = 0,
|
|
39
|
+
millisecondsParam: Params['constructor'][7] = 0,
|
|
40
|
+
microsecondsParam: Params['constructor'][8] = 0,
|
|
41
|
+
nanosecondsParam: Params['constructor'][9] = 0
|
|
42
|
+
) {
|
|
43
|
+
const years = yearsParam === undefined ? 0 : ES.ToIntegerIfIntegral(yearsParam);
|
|
44
|
+
const months = monthsParam === undefined ? 0 : ES.ToIntegerIfIntegral(monthsParam);
|
|
45
|
+
const weeks = weeksParam === undefined ? 0 : ES.ToIntegerIfIntegral(weeksParam);
|
|
46
|
+
const days = daysParam === undefined ? 0 : ES.ToIntegerIfIntegral(daysParam);
|
|
47
|
+
const hours = hoursParam === undefined ? 0 : ES.ToIntegerIfIntegral(hoursParam);
|
|
48
|
+
const minutes = minutesParam === undefined ? 0 : ES.ToIntegerIfIntegral(minutesParam);
|
|
49
|
+
const seconds = secondsParam === undefined ? 0 : ES.ToIntegerIfIntegral(secondsParam);
|
|
50
|
+
const milliseconds = millisecondsParam === undefined ? 0 : ES.ToIntegerIfIntegral(millisecondsParam);
|
|
51
|
+
const microseconds = microsecondsParam === undefined ? 0 : ES.ToIntegerIfIntegral(microsecondsParam);
|
|
52
|
+
const nanoseconds = nanosecondsParam === undefined ? 0 : ES.ToIntegerIfIntegral(nanosecondsParam);
|
|
53
|
+
|
|
54
|
+
ES.RejectDuration(years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds);
|
|
55
|
+
|
|
56
|
+
CreateSlots(this);
|
|
57
|
+
SetSlot(this, YEARS, years);
|
|
58
|
+
SetSlot(this, MONTHS, months);
|
|
59
|
+
SetSlot(this, WEEKS, weeks);
|
|
60
|
+
SetSlot(this, DAYS, days);
|
|
61
|
+
SetSlot(this, HOURS, hours);
|
|
62
|
+
SetSlot(this, MINUTES, minutes);
|
|
63
|
+
SetSlot(this, SECONDS, seconds);
|
|
64
|
+
SetSlot(this, MILLISECONDS, milliseconds);
|
|
65
|
+
SetSlot(this, MICROSECONDS, microseconds);
|
|
66
|
+
SetSlot(this, NANOSECONDS, nanoseconds);
|
|
67
|
+
|
|
68
|
+
if (DEBUG) {
|
|
69
|
+
Object.defineProperty(this, '_repr_', {
|
|
70
|
+
value: `Temporal.Duration <${ES.TemporalDurationToString(this, 'auto')}>`,
|
|
71
|
+
writable: false,
|
|
72
|
+
enumerable: false,
|
|
73
|
+
configurable: false
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
get years(): Return['years'] {
|
|
78
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
79
|
+
return GetSlot(this, YEARS);
|
|
80
|
+
}
|
|
81
|
+
get months(): Return['months'] {
|
|
82
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
83
|
+
return GetSlot(this, MONTHS);
|
|
84
|
+
}
|
|
85
|
+
get weeks(): Return['weeks'] {
|
|
86
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
87
|
+
return GetSlot(this, WEEKS);
|
|
88
|
+
}
|
|
89
|
+
get days(): Return['days'] {
|
|
90
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
91
|
+
return GetSlot(this, DAYS);
|
|
92
|
+
}
|
|
93
|
+
get hours(): Return['hours'] {
|
|
94
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
95
|
+
return GetSlot(this, HOURS);
|
|
96
|
+
}
|
|
97
|
+
get minutes(): Return['minutes'] {
|
|
98
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
99
|
+
return GetSlot(this, MINUTES);
|
|
100
|
+
}
|
|
101
|
+
get seconds(): Return['seconds'] {
|
|
102
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
103
|
+
return GetSlot(this, SECONDS);
|
|
104
|
+
}
|
|
105
|
+
get milliseconds(): Return['milliseconds'] {
|
|
106
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
107
|
+
return GetSlot(this, MILLISECONDS);
|
|
108
|
+
}
|
|
109
|
+
get microseconds(): Return['microseconds'] {
|
|
110
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
111
|
+
return GetSlot(this, MICROSECONDS);
|
|
112
|
+
}
|
|
113
|
+
get nanoseconds(): Return['nanoseconds'] {
|
|
114
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
115
|
+
return GetSlot(this, NANOSECONDS);
|
|
116
|
+
}
|
|
117
|
+
get sign(): Return['sign'] {
|
|
118
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
119
|
+
return ES.DurationSign(this);
|
|
120
|
+
}
|
|
121
|
+
get blank(): Return['blank'] {
|
|
122
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
123
|
+
return ES.DurationSign(this) === 0;
|
|
124
|
+
}
|
|
125
|
+
with(durationLike: Params['with'][0]): Return['with'] {
|
|
126
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
127
|
+
const partialDuration = ES.ToTemporalPartialDurationRecord(durationLike);
|
|
128
|
+
const {
|
|
129
|
+
years = GetSlot(this, YEARS),
|
|
130
|
+
months = GetSlot(this, MONTHS),
|
|
131
|
+
weeks = GetSlot(this, WEEKS),
|
|
132
|
+
days = GetSlot(this, DAYS),
|
|
133
|
+
hours = GetSlot(this, HOURS),
|
|
134
|
+
minutes = GetSlot(this, MINUTES),
|
|
135
|
+
seconds = GetSlot(this, SECONDS),
|
|
136
|
+
milliseconds = GetSlot(this, MILLISECONDS),
|
|
137
|
+
microseconds = GetSlot(this, MICROSECONDS),
|
|
138
|
+
nanoseconds = GetSlot(this, NANOSECONDS)
|
|
139
|
+
} = partialDuration;
|
|
140
|
+
return new Duration(years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds);
|
|
141
|
+
}
|
|
142
|
+
negated(): Return['negated'] {
|
|
143
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
144
|
+
return ES.CreateNegatedTemporalDuration(this);
|
|
145
|
+
}
|
|
146
|
+
abs(): Return['abs'] {
|
|
147
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
148
|
+
return new Duration(
|
|
149
|
+
Math.abs(GetSlot(this, YEARS)),
|
|
150
|
+
Math.abs(GetSlot(this, MONTHS)),
|
|
151
|
+
Math.abs(GetSlot(this, WEEKS)),
|
|
152
|
+
Math.abs(GetSlot(this, DAYS)),
|
|
153
|
+
Math.abs(GetSlot(this, HOURS)),
|
|
154
|
+
Math.abs(GetSlot(this, MINUTES)),
|
|
155
|
+
Math.abs(GetSlot(this, SECONDS)),
|
|
156
|
+
Math.abs(GetSlot(this, MILLISECONDS)),
|
|
157
|
+
Math.abs(GetSlot(this, MICROSECONDS)),
|
|
158
|
+
Math.abs(GetSlot(this, NANOSECONDS))
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
add(other: Params['add'][0]): Return['add'] {
|
|
162
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
163
|
+
return ES.AddDurations('add', this, other);
|
|
164
|
+
}
|
|
165
|
+
subtract(other: Params['subtract'][0]): Return['subtract'] {
|
|
166
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
167
|
+
return ES.AddDurations('subtract', this, other);
|
|
168
|
+
}
|
|
169
|
+
round(roundToParam: Params['round'][0]): Return['round'] {
|
|
170
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
171
|
+
if (roundToParam === undefined) throw new TypeError('options parameter is required');
|
|
172
|
+
|
|
173
|
+
const existingLargestUnit = ES.DefaultTemporalLargestUnit(this);
|
|
174
|
+
const roundTo =
|
|
175
|
+
typeof roundToParam === 'string'
|
|
176
|
+
? (ES.CreateOnePropObject('smallestUnit', roundToParam) as Exclude<typeof roundToParam, string>)
|
|
177
|
+
: ES.GetOptionsObject(roundToParam);
|
|
178
|
+
|
|
179
|
+
let largestUnit = ES.GetTemporalUnitValuedOption(roundTo, 'largestUnit', 'datetime', undefined, ['auto']);
|
|
180
|
+
let { plainRelativeTo, zonedRelativeTo } = ES.GetTemporalRelativeToOption(roundTo);
|
|
181
|
+
const roundingIncrement = ES.GetTemporalRoundingIncrementOption(roundTo);
|
|
182
|
+
const roundingMode = ES.GetRoundingModeOption(roundTo, 'halfExpand');
|
|
183
|
+
let smallestUnit = ES.GetTemporalUnitValuedOption(roundTo, 'smallestUnit', 'datetime', undefined);
|
|
184
|
+
|
|
185
|
+
let smallestUnitPresent = true;
|
|
186
|
+
if (!smallestUnit) {
|
|
187
|
+
smallestUnitPresent = false;
|
|
188
|
+
smallestUnit = 'nanosecond';
|
|
189
|
+
}
|
|
190
|
+
const defaultLargestUnit = ES.LargerOfTwoTemporalUnits(existingLargestUnit, smallestUnit);
|
|
191
|
+
let largestUnitPresent = true;
|
|
192
|
+
if (!largestUnit) {
|
|
193
|
+
largestUnitPresent = false;
|
|
194
|
+
largestUnit = defaultLargestUnit;
|
|
195
|
+
}
|
|
196
|
+
if (largestUnit === 'auto') largestUnit = defaultLargestUnit;
|
|
197
|
+
if (!smallestUnitPresent && !largestUnitPresent) {
|
|
198
|
+
throw new RangeError('at least one of smallestUnit or largestUnit is required');
|
|
199
|
+
}
|
|
200
|
+
if (ES.LargerOfTwoTemporalUnits(largestUnit, smallestUnit) !== largestUnit) {
|
|
201
|
+
throw new RangeError(`largestUnit ${largestUnit} cannot be smaller than smallestUnit ${smallestUnit}`);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const maximumIncrements = {
|
|
205
|
+
hour: 24,
|
|
206
|
+
minute: 60,
|
|
207
|
+
second: 60,
|
|
208
|
+
millisecond: 1000,
|
|
209
|
+
microsecond: 1000,
|
|
210
|
+
nanosecond: 1000
|
|
211
|
+
} as { [k in Temporal.DateTimeUnit]?: number };
|
|
212
|
+
const maximum = maximumIncrements[smallestUnit];
|
|
213
|
+
if (maximum !== undefined) ES.ValidateTemporalRoundingIncrement(roundingIncrement, maximum, false);
|
|
214
|
+
if (roundingIncrement > 1 && ES.TemporalUnitCategory(smallestUnit) === 'date' && largestUnit !== smallestUnit) {
|
|
215
|
+
throw new RangeError('For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (zonedRelativeTo) {
|
|
219
|
+
let duration = ES.ToInternalDurationRecord(this);
|
|
220
|
+
const timeZone = GetSlot(zonedRelativeTo, TIME_ZONE);
|
|
221
|
+
const calendar = GetSlot(zonedRelativeTo, CALENDAR);
|
|
222
|
+
const relativeEpochNs = GetSlot(zonedRelativeTo, EPOCHNANOSECONDS);
|
|
223
|
+
const targetEpochNs = ES.AddZonedDateTime(relativeEpochNs, timeZone, calendar, duration);
|
|
224
|
+
duration = ES.DifferenceZonedDateTimeWithRounding(
|
|
225
|
+
relativeEpochNs,
|
|
226
|
+
targetEpochNs,
|
|
227
|
+
timeZone,
|
|
228
|
+
calendar,
|
|
229
|
+
largestUnit,
|
|
230
|
+
roundingIncrement,
|
|
231
|
+
smallestUnit,
|
|
232
|
+
roundingMode
|
|
233
|
+
);
|
|
234
|
+
if (ES.TemporalUnitCategory(largestUnit) === 'date') largestUnit = 'hour';
|
|
235
|
+
return ES.TemporalDurationFromInternal(duration, largestUnit);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (plainRelativeTo) {
|
|
239
|
+
let duration = ES.ToInternalDurationRecordWith24HourDays(this);
|
|
240
|
+
const targetTime = ES.AddTime(ES.MidnightTimeRecord(), duration.time);
|
|
241
|
+
|
|
242
|
+
// Delegate the date part addition to the calendar
|
|
243
|
+
const isoRelativeToDate = GetSlot(plainRelativeTo, ISO_DATE);
|
|
244
|
+
const calendar = GetSlot(plainRelativeTo, CALENDAR);
|
|
245
|
+
const dateDuration = ES.AdjustDateDurationRecord(duration.date, targetTime.deltaDays);
|
|
246
|
+
const targetDate = ES.CalendarDateAdd(calendar, isoRelativeToDate, dateDuration, 'constrain');
|
|
247
|
+
|
|
248
|
+
const isoDateTime = ES.CombineISODateAndTimeRecord(isoRelativeToDate, ES.MidnightTimeRecord());
|
|
249
|
+
const targetDateTime = ES.CombineISODateAndTimeRecord(targetDate, targetTime);
|
|
250
|
+
duration = ES.DifferencePlainDateTimeWithRounding(
|
|
251
|
+
isoDateTime,
|
|
252
|
+
targetDateTime,
|
|
253
|
+
calendar,
|
|
254
|
+
largestUnit,
|
|
255
|
+
roundingIncrement,
|
|
256
|
+
smallestUnit,
|
|
257
|
+
roundingMode
|
|
258
|
+
);
|
|
259
|
+
return ES.TemporalDurationFromInternal(duration, largestUnit);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// No reference date to calculate difference relative to
|
|
263
|
+
if (ES.IsCalendarUnit(existingLargestUnit)) {
|
|
264
|
+
throw new RangeError(`a starting point is required for ${existingLargestUnit}s balancing`);
|
|
265
|
+
}
|
|
266
|
+
if (ES.IsCalendarUnit(largestUnit)) {
|
|
267
|
+
throw new RangeError(`a starting point is required for ${largestUnit}s balancing`);
|
|
268
|
+
}
|
|
269
|
+
assert(!ES.IsCalendarUnit(smallestUnit), 'smallestUnit was larger than largestUnit');
|
|
270
|
+
let internalDuration = ES.ToInternalDurationRecordWith24HourDays(this);
|
|
271
|
+
if (smallestUnit === 'day') {
|
|
272
|
+
// First convert time units up to days
|
|
273
|
+
const { quotient, remainder } = internalDuration.time.divmod(ES.DAY_NANOS);
|
|
274
|
+
let days = internalDuration.date.days + quotient + ES.TotalTimeDuration(remainder, 'day');
|
|
275
|
+
days = ES.RoundNumberToIncrement(days, roundingIncrement, roundingMode);
|
|
276
|
+
const dateDuration = { years: 0, months: 0, weeks: 0, days };
|
|
277
|
+
internalDuration = ES.CombineDateAndTimeDuration(dateDuration, TimeDuration.ZERO);
|
|
278
|
+
} else {
|
|
279
|
+
const timeDuration = ES.RoundTimeDuration(internalDuration.time, roundingIncrement, smallestUnit, roundingMode);
|
|
280
|
+
internalDuration = ES.CombineDateAndTimeDuration(ES.ZeroDateDuration(), timeDuration);
|
|
281
|
+
}
|
|
282
|
+
return ES.TemporalDurationFromInternal(internalDuration, largestUnit);
|
|
283
|
+
}
|
|
284
|
+
total(optionsParam: Params['total'][0]): Return['total'] {
|
|
285
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
286
|
+
|
|
287
|
+
if (optionsParam === undefined) throw new TypeError('options argument is required');
|
|
288
|
+
const options =
|
|
289
|
+
typeof optionsParam === 'string'
|
|
290
|
+
? (ES.CreateOnePropObject('unit', optionsParam) as Exclude<typeof optionsParam, string>)
|
|
291
|
+
: ES.GetOptionsObject(optionsParam);
|
|
292
|
+
let { plainRelativeTo, zonedRelativeTo } = ES.GetTemporalRelativeToOption(options);
|
|
293
|
+
const unit = ES.GetTemporalUnitValuedOption(options, 'unit', 'datetime', ES.REQUIRED);
|
|
294
|
+
|
|
295
|
+
if (zonedRelativeTo) {
|
|
296
|
+
const duration = ES.ToInternalDurationRecord(this);
|
|
297
|
+
const timeZone = GetSlot(zonedRelativeTo, TIME_ZONE);
|
|
298
|
+
const calendar = GetSlot(zonedRelativeTo, CALENDAR);
|
|
299
|
+
const relativeEpochNs = GetSlot(zonedRelativeTo, EPOCHNANOSECONDS);
|
|
300
|
+
const targetEpochNs = ES.AddZonedDateTime(relativeEpochNs, timeZone, calendar, duration);
|
|
301
|
+
return ES.DifferenceZonedDateTimeWithTotal(relativeEpochNs, targetEpochNs, timeZone, calendar, unit);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (plainRelativeTo) {
|
|
305
|
+
const duration = ES.ToInternalDurationRecordWith24HourDays(this);
|
|
306
|
+
let targetTime = ES.AddTime(ES.MidnightTimeRecord(), duration.time);
|
|
307
|
+
|
|
308
|
+
// Delegate the date part addition to the calendar
|
|
309
|
+
const isoRelativeToDate = GetSlot(plainRelativeTo, ISO_DATE);
|
|
310
|
+
const calendar = GetSlot(plainRelativeTo, CALENDAR);
|
|
311
|
+
const dateDuration = ES.AdjustDateDurationRecord(duration.date, targetTime.deltaDays);
|
|
312
|
+
const targetDate = ES.CalendarDateAdd(calendar, isoRelativeToDate, dateDuration, 'constrain');
|
|
313
|
+
|
|
314
|
+
const isoDateTime = ES.CombineISODateAndTimeRecord(isoRelativeToDate, ES.MidnightTimeRecord());
|
|
315
|
+
const targetDateTime = ES.CombineISODateAndTimeRecord(targetDate, targetTime);
|
|
316
|
+
return ES.DifferencePlainDateTimeWithTotal(isoDateTime, targetDateTime, calendar, unit);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// No reference date to calculate difference relative to
|
|
320
|
+
const largestUnit = ES.DefaultTemporalLargestUnit(this);
|
|
321
|
+
if (ES.IsCalendarUnit(largestUnit)) {
|
|
322
|
+
throw new RangeError(`a starting point is required for ${largestUnit}s total`);
|
|
323
|
+
}
|
|
324
|
+
if (ES.IsCalendarUnit(unit)) {
|
|
325
|
+
throw new RangeError(`a starting point is required for ${unit}s total`);
|
|
326
|
+
}
|
|
327
|
+
const duration = ES.ToInternalDurationRecordWith24HourDays(this);
|
|
328
|
+
return ES.TotalTimeDuration(duration.time, unit);
|
|
329
|
+
}
|
|
330
|
+
toString(options: Params['toString'][0] = undefined): string {
|
|
331
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
332
|
+
const resolvedOptions = ES.GetOptionsObject(options);
|
|
333
|
+
const digits = ES.GetTemporalFractionalSecondDigitsOption(resolvedOptions);
|
|
334
|
+
const roundingMode = ES.GetRoundingModeOption(resolvedOptions, 'trunc');
|
|
335
|
+
const smallestUnit = ES.GetTemporalUnitValuedOption(resolvedOptions, 'smallestUnit', 'time', undefined);
|
|
336
|
+
if (smallestUnit === 'hour' || smallestUnit === 'minute') {
|
|
337
|
+
throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');
|
|
338
|
+
}
|
|
339
|
+
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
|
|
340
|
+
ES.uncheckedAssertNarrowedType<Exclude<typeof precision, 'minute'>>(
|
|
341
|
+
precision,
|
|
342
|
+
'Precision cannot be "minute" because of RangeError above'
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
if (unit === 'nanosecond' && increment === 1) return ES.TemporalDurationToString(this, precision);
|
|
346
|
+
|
|
347
|
+
const largestUnit = ES.DefaultTemporalLargestUnit(this);
|
|
348
|
+
let internalDuration = ES.ToInternalDurationRecord(this);
|
|
349
|
+
const timeDuration = ES.RoundTimeDuration(internalDuration.time, increment, unit, roundingMode);
|
|
350
|
+
internalDuration = ES.CombineDateAndTimeDuration(internalDuration.date, timeDuration);
|
|
351
|
+
const roundedDuration = ES.TemporalDurationFromInternal(
|
|
352
|
+
internalDuration,
|
|
353
|
+
ES.LargerOfTwoTemporalUnits(largestUnit, 'second')
|
|
354
|
+
);
|
|
355
|
+
return ES.TemporalDurationToString(roundedDuration, precision);
|
|
356
|
+
}
|
|
357
|
+
toJSON(): Return['toJSON'] {
|
|
358
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
359
|
+
return ES.TemporalDurationToString(this, 'auto');
|
|
360
|
+
}
|
|
361
|
+
toLocaleString(
|
|
362
|
+
locales: Params['toLocaleString'][0] = undefined,
|
|
363
|
+
options: Params['toLocaleString'][1] = undefined
|
|
364
|
+
): string {
|
|
365
|
+
ES.CheckReceiver(this, ES.IsTemporalDuration);
|
|
366
|
+
if (typeof Intl.DurationFormat === 'function') {
|
|
367
|
+
const formatter = new Intl.DurationFormat(locales, options as Intl.DurationFormatOptions);
|
|
368
|
+
return ModifiedIntlDurationFormatPrototypeFormat.call(formatter, this);
|
|
369
|
+
}
|
|
370
|
+
console.warn('Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat.');
|
|
371
|
+
return ES.TemporalDurationToString(this, 'auto');
|
|
372
|
+
}
|
|
373
|
+
valueOf(): never {
|
|
374
|
+
ES.ValueOfThrows('Duration');
|
|
375
|
+
}
|
|
376
|
+
static from(item: Params['from'][0]): Return['from'] {
|
|
377
|
+
return ES.ToTemporalDuration(item);
|
|
378
|
+
}
|
|
379
|
+
static compare(
|
|
380
|
+
oneParam: Params['compare'][0],
|
|
381
|
+
twoParam: Params['compare'][1],
|
|
382
|
+
options: Params['compare'][2] = undefined
|
|
383
|
+
): Return['compare'] {
|
|
384
|
+
const one = ES.ToTemporalDuration(oneParam);
|
|
385
|
+
const two = ES.ToTemporalDuration(twoParam);
|
|
386
|
+
const resolvedOptions = ES.GetOptionsObject(options);
|
|
387
|
+
const { plainRelativeTo, zonedRelativeTo } = ES.GetTemporalRelativeToOption(resolvedOptions);
|
|
388
|
+
|
|
389
|
+
if (
|
|
390
|
+
GetSlot(one, YEARS) === GetSlot(two, YEARS) &&
|
|
391
|
+
GetSlot(one, MONTHS) === GetSlot(two, MONTHS) &&
|
|
392
|
+
GetSlot(one, WEEKS) === GetSlot(two, WEEKS) &&
|
|
393
|
+
GetSlot(one, DAYS) === GetSlot(two, DAYS) &&
|
|
394
|
+
GetSlot(one, HOURS) === GetSlot(two, HOURS) &&
|
|
395
|
+
GetSlot(one, MINUTES) === GetSlot(two, MINUTES) &&
|
|
396
|
+
GetSlot(one, SECONDS) === GetSlot(two, SECONDS) &&
|
|
397
|
+
GetSlot(one, MILLISECONDS) === GetSlot(two, MILLISECONDS) &&
|
|
398
|
+
GetSlot(one, MICROSECONDS) === GetSlot(two, MICROSECONDS) &&
|
|
399
|
+
GetSlot(one, NANOSECONDS) === GetSlot(two, NANOSECONDS)
|
|
400
|
+
) {
|
|
401
|
+
return 0;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const largestUnit1 = ES.DefaultTemporalLargestUnit(one);
|
|
405
|
+
const largestUnit2 = ES.DefaultTemporalLargestUnit(two);
|
|
406
|
+
const duration1 = ES.ToInternalDurationRecord(one);
|
|
407
|
+
const duration2 = ES.ToInternalDurationRecord(two);
|
|
408
|
+
|
|
409
|
+
if (
|
|
410
|
+
zonedRelativeTo &&
|
|
411
|
+
(ES.TemporalUnitCategory(largestUnit1) === 'date' || ES.TemporalUnitCategory(largestUnit2) === 'date')
|
|
412
|
+
) {
|
|
413
|
+
const timeZone = GetSlot(zonedRelativeTo, TIME_ZONE);
|
|
414
|
+
const calendar = GetSlot(zonedRelativeTo, CALENDAR);
|
|
415
|
+
const epochNs = GetSlot(zonedRelativeTo, EPOCHNANOSECONDS);
|
|
416
|
+
|
|
417
|
+
const after1 = ES.AddZonedDateTime(epochNs, timeZone, calendar, duration1);
|
|
418
|
+
const after2 = ES.AddZonedDateTime(epochNs, timeZone, calendar, duration2);
|
|
419
|
+
return ES.ComparisonResult(JSBI.toNumber(JSBI.subtract(after1, after2)));
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
let d1 = duration1.date.days;
|
|
423
|
+
let d2 = duration2.date.days;
|
|
424
|
+
if (ES.IsCalendarUnit(largestUnit1) || ES.IsCalendarUnit(largestUnit2)) {
|
|
425
|
+
if (!plainRelativeTo) {
|
|
426
|
+
throw new RangeError('A starting point is required for years, months, or weeks comparison');
|
|
427
|
+
}
|
|
428
|
+
d1 = ES.DateDurationDays(duration1.date, plainRelativeTo);
|
|
429
|
+
d2 = ES.DateDurationDays(duration2.date, plainRelativeTo);
|
|
430
|
+
}
|
|
431
|
+
const timeDuration1 = duration1.time.add24HourDays(d1);
|
|
432
|
+
const timeDuration2 = duration2.time.add24HourDays(d2);
|
|
433
|
+
return timeDuration1.cmp(timeDuration2);
|
|
434
|
+
}
|
|
435
|
+
[Symbol.toStringTag]!: 'Temporal.Duration';
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
MakeIntrinsicClass(Duration, 'Temporal.Duration');
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Ambient declaration file to bridge the gap until Intl.DurationFormat is
|
|
2
|
+
// supported in TypeScript's own type declarations. Note that it is for internal
|
|
3
|
+
// use, meaning that it describes the DurationFormat interface _without_ support
|
|
4
|
+
// for Temporal.Duration objects.
|
|
5
|
+
|
|
6
|
+
declare namespace Intl {
|
|
7
|
+
type DurationCalendarUnitStyle = 'long' | 'short' | 'narrow';
|
|
8
|
+
type DurationDigitalUnitStyle = 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
|
|
9
|
+
type DurationFractionalUnitStyle = 'long' | 'short' | 'narrow' | 'numeric';
|
|
10
|
+
type DurationDisplay = 'auto' | 'always';
|
|
11
|
+
|
|
12
|
+
interface DurationFormatOptions {
|
|
13
|
+
localeMatcher?: 'best fit' | 'basic' | undefined;
|
|
14
|
+
numberingSystem?: string | undefined;
|
|
15
|
+
style?: 'long' | 'short' | 'narrow' | 'digital' | undefined;
|
|
16
|
+
years?: DurationCalendarUnitStyle | undefined;
|
|
17
|
+
yearsDisplay?: DurationDisplay | undefined;
|
|
18
|
+
months?: DurationCalendarUnitStyle | undefined;
|
|
19
|
+
monthsDisplay?: DurationDisplay | undefined;
|
|
20
|
+
weeks?: DurationCalendarUnitStyle | undefined;
|
|
21
|
+
weeksDisplay?: DurationDisplay | undefined;
|
|
22
|
+
days?: DurationCalendarUnitStyle | undefined;
|
|
23
|
+
daysDisplay?: DurationDisplay | undefined;
|
|
24
|
+
hours?: DurationDigitalUnitStyle | undefined;
|
|
25
|
+
hoursDisplay?: DurationDisplay | undefined;
|
|
26
|
+
minutes?: DurationDigitalUnitStyle | undefined;
|
|
27
|
+
minutesDisplay?: DurationDisplay | undefined;
|
|
28
|
+
seconds?: DurationDigitalUnitStyle | undefined;
|
|
29
|
+
secondsDisplay?: DurationDisplay | undefined;
|
|
30
|
+
milliseconds?: DurationFractionalUnitStyle | undefined;
|
|
31
|
+
millisecondsDisplay?: DurationDisplay | undefined;
|
|
32
|
+
microseconds?: DurationFractionalUnitStyle | undefined;
|
|
33
|
+
microsecondsDisplay?: DurationDisplay | undefined;
|
|
34
|
+
nanoseconds?: DurationFractionalUnitStyle | undefined;
|
|
35
|
+
nanosecondsDisplay?: DurationDisplay | undefined;
|
|
36
|
+
fractionalDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface ResolvedDurationFormatOptions {
|
|
40
|
+
locale: string;
|
|
41
|
+
numberingSystem: string;
|
|
42
|
+
style: 'long' | 'short' | 'narrow' | 'digital';
|
|
43
|
+
years: DurationCalendarUnitStyle;
|
|
44
|
+
yearsDisplay: DurationDisplay;
|
|
45
|
+
months: DurationCalendarUnitStyle;
|
|
46
|
+
monthsDisplay: DurationDisplay;
|
|
47
|
+
weeks: DurationCalendarUnitStyle;
|
|
48
|
+
weeksDisplay: DurationDisplay;
|
|
49
|
+
days: DurationCalendarUnitStyle;
|
|
50
|
+
daysDisplay: DurationDisplay;
|
|
51
|
+
hours: DurationDigitalUnitStyle;
|
|
52
|
+
hoursDisplay: DurationDisplay;
|
|
53
|
+
minutes: DurationDigitalUnitStyle;
|
|
54
|
+
minutesDisplay: DurationDisplay;
|
|
55
|
+
seconds: DurationDigitalUnitStyle;
|
|
56
|
+
secondsDisplay: DurationDisplay;
|
|
57
|
+
milliseconds: DurationFractionalUnitStyle;
|
|
58
|
+
millisecondsDisplay: DurationDisplay;
|
|
59
|
+
microseconds: DurationFractionalUnitStyle;
|
|
60
|
+
microsecondsDisplay: DurationDisplay;
|
|
61
|
+
nanoseconds: DurationFractionalUnitStyle;
|
|
62
|
+
nanosecondsDisplay: DurationDisplay;
|
|
63
|
+
fractionalDigits: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface DurationLike {
|
|
67
|
+
years?: number;
|
|
68
|
+
months?: number;
|
|
69
|
+
weeks?: number;
|
|
70
|
+
days?: number;
|
|
71
|
+
hours?: number;
|
|
72
|
+
minutes?: number;
|
|
73
|
+
seconds?: number;
|
|
74
|
+
milliseconds?: number;
|
|
75
|
+
microseconds?: number;
|
|
76
|
+
nanoseconds?: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface DurationFormatPart {
|
|
80
|
+
type: string;
|
|
81
|
+
value: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
class DurationFormat {
|
|
85
|
+
constructor(locales?: LocalesArgument, options?: DurationFormatOptions);
|
|
86
|
+
|
|
87
|
+
static supportedLocalesOf(locales?: LocalesArgument, options?: DurationFormatOptions): LocalesArgument;
|
|
88
|
+
|
|
89
|
+
format(duration: DurationLike | string): string;
|
|
90
|
+
formatToParts(duration: DurationLike | string): DurationFormatPart[];
|
|
91
|
+
resolvedOptions(): ResolvedDurationFormatOptions;
|
|
92
|
+
}
|
|
93
|
+
}
|