inferred-types 0.54.3 → 0.54.5

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.
@@ -6819,18 +6819,19 @@ type PlusMinus = "+" | "-";
6819
6819
  type RepoSource = TupleToUnion<Mutable<typeof REPO_SOURCES>>;
6820
6820
  type RepoUrls = UrlsFrom<Flatten<Mutable<Values<typeof REPO_SOURCE_LOOKUP$1>>>>;
6821
6821
  /**
6822
- * **SemanticVersion**`<[TAllowPrefix]>`
6822
+ * **SemanticVersion**`<[TPrefix]>`
6823
6823
  *
6824
6824
  * Provides a type for _sematic versions_.
6825
6825
  *
6826
- * - by default it not only allows the `${major}.${minor}.${patch}` nomenclature
6827
- * but also _optionally_ allows a prefix of `v`:
6826
+ * - by default it only allows the `v${major}.${minor}.${patch}`
6827
+ * - setting `TPrefix to` `true` allows a version with or without
6828
+ * the leading "v"
6828
6829
  * - `0.10.1` - valid
6829
6830
  * - `v0.10.1` - also valid
6830
- * - `v 0.10.1` - also valid
6831
- * - this prefixing can be disabled by setting `TPrefix` to false
6831
+ * - setting to `false` eliminates any prefix
6832
+ * - if you pass in a string `TPrefix` then it will be used directly
6832
6833
  */
6833
- type SemanticVersion<TPrefix extends boolean = true> = `${[TPrefix] extends [true] ? `${"v" | ""}${OptionalSpace}` : ""}${number}.${number}.${number}`;
6834
+ type SemanticVersion<TPrefix extends boolean | string | Unset = Unset> = TPrefix extends Unset ? `v${number}.${number}.${number}` : TPrefix extends true ? `${"v" | ""}${number}.${number}.${number}` : TPrefix extends false ? `${number}.${number}.${number}` : TPrefix extends string ? `${TPrefix}${number}.${number}.${number}` : never;
6834
6835
 
6835
6836
  /**
6836
6837
  * **UpperAlphaChar**
@@ -8375,6 +8376,14 @@ type _Truncate<TStr extends readonly string[], TMaxLen extends number, TEllipsis
8375
8376
  */
8376
8377
  type Truncate$1<TContent extends string, TMaxLen extends number, TEllipsis extends boolean | string = false> = TContent extends string ? If<IsEqual<TMaxLen, number>, never, If<IsGreaterThan<StrLen<TContent>, TMaxLen>, _Truncate<Chars<TContent>, TMaxLen, Ellipsis<TEllipsis>>, TContent>> : never;
8377
8378
 
8379
+ /**
8380
+ * A string literal which is divided by the `/` character to represent
8381
+ * a Type-and-Subtype relationship.
8382
+ */
8383
+ type TypeSubtype = `${string}/${string}` & {
8384
+ brand: "type-subtype";
8385
+ };
8386
+
8378
8387
  type Process$P<T> = T extends NumberLike ? AsNumber<T> : T extends BooleanLike ? AsBoolean<T> : T;
8379
8388
  /**
8380
8389
  * **UnderlyingType**`<T>`
@@ -9962,11 +9971,12 @@ type FromSimpleToken<T extends SimpleToken> = SimpleType<T>;
9962
9971
  type _FromDefineObject<T extends Required<DefineObject>> = {
9963
9972
  [K in keyof T]: T[K] extends SimpleToken ? FromSimpleToken<T[K]> : T[K] extends ShapeCallback ? FromShapeCallback<T[K]> : never;
9964
9973
  };
9974
+ type TypeFromDefineObject<T> = T;
9965
9975
  /**
9966
9976
  * Converts a `DefineObject` definition into the type that it is
9967
9977
  * defining.
9968
9978
  */
9969
- type FromDefineObject<T extends DefineObject> = MakeKeysOptional<_FromDefineObject<Required<T>>, UnionToTuple$1<OptionalKeys<T>> extends readonly ObjectKey[] ? UnionToTuple$1<OptionalKeys<T>> : never>;
9979
+ type FromDefineObject<T extends DefineObject> = TypeFromDefineObject<MakeKeysOptional<_FromDefineObject<Required<T>>, UnionToTuple$1<OptionalKeys<T>> extends readonly ObjectKey[] ? UnionToTuple$1<OptionalKeys<T>> : never>>;
9970
9980
  /**
9971
9981
  * **FromDefn**`<T, [TElse]>`
9972
9982
  *
@@ -12050,6 +12060,21 @@ declare function ensureSurround<TPrefix extends string, TPostfix extends string>
12050
12060
  */
12051
12061
  declare function ensureTrailing<T extends string, U extends string>(content: T, ensure: U): EnsureTrailing<T, U>;
12052
12062
 
12063
+ /**
12064
+ * **getTypeSubTyp**`(str)`
12065
+ *
12066
+ * Returns a two element tuple representing the `Type` and `SubType`
12067
+ * independantly.
12068
+ *
12069
+ * - can take either a "blessed" `TypeSubtype` as input or any string
12070
+ * literal of `${string}/${string}` but in the latter case if the
12071
+ * string does not pass the isTypeSubtype() test then it will throw
12072
+ * an error (InvalidTypeSubtype).
12073
+ *
12074
+ * **Related:** `TypeSubtype`, `isTypeSubtype`
12075
+ */
12076
+ declare function getTypeSubtype<T extends TypeSubtype | `${string}/${string}`>(str: T): [RetainUntil<T, "/">, RetainAfter<T, "/">];
12077
+
12053
12078
  /**
12054
12079
  * An identity function for any type, with the goal of preserving literal type information
12055
12080
  * where ever possible.
@@ -13785,6 +13810,13 @@ declare function isTrue(value: unknown): value is true;
13785
13810
  */
13786
13811
  declare function isTruthy<V>(val: V): val is Exclude<V, FalsyValue>;
13787
13812
 
13813
+ /**
13814
+ * type guard which validates whether the `val` passed in is a valid `TypeSubtype`
13815
+ *
13816
+ * **Related:** `TypeSubtype`, `getTypeSubtype()`
13817
+ */
13818
+ declare function isTypeSubtype(val: unknown): val is TypeSubtype;
13819
+
13788
13820
  /**
13789
13821
  * **isTypeTuple**(value)
13790
13822
  *
@@ -14599,4 +14631,4 @@ declare function isYouTubeVideosInPlaylist<T>(val: T): val is T & YouTubeVideosI
14599
14631
  */
14600
14632
  declare function asVueRef<T extends Narrowable>(value: T): VueRef<T>;
14601
14633
 
14602
- export { type AsClassSelector, type AsList, type BoxValue, type BoxedFnParams, type CssKeyframeCallback, type CssSelectorOptions, type CsvFormat, type EndingWithTypeGuard, type EqualTo, type Finder, type FnParam, type FnParams, type GenParam, type GenParams, type GetEachOptions, type GetInference, type GetOptions, type Joiner, type KeyframeApi, type Rtn, ShapeApiImplementation, type SingletonClosure, type StartingWithTypeGuard, type StripSurroundConfigured, type SurroundWith, type TokenContainerClosure, type TokenFunctionClosure, type TokenSetClosure, type TypeOfTypeGuard, type Unbox, type UndefinedArrayIsUnknown, type UnionClosure, type UrlMeta, type YouTubeMeta, addFnToProps, addPropsToFn, and, asApi, asArray, asChars, asDate, asEscapeFunction, asIsoDate, asOptionalParamFunction, asPhoneFormat, asRecord, asString, asStringLiteral, asType, asTypeToken, asVueRef, box, boxDictionaryValues, capitalize, choices, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createFnWithPropsExplicit, createLifoQueue, createTypeToken, cssColor, csv, defineCss, defineObj, defineObject, defineTuple, endsWith, ensureLeading, ensureSurround, ensureTrailing, entries, errCondition, filter, find, fnMeta, fromDefineObject, get, getDaysBetween, getEach, getPhoneCountryCode, getTailwindModifiers, getToday, getTokenKind, getTomorrow, getUrlPath, getUrlPort, getUrlProtocol, getUrlQueryParams, getUrlSource, getWeekNumber, getYesterday, getYouTubePageType, handleDoneFn, hasDefaultValue, hasIndexOf, hasKeys, hasUrlPort, hasUrlQueryParameter, hasWhiteSpace, idLiteral, idTypeGuard, identity, ifArray, ifArrayPartial, ifBoolean, ifChar, ifContainer, ifDefined, ifFalse, ifFunction, ifHasKey, ifLength, ifLowercaseChar, ifNotNull, ifNull, ifNumber, ifObject, ifSameType, ifScalar, ifString, ifTrue, ifUndefined, ifUppercaseChar, indexOf, infer, intersect, intersection, ip6GroupExpansion, ip6Prefix, isAccelerationMetric, isAccelerationUom, isAlpha, isAmazonUrl, isApi, isApiSurface, isAppleUrl, isAreaMetric, isAreaUom, isArray, isArrayToken, isAtomicKind, isAtomicToken, isAustralianNewsUrl, isBelgiumNewsUrl, isBestBuyUrl, isBitbucketUrl, isBoolean, isBooleanLike, isBox, isCanadianNewsUrl, isChineseNewsUrl, isCodeCommitUrl, isConstant, isContainer, isContainerToken, isCostCoUrl, isCountryAbbrev, isCountryCode2, isCountryCode3, isCountryName, isCssAspectRatio, isCurrentMetric, isCurrentUom, isCvsUrl, isDanishNewsUrl, isDate, isDefineObject, isDefined, isDellUrl, isDistanceMetric, isDistanceUom, isDomainName, isDoneFn, isDutchNewsUrl, isEbayUrl, isEmail, isEnergyMetric, isEnergyUom, isEqual, isErrorCondition, isEscapeFunction, isEtsyUrl, isFalse, isFalsy, isFnBasedKind, isFnBasedToken, isFnWithParams, isFrenchNewsUrl, isFrequencyMetric, isFrequencyUom, isFunction, isGermanNewsUrl, isGithubIssueUrl, isGithubIssuesListUrl, isGithubOrgUrl, isGithubProjectUrl, isGithubProjectsListUrl, isGithubReleaseTagUrl, isGithubReleasesListUrl, isGithubRepoReleaseTagUrl, isGithubRepoReleasesUrl, isGithubRepoUrl, isGithubUrl, isHexadecimal, isHmUrl, isHomeDepotUrl, isHtmlElement, isIkeaUrl, isIndexable, isIndianNewsUrl, isInlineSvg, isIp4Address, isIp6Address, isIpAddress, isIso3166Alpha2, isIso3166Alpha3, isIso3166CountryCode, isIso3166CountryName, isIsoDate, isIsoDateTime, isIsoExplicitDate, isIsoExplicitTime, isIsoImplicitDate, isIsoImplicitTime, isIsoTime, isIsoYear, isItalianNewsUrl, isJapaneseNewsUrl, isKrogersUrl, isLeapYear, isLength, isLikeRegExp, isLowesUrl, isLuminosityMetric, isLuminosityUom, isLuxonDateTime, isMacysUrl, isMapToken, isMassMetric, isMassUom, isMetric, isMexicanNewsUrl, isMoment, isNever, isNewsUrl, isNikeUrl, isNorwegianNewsUrl, isNotNull, isNothing, isNull, isNumber, isNumberLike, isNumericArray, isNumericString, isObject, isObjectToken, isOptionalParamFunction, isPhoneNumber, isPowerMetric, isPowerUom, isPressureMetric, isPressureUom, isReadonlyArray, isRecordToken, isRef, isRegExp, isRepoSource, isRepoUrl, isResistance, isResistanceUom, isRetailUrl, isSameTypeOf, isScalar, isSemanticVersion, isSet, isSetBasedKind, isSetBasedToken, isSetToken, isShape, isShapeCallback, isSimpleContainerToken, isSimpleContainerTokenTuple, isSimpleScalarToken, isSimpleScalarTokenTuple, isSimpleToken, isSimpleTokenTuple, isSingletonKind, isSingletonToken, isSocialMediaProfileUrl, isSocialMediaUrl, isSouthKoreanNewsUrl, isSpanishNewsUrl, isSpecificConstant, isSpeedMetric, isSpeedUom, isString, isStringArray, isSwissNewsUrl, isSymbol, isTailwindColor, isTailwindColorClass, isTailwindColorName, isTailwindColorTarget, isTailwindColorWithLuminosity, isTailwindColorWithLuminosityAndOpacity, isTailwindModifier, isTargetUrl, isTemperatureMetric, isTemperatureUom, isThenable, isThisMonth, isThisWeek, isThisYear, isTimeMetric, isTimeUom, isToday, isTomorrow, isTrimable, isTrue, isTruthy, isTuple, isTupleToken, isTurkishNewsUrl, isTypeOf, isTypeToken, isTypeTokenKind, isTypeTuple, isUkNewsUrl, isUndefined, isUnset, isUom, isUri, isUrl, isUrlPath, isUrlSource, isUsNewsUrl, isUsStateAbbreviation, isUsStateName, isVoltageMetric, isVoltageUom, isVolumeMetric, isVolumeUom, isWalgreensUrl, isWalmartUrl, isWayfairUrl, isWholeFoodsUrl, isYesterday, isYouTubeCreatorUrl, isYouTubeFeedHistoryUrl, isYouTubeFeedUrl, isYouTubePlaylistUrl, isYouTubePlaylistsUrl, isYouTubeShareUrl, isYouTubeSubscriptionsUrl, isYouTubeTrendingUrl, isYouTubeUrl, isYouTubeVideoUrl, isYouTubeVideosInPlaylist, isZaraUrl, isZipCode, isZipCode5, isZipPlus4, joinWith, jsonValue, jsonValues, keysOf, kindLiteral, last, list, literal, logicalReturns, lookupCountryAlpha2, lookupCountryAlpha3, lookupCountryCode, lookupCountryName, lowercase, mergeObjects, mergeScalars, mergeTuples, nameLiteral, narrow, never, omit, optional, optionalOrNull, or, orNull, pathJoin, pluralize, removePhoneCountryCode, removeTailwindModifiers, removeUrlProtocol, result, retain, retainAfter, retainAfterInclusive, retainChars, retainUntil, retainUntilInclusive, retainWhile, reverse, rightWhitespace, shape, sharedKeys, shift, simpleContainerToken, simpleContainerTokenToTypeToken, simpleContainerType, simpleScalarToken, simpleScalarTokenToTypeToken, simpleScalarType, simpleToken, simpleType, simpleUnionTokenToTypeToken, slice, split, startsWith, stripAfter, stripBefore, stripChars, stripLeading, stripParenthesis, stripSurround, stripTrailing, stripUntil, stripWhile, surround, takeNumericCharacters, takeProp, toCamelCase, toKebabCase, toNumber, toNumericArray, toPascalCase, toSnakeCase, toString, toUppercase, trim, trimEnd, trimLeft, trimRight, trimStart, truncate, tuple, twColor, unbox, uncapitalize, union, unionize, unique, uniqueKeys, unset, uppercase, urlMeta, valuesOf, widen, withDefaults, withKeys, withoutKeys, withoutValue, wrapFn, youtubeEmbed, youtubeMeta };
14634
+ export { type AsClassSelector, type AsList, type BoxValue, type BoxedFnParams, type CssKeyframeCallback, type CssSelectorOptions, type CsvFormat, type EndingWithTypeGuard, type EqualTo, type Finder, type FnParam, type FnParams, type GenParam, type GenParams, type GetEachOptions, type GetInference, type GetOptions, type Joiner, type KeyframeApi, type Rtn, ShapeApiImplementation, type SingletonClosure, type StartingWithTypeGuard, type StripSurroundConfigured, type SurroundWith, type TokenContainerClosure, type TokenFunctionClosure, type TokenSetClosure, type TypeOfTypeGuard, type Unbox, type UndefinedArrayIsUnknown, type UnionClosure, type UrlMeta, type YouTubeMeta, addFnToProps, addPropsToFn, and, asApi, asArray, asChars, asDate, asEscapeFunction, asIsoDate, asOptionalParamFunction, asPhoneFormat, asRecord, asString, asStringLiteral, asType, asTypeToken, asVueRef, box, boxDictionaryValues, capitalize, choices, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createFnWithPropsExplicit, createLifoQueue, createTypeToken, cssColor, csv, defineCss, defineObj, defineObject, defineTuple, endsWith, ensureLeading, ensureSurround, ensureTrailing, entries, errCondition, filter, find, fnMeta, fromDefineObject, get, getDaysBetween, getEach, getPhoneCountryCode, getTailwindModifiers, getToday, getTokenKind, getTomorrow, getTypeSubtype, getUrlPath, getUrlPort, getUrlProtocol, getUrlQueryParams, getUrlSource, getWeekNumber, getYesterday, getYouTubePageType, handleDoneFn, hasDefaultValue, hasIndexOf, hasKeys, hasUrlPort, hasUrlQueryParameter, hasWhiteSpace, idLiteral, idTypeGuard, identity, ifArray, ifArrayPartial, ifBoolean, ifChar, ifContainer, ifDefined, ifFalse, ifFunction, ifHasKey, ifLength, ifLowercaseChar, ifNotNull, ifNull, ifNumber, ifObject, ifSameType, ifScalar, ifString, ifTrue, ifUndefined, ifUppercaseChar, indexOf, infer, intersect, intersection, ip6GroupExpansion, ip6Prefix, isAccelerationMetric, isAccelerationUom, isAlpha, isAmazonUrl, isApi, isApiSurface, isAppleUrl, isAreaMetric, isAreaUom, isArray, isArrayToken, isAtomicKind, isAtomicToken, isAustralianNewsUrl, isBelgiumNewsUrl, isBestBuyUrl, isBitbucketUrl, isBoolean, isBooleanLike, isBox, isCanadianNewsUrl, isChineseNewsUrl, isCodeCommitUrl, isConstant, isContainer, isContainerToken, isCostCoUrl, isCountryAbbrev, isCountryCode2, isCountryCode3, isCountryName, isCssAspectRatio, isCurrentMetric, isCurrentUom, isCvsUrl, isDanishNewsUrl, isDate, isDefineObject, isDefined, isDellUrl, isDistanceMetric, isDistanceUom, isDomainName, isDoneFn, isDutchNewsUrl, isEbayUrl, isEmail, isEnergyMetric, isEnergyUom, isEqual, isErrorCondition, isEscapeFunction, isEtsyUrl, isFalse, isFalsy, isFnBasedKind, isFnBasedToken, isFnWithParams, isFrenchNewsUrl, isFrequencyMetric, isFrequencyUom, isFunction, isGermanNewsUrl, isGithubIssueUrl, isGithubIssuesListUrl, isGithubOrgUrl, isGithubProjectUrl, isGithubProjectsListUrl, isGithubReleaseTagUrl, isGithubReleasesListUrl, isGithubRepoReleaseTagUrl, isGithubRepoReleasesUrl, isGithubRepoUrl, isGithubUrl, isHexadecimal, isHmUrl, isHomeDepotUrl, isHtmlElement, isIkeaUrl, isIndexable, isIndianNewsUrl, isInlineSvg, isIp4Address, isIp6Address, isIpAddress, isIso3166Alpha2, isIso3166Alpha3, isIso3166CountryCode, isIso3166CountryName, isIsoDate, isIsoDateTime, isIsoExplicitDate, isIsoExplicitTime, isIsoImplicitDate, isIsoImplicitTime, isIsoTime, isIsoYear, isItalianNewsUrl, isJapaneseNewsUrl, isKrogersUrl, isLeapYear, isLength, isLikeRegExp, isLowesUrl, isLuminosityMetric, isLuminosityUom, isLuxonDateTime, isMacysUrl, isMapToken, isMassMetric, isMassUom, isMetric, isMexicanNewsUrl, isMoment, isNever, isNewsUrl, isNikeUrl, isNorwegianNewsUrl, isNotNull, isNothing, isNull, isNumber, isNumberLike, isNumericArray, isNumericString, isObject, isObjectToken, isOptionalParamFunction, isPhoneNumber, isPowerMetric, isPowerUom, isPressureMetric, isPressureUom, isReadonlyArray, isRecordToken, isRef, isRegExp, isRepoSource, isRepoUrl, isResistance, isResistanceUom, isRetailUrl, isSameTypeOf, isScalar, isSemanticVersion, isSet, isSetBasedKind, isSetBasedToken, isSetToken, isShape, isShapeCallback, isSimpleContainerToken, isSimpleContainerTokenTuple, isSimpleScalarToken, isSimpleScalarTokenTuple, isSimpleToken, isSimpleTokenTuple, isSingletonKind, isSingletonToken, isSocialMediaProfileUrl, isSocialMediaUrl, isSouthKoreanNewsUrl, isSpanishNewsUrl, isSpecificConstant, isSpeedMetric, isSpeedUom, isString, isStringArray, isSwissNewsUrl, isSymbol, isTailwindColor, isTailwindColorClass, isTailwindColorName, isTailwindColorTarget, isTailwindColorWithLuminosity, isTailwindColorWithLuminosityAndOpacity, isTailwindModifier, isTargetUrl, isTemperatureMetric, isTemperatureUom, isThenable, isThisMonth, isThisWeek, isThisYear, isTimeMetric, isTimeUom, isToday, isTomorrow, isTrimable, isTrue, isTruthy, isTuple, isTupleToken, isTurkishNewsUrl, isTypeOf, isTypeSubtype, isTypeToken, isTypeTokenKind, isTypeTuple, isUkNewsUrl, isUndefined, isUnset, isUom, isUri, isUrl, isUrlPath, isUrlSource, isUsNewsUrl, isUsStateAbbreviation, isUsStateName, isVoltageMetric, isVoltageUom, isVolumeMetric, isVolumeUom, isWalgreensUrl, isWalmartUrl, isWayfairUrl, isWholeFoodsUrl, isYesterday, isYouTubeCreatorUrl, isYouTubeFeedHistoryUrl, isYouTubeFeedUrl, isYouTubePlaylistUrl, isYouTubePlaylistsUrl, isYouTubeShareUrl, isYouTubeSubscriptionsUrl, isYouTubeTrendingUrl, isYouTubeUrl, isYouTubeVideoUrl, isYouTubeVideosInPlaylist, isZaraUrl, isZipCode, isZipCode5, isZipPlus4, joinWith, jsonValue, jsonValues, keysOf, kindLiteral, last, list, literal, logicalReturns, lookupCountryAlpha2, lookupCountryAlpha3, lookupCountryCode, lookupCountryName, lowercase, mergeObjects, mergeScalars, mergeTuples, nameLiteral, narrow, never, omit, optional, optionalOrNull, or, orNull, pathJoin, pluralize, removePhoneCountryCode, removeTailwindModifiers, removeUrlProtocol, result, retain, retainAfter, retainAfterInclusive, retainChars, retainUntil, retainUntilInclusive, retainWhile, reverse, rightWhitespace, shape, sharedKeys, shift, simpleContainerToken, simpleContainerTokenToTypeToken, simpleContainerType, simpleScalarToken, simpleScalarTokenToTypeToken, simpleScalarType, simpleToken, simpleType, simpleUnionTokenToTypeToken, slice, split, startsWith, stripAfter, stripBefore, stripChars, stripLeading, stripParenthesis, stripSurround, stripTrailing, stripUntil, stripWhile, surround, takeNumericCharacters, takeProp, toCamelCase, toKebabCase, toNumber, toNumericArray, toPascalCase, toSnakeCase, toString, toUppercase, trim, trimEnd, trimLeft, trimRight, trimStart, truncate, tuple, twColor, unbox, uncapitalize, union, unionize, unique, uniqueKeys, unset, uppercase, urlMeta, valuesOf, widen, withDefaults, withKeys, withoutKeys, withoutValue, wrapFn, youtubeEmbed, youtubeMeta };