inferred-types 0.51.1 → 0.51.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs +28 -9
- package/dist/index.js +28 -9
- package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/errors/KindError.d.ts +10 -7
- package/dist/runtime/errors/KindError.d.ts.map +1 -1
- package/dist/runtime/errors/KindError.js +40 -14
- package/dist/runtime/errors/index.d.ts +1 -1
- package/dist/runtime/errors/index.d.ts.map +1 -1
- package/dist/runtime/errors/index.js +1 -1
- package/dist/runtime/tsconfig.tsbuildinfo +1 -1
- package/dist/types/dictionary/CombinedKeys.d.ts.map +1 -1
- package/dist/types/errors/KindError.d.ts +11 -6
- package/dist/types/errors/KindError.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/type-conversion/MergeObjects.d.ts +3 -3
- package/dist/types/type-conversion/MergeObjects.d.ts.map +1 -1
- package/package.json +22 -19
- package/dist/runtime/errors/kindedError.d.ts +0 -27
- package/dist/runtime/errors/kindedError.d.ts.map +0 -1
- package/dist/runtime/errors/kindedError.js +0 -33
- package/src/constants/Alpha.ts +0 -21
- package/src/constants/Books.ts +0 -9
- package/src/constants/Characters.ts +0 -6
- package/src/constants/Comma.ts +0 -18
- package/src/constants/CommonObjProps.ts +0 -7
- package/src/constants/Consonants.ts +0 -25
- package/src/constants/Constant.ts +0 -11
- package/src/constants/DateTime.ts +0 -40
- package/src/constants/FalsyValues.ts +0 -9
- package/src/constants/Functional.ts +0 -20
- package/src/constants/Geo.ts +0 -99
- package/src/constants/HashTable.ts +0 -131
- package/src/constants/ISO3166.ts +0 -147
- package/src/constants/Images.ts +0 -22
- package/src/constants/Marked.ts +0 -11
- package/src/constants/Markers.ts +0 -23
- package/src/constants/Metrics.ts +0 -171
- package/src/constants/NetworkConstants.ts +0 -91
- package/src/constants/Never.ts +0 -11
- package/src/constants/News.ts +0 -441
- package/src/constants/NoDefaultValue.ts +0 -13
- package/src/constants/NotApplicable.ts +0 -11
- package/src/constants/NotDefined.ts +0 -10
- package/src/constants/NumericChar.ts +0 -14
- package/src/constants/NumericDigit.ts +0 -11
- package/src/constants/Phone.ts +0 -263
- package/src/constants/PluralExceptions.ts +0 -113
- package/src/constants/ProxmoxConstants.ts +0 -6
- package/src/constants/RepoConstants.ts +0 -56
- package/src/constants/Retail.ts +0 -113
- package/src/constants/Shape.ts +0 -16
- package/src/constants/SingularNounEnding.ts +0 -15
- package/src/constants/Social.ts +0 -131
- package/src/constants/Tailwind.ts +0 -92
- package/src/constants/TypeComparisons.ts +0 -63
- package/src/constants/TypeOf.ts +0 -6
- package/src/constants/TypeTokens.ts +0 -291
- package/src/constants/TypeTransforms.ts +0 -47
- package/src/constants/Types.ts +0 -32
- package/src/constants/Wide.ts +0 -36
- package/src/constants/createConstant.ts +0 -13
- package/src/constants/index.ts +0 -41
- package/src/constants/tsconfig.json +0 -21
- package/src/inferred-types/README.md +0 -3
- package/src/inferred-types/index.ts +0 -3
- package/src/inferred-types/tsconfig.json +0 -49
- package/src/runtime/README.md +0 -3
- package/src/runtime/api/defineApi.ts +0 -153
- package/src/runtime/api/handleDoneFn.ts +0 -31
- package/src/runtime/api/index.ts +0 -3
- package/src/runtime/boolean-logic/ifArray.ts +0 -22
- package/src/runtime/boolean-logic/ifArrayPartial.ts +0 -13
- package/src/runtime/boolean-logic/ifBoolean.ts +0 -30
- package/src/runtime/boolean-logic/ifChar.ts +0 -23
- package/src/runtime/boolean-logic/ifContainer.ts +0 -20
- package/src/runtime/boolean-logic/ifFalse.ts +0 -26
- package/src/runtime/boolean-logic/ifFunction.ts +0 -31
- package/src/runtime/boolean-logic/ifHasKey.ts +0 -27
- package/src/runtime/boolean-logic/ifLength.ts +0 -39
- package/src/runtime/boolean-logic/ifNotNull.ts +0 -30
- package/src/runtime/boolean-logic/ifNull.ts +0 -31
- package/src/runtime/boolean-logic/ifNumber.ts +0 -30
- package/src/runtime/boolean-logic/ifObject.ts +0 -15
- package/src/runtime/boolean-logic/ifSameType.ts +0 -29
- package/src/runtime/boolean-logic/ifScalar.ts +0 -42
- package/src/runtime/boolean-logic/ifString.ts +0 -37
- package/src/runtime/boolean-logic/ifTrue.ts +0 -33
- package/src/runtime/boolean-logic/ifUndefined.ts +0 -39
- package/src/runtime/boolean-logic/index.ts +0 -19
- package/src/runtime/combinators/and.ts +0 -11
- package/src/runtime/combinators/f2.ts.HOLD +0 -241
- package/src/runtime/combinators/index.ts +0 -2
- package/src/runtime/combinators/or.ts +0 -13
- package/src/runtime/dictionary/defineOptions.ts +0 -82
- package/src/runtime/dictionary/entries.ts +0 -34
- package/src/runtime/dictionary/get.ts +0 -168
- package/src/runtime/dictionary/index.ts +0 -23
- package/src/runtime/dictionary/keysOf.ts +0 -28
- package/src/runtime/dictionary/omit.ts +0 -40
- package/src/runtime/dictionary/retain.ts +0 -35
- package/src/runtime/dictionary/sharedKeys.ts +0 -16
- package/src/runtime/dictionary/takeProp.ts +0 -28
- package/src/runtime/dictionary/valuesOf.ts +0 -21
- package/src/runtime/dictionary/withDefaults.ts +0 -27
- package/src/runtime/dictionary/withKeys.ts +0 -22
- package/src/runtime/dictionary/withoutKeys.ts +0 -23
- package/src/runtime/dictionary/withoutValue.ts +0 -26
- package/src/runtime/errors/KindError.ts +0 -59
- package/src/runtime/errors/TypedError.ts +0 -69
- package/src/runtime/errors/createErrorCondition.ts +0 -35
- package/src/runtime/errors/index.ts +0 -2
- package/src/runtime/errors/kindedError.ts +0 -59
- package/src/runtime/functional/index.ts +0 -1
- package/src/runtime/functional/result.ts +0 -309
- package/src/runtime/functions/fnMeta.ts +0 -27
- package/src/runtime/functions/index.ts +0 -3
- package/src/runtime/functions/wrapFn.ts +0 -32
- package/src/runtime/index.ts +0 -18
- package/src/runtime/initializers/addFnToProps.ts +0 -35
- package/src/runtime/initializers/addPropsToFn.ts +0 -42
- package/src/runtime/initializers/createCssSelector.ts +0 -78
- package/src/runtime/initializers/createFnWithProps.ts +0 -40
- package/src/runtime/initializers/defineObj.ts +0 -55
- package/src/runtime/initializers/defineTuple.ts +0 -28
- package/src/runtime/initializers/index.ts +0 -6
- package/src/runtime/lists/asArray.ts +0 -29
- package/src/runtime/lists/createComparison.ts +0 -15
- package/src/runtime/lists/createConverter.ts +0 -104
- package/src/runtime/lists/filter.ts +0 -62
- package/src/runtime/lists/find.ts +0 -51
- package/src/runtime/lists/getEach.ts +0 -48
- package/src/runtime/lists/index.ts +0 -26
- package/src/runtime/lists/indexOf.ts +0 -58
- package/src/runtime/lists/intersection.ts +0 -69
- package/src/runtime/lists/join.ts +0 -34
- package/src/runtime/lists/last.ts +0 -5
- package/src/runtime/lists/logicalReturns.ts +0 -18
- package/src/runtime/lists/reverse.ts +0 -10
- package/src/runtime/lists/shift.ts +0 -66
- package/src/runtime/lists/slice.ts +0 -16
- package/src/runtime/lists/unique.ts +0 -26
- package/src/runtime/literals/box.ts +0 -75
- package/src/runtime/literals/capitalize.ts +0 -9
- package/src/runtime/literals/color/cssColor.ts +0 -31
- package/src/runtime/literals/color/index.ts +0 -2
- package/src/runtime/literals/color/twColor.ts +0 -40
- package/src/runtime/literals/ensureLeading.ts +0 -27
- package/src/runtime/literals/ensureSurround.ts +0 -32
- package/src/runtime/literals/ensureTrailing.ts +0 -20
- package/src/runtime/literals/identity.ts +0 -22
- package/src/runtime/literals/ifLowercase.ts +0 -57
- package/src/runtime/literals/ifUppercase.ts +0 -34
- package/src/runtime/literals/index.ts +0 -58
- package/src/runtime/literals/literal.ts +0 -48
- package/src/runtime/literals/lowercase.ts +0 -11
- package/src/runtime/literals/narrow.ts +0 -44
- package/src/runtime/literals/pathJoin.ts +0 -25
- package/src/runtime/literals/phone/asPhoneNumber.ts +0 -72
- package/src/runtime/literals/phone/getPhoneCountryCode.ts +0 -16
- package/src/runtime/literals/phone/index.ts +0 -3
- package/src/runtime/literals/phone/removePhoneCountryCode.ts +0 -16
- package/src/runtime/literals/pluralize.ts +0 -74
- package/src/runtime/literals/retainAfter.ts +0 -71
- package/src/runtime/literals/retainChars.ts +0 -30
- package/src/runtime/literals/retainUntil.ts +0 -67
- package/src/runtime/literals/retainWhile.ts +0 -23
- package/src/runtime/literals/rightWhitespace.ts +0 -17
- package/src/runtime/literals/split.ts +0 -19
- package/src/runtime/literals/stripAfter.ts +0 -20
- package/src/runtime/literals/stripBefore.ts +0 -23
- package/src/runtime/literals/stripChars.ts +0 -25
- package/src/runtime/literals/stripLeading.ts +0 -28
- package/src/runtime/literals/stripSurround.ts +0 -54
- package/src/runtime/literals/stripTrailing.ts +0 -29
- package/src/runtime/literals/stripUntil.ts +0 -18
- package/src/runtime/literals/stripWhile.ts +0 -19
- package/src/runtime/literals/surround.ts +0 -23
- package/src/runtime/literals/takeNumericCharacters.ts +0 -16
- package/src/runtime/literals/toCamelCase.ts +0 -28
- package/src/runtime/literals/toKebabCase.ts +0 -31
- package/src/runtime/literals/toLowercase.ts +0 -13
- package/src/runtime/literals/toNumericArray.ts +0 -5
- package/src/runtime/literals/toPascalCase.ts +0 -38
- package/src/runtime/literals/toSnakeCase.ts +0 -33
- package/src/runtime/literals/toString.ts +0 -11
- package/src/runtime/literals/toUppercase.ts +0 -13
- package/src/runtime/literals/trim.ts +0 -55
- package/src/runtime/literals/truncate.ts +0 -20
- package/src/runtime/literals/tuple.ts +0 -41
- package/src/runtime/literals/uncapitalize.ts +0 -9
- package/src/runtime/literals/unset.ts +0 -18
- package/src/runtime/literals/uppercase.ts +0 -9
- package/src/runtime/literals/widen.ts +0 -13
- package/src/runtime/meta/index.ts +0 -2
- package/src/runtime/meta/urlMeta.ts +0 -187
- package/src/runtime/meta/youtube-meta.ts +0 -146
- package/src/runtime/queues/fifo.ts +0 -51
- package/src/runtime/queues/index.ts +0 -2
- package/src/runtime/queues/lifo.ts +0 -45
- package/src/runtime/runtime-types/README.md +0 -3
- package/src/runtime/runtime-types/asDefineObject.ts +0 -29
- package/src/runtime/runtime-types/asToken.ts +0 -155
- package/src/runtime/runtime-types/asType.ts +0 -57
- package/src/runtime/runtime-types/choices.ts +0 -86
- package/src/runtime/runtime-types/dict.hold +0 -65
- package/src/runtime/runtime-types/index.ts +0 -9
- package/src/runtime/runtime-types/ip6Prefix.ts +0 -20
- package/src/runtime/runtime-types/list.ts +0 -141
- package/src/runtime/runtime-types/rec.ts +0 -11
- package/src/runtime/runtime-types/shape-helpers/addToken.ts +0 -11
- package/src/runtime/runtime-types/shape-helpers/atomics.ts +0 -21
- package/src/runtime/runtime-types/shape-helpers/functions.ts +0 -36
- package/src/runtime/runtime-types/shape-helpers/getTokenData.ts +0 -14
- package/src/runtime/runtime-types/shape-helpers/getTokenName.ts +0 -13
- package/src/runtime/runtime-types/shape-helpers/literal-containers.ts +0 -18
- package/src/runtime/runtime-types/shape-helpers/regexToken.ts +0 -44
- package/src/runtime/runtime-types/shape-helpers/singletons.ts +0 -108
- package/src/runtime/runtime-types/shape-helpers/union.ts +0 -15
- package/src/runtime/runtime-types/shape-helpers/wide-containers.ts +0 -60
- package/src/runtime/runtime-types/shape.ts +0 -87
- package/src/runtime/runtime-types/tokens/createTypeToken.ts +0 -114
- package/src/runtime/runtime-types/tokens/index.ts +0 -2
- package/src/runtime/runtime-types/tokens/simpleToken.ts +0 -85
- package/src/runtime/sets/index.ts +0 -1
- package/src/runtime/sets/uniqueKeys.ts +0 -48
- package/src/runtime/tsconfig.json +0 -47
- package/src/runtime/type-conversion/asChars.ts +0 -10
- package/src/runtime/type-conversion/asRecord.ts +0 -14
- package/src/runtime/type-conversion/asString.ts +0 -35
- package/src/runtime/type-conversion/csv.ts +0 -56
- package/src/runtime/type-conversion/index.ts +0 -18
- package/src/runtime/type-conversion/intersect.ts +0 -12
- package/src/runtime/type-conversion/ip6GroupExpansion.ts +0 -17
- package/src/runtime/type-conversion/json.ts +0 -32
- package/src/runtime/type-conversion/lookupCountry.ts +0 -242
- package/src/runtime/type-conversion/mergeObjects.ts +0 -31
- package/src/runtime/type-conversion/mergeScalars.ts +0 -16
- package/src/runtime/type-conversion/mergeTuples.ts +0 -16
- package/src/runtime/type-conversion/mutable.ts +0 -5
- package/src/runtime/type-conversion/never.ts +0 -13
- package/src/runtime/type-conversion/optional.ts +0 -37
- package/src/runtime/type-conversion/toNumber.ts +0 -35
- package/src/runtime/type-conversion/union.ts +0 -15
- package/src/runtime/type-conversion/unionize.ts +0 -12
- package/src/runtime/type-guards/api-tg.ts +0 -45
- package/src/runtime/type-guards/geo/index.ts +0 -3
- package/src/runtime/type-guards/geo/isIso3166Alpha2.ts +0 -79
- package/src/runtime/type-guards/geo/isUsState.ts +0 -15
- package/src/runtime/type-guards/geo/isZipCode.ts +0 -45
- package/src/runtime/type-guards/hasDefaultValue.ts +0 -16
- package/src/runtime/type-guards/hasErrorConditions.ts +0 -8
- package/src/runtime/type-guards/hasIndexOf.ts +0 -36
- package/src/runtime/type-guards/hasKeys.ts +0 -38
- package/src/runtime/type-guards/hasWhitespace.ts +0 -13
- package/src/runtime/type-guards/higher-order/endsWith.ts +0 -23
- package/src/runtime/type-guards/higher-order/index.ts +0 -7
- package/src/runtime/type-guards/higher-order/isEqual.ts +0 -23
- package/src/runtime/type-guards/higher-order/isLength.ts +0 -36
- package/src/runtime/type-guards/higher-order/isSameTypeOf.ts +0 -15
- package/src/runtime/type-guards/higher-order/isTuple.ts +0 -31
- package/src/runtime/type-guards/higher-order/isTypeOf.ts +0 -16
- package/src/runtime/type-guards/higher-order/startsWith.ts +0 -42
- package/src/runtime/type-guards/html/index.ts +0 -1
- package/src/runtime/type-guards/html/isHtmlElement.ts +0 -11
- package/src/runtime/type-guards/index.ts +0 -57
- package/src/runtime/type-guards/isAlpha.ts +0 -13
- package/src/runtime/type-guards/isArray.ts +0 -9
- package/src/runtime/type-guards/isBoolean.ts +0 -10
- package/src/runtime/type-guards/isBooleanLike.ts +0 -17
- package/src/runtime/type-guards/isConstant.ts +0 -20
- package/src/runtime/type-guards/isContainer.ts +0 -20
- package/src/runtime/type-guards/isCssAspectRatio.ts +0 -16
- package/src/runtime/type-guards/isDefined.ts +0 -9
- package/src/runtime/type-guards/isDoneFn.ts +0 -14
- package/src/runtime/type-guards/isEmail.ts +0 -31
- package/src/runtime/type-guards/isErrorCondition.ts +0 -19
- package/src/runtime/type-guards/isFalse.ts +0 -3
- package/src/runtime/type-guards/isFalsy.ts +0 -14
- package/src/runtime/type-guards/isFnWithParams.ts +0 -11
- package/src/runtime/type-guards/isFunction.ts +0 -15
- package/src/runtime/type-guards/isHexadecimal.ts +0 -15
- package/src/runtime/type-guards/isIndexable.ts +0 -14
- package/src/runtime/type-guards/isInlineSvg.ts +0 -12
- package/src/runtime/type-guards/isLeftRight.ts +0 -16
- package/src/runtime/type-guards/isNever.ts +0 -12
- package/src/runtime/type-guards/isNotNull.ts +0 -10
- package/src/runtime/type-guards/isNothing.ts +0 -5
- package/src/runtime/type-guards/isNull.ts +0 -11
- package/src/runtime/type-guards/isNumber.ts +0 -9
- package/src/runtime/type-guards/isNumericString.ts +0 -41
- package/src/runtime/type-guards/isObject.ts +0 -13
- package/src/runtime/type-guards/isPhoneNumber.ts +0 -35
- package/src/runtime/type-guards/isReadonlyArray.ts +0 -17
- package/src/runtime/type-guards/isRef.ts +0 -15
- package/src/runtime/type-guards/isRegExp.ts +0 -37
- package/src/runtime/type-guards/isRuntimeUnion.ts +0 -12
- package/src/runtime/type-guards/isScalar.ts +0 -17
- package/src/runtime/type-guards/isSpecificConstant.ts +0 -17
- package/src/runtime/type-guards/isString.ts +0 -13
- package/src/runtime/type-guards/isSymbol.ts +0 -12
- package/src/runtime/type-guards/isThenable.ts +0 -8
- package/src/runtime/type-guards/isTrimmable.ts +0 -10
- package/src/runtime/type-guards/isTrue.ts +0 -8
- package/src/runtime/type-guards/isTruthy.ts +0 -15
- package/src/runtime/type-guards/isTypeToken.ts +0 -20
- package/src/runtime/type-guards/isTypeTuple.ts +0 -10
- package/src/runtime/type-guards/isUndefined.ts +0 -10
- package/src/runtime/type-guards/isUnset.ts +0 -26
- package/src/runtime/type-guards/isUrl.ts +0 -55
- package/src/runtime/type-guards/metrics/index.ts +0 -2
- package/src/runtime/type-guards/metrics/isMetric.ts +0 -133
- package/src/runtime/type-guards/metrics/isUom.ts +0 -125
- package/src/runtime/type-guards/network-tg.ts +0 -123
- package/src/runtime/type-guards/tokens/index.ts +0 -8
- package/src/runtime/type-guards/tokens/isAtomicToken.ts +0 -16
- package/src/runtime/type-guards/tokens/isContainerToken.ts +0 -64
- package/src/runtime/type-guards/tokens/isDefineObject.ts +0 -16
- package/src/runtime/type-guards/tokens/isFunctionToken.ts +0 -11
- package/src/runtime/type-guards/tokens/isShapeCallback.ts +0 -9
- package/src/runtime/type-guards/tokens/isShapeToken.ts +0 -33
- package/src/runtime/type-guards/tokens/isSimpleToken.ts +0 -100
- package/src/runtime/type-guards/tokens/isSingletonToken.ts +0 -17
- package/src/runtime/type-guards/tokens/isTupleToken.ts +0 -0
- package/src/runtime/type-guards/tokens/isUnionSetToken.ts +0 -0
- package/src/runtime/type-guards/tokens/isUnionToken.ts +0 -16
- package/src/runtime/type-guards/urls/Social.ts +0 -25
- package/src/runtime/type-guards/urls/books.ts +0 -2
- package/src/runtime/type-guards/urls/index.ts +0 -9
- package/src/runtime/type-guards/urls/news/australian.ts +0 -14
- package/src/runtime/type-guards/urls/news/belgium.ts +0 -14
- package/src/runtime/type-guards/urls/news/canadian.ts +0 -14
- package/src/runtime/type-guards/urls/news/chinese.ts +0 -14
- package/src/runtime/type-guards/urls/news/danish.ts +0 -14
- package/src/runtime/type-guards/urls/news/dutch.ts +0 -15
- package/src/runtime/type-guards/urls/news/french.ts +0 -14
- package/src/runtime/type-guards/urls/news/german.ts +0 -14
- package/src/runtime/type-guards/urls/news/index.ts +0 -51
- package/src/runtime/type-guards/urls/news/indian.ts +0 -14
- package/src/runtime/type-guards/urls/news/italian.ts +0 -14
- package/src/runtime/type-guards/urls/news/japanese.ts +0 -14
- package/src/runtime/type-guards/urls/news/mexican.ts +0 -14
- package/src/runtime/type-guards/urls/news/norwegian.ts +0 -14
- package/src/runtime/type-guards/urls/news/south-korean.ts +0 -14
- package/src/runtime/type-guards/urls/news/spanish.ts +0 -14
- package/src/runtime/type-guards/urls/news/swiss.ts +0 -14
- package/src/runtime/type-guards/urls/news/turkish.ts +0 -14
- package/src/runtime/type-guards/urls/news/uk.ts +0 -14
- package/src/runtime/type-guards/urls/news/us.ts +0 -14
- package/src/runtime/type-guards/urls/repos/bitbucket.ts +0 -18
- package/src/runtime/type-guards/urls/repos/codeCommit.ts +0 -19
- package/src/runtime/type-guards/urls/repos/github.ts +0 -198
- package/src/runtime/type-guards/urls/repos/index.ts +0 -19
- package/src/runtime/type-guards/urls/repos/isSemanticVersion.ts +0 -46
- package/src/runtime/type-guards/urls/retail.ts +0 -221
- package/src/runtime/type-guards/urls/youtube.ts +0 -172
- package/src/runtime/vuejs/asVueRef.ts +0 -18
- package/src/runtime/vuejs/index.ts +0 -1
- package/src/types/README.md +0 -3
- package/src/types/api/api.ts +0 -368
- package/src/types/api/index.ts +0 -1
- package/src/types/base-types/AnyArray.ts +0 -6
- package/src/types/base-types/AnyObject.ts +0 -12
- package/src/types/base-types/Container.ts +0 -19
- package/src/types/base-types/Defined.ts +0 -8
- package/src/types/base-types/Dictionary.ts +0 -14
- package/src/types/base-types/Digital.ts +0 -27
- package/src/types/base-types/EmptyObject.ts +0 -14
- package/src/types/base-types/FalsyValue.ts +0 -8
- package/src/types/base-types/Indexable.ts +0 -10
- package/src/types/base-types/IndexableObject.ts +0 -36
- package/src/types/base-types/LikeRegExp.ts +0 -10
- package/src/types/base-types/List.ts +0 -386
- package/src/types/base-types/NarrowObject.ts +0 -11
- package/src/types/base-types/NonArray.ts +0 -10
- package/src/types/base-types/NotNull.ts +0 -8
- package/src/types/base-types/Nothing.ts +0 -7
- package/src/types/base-types/NumericSign.ts +0 -6
- package/src/types/base-types/ObjectKey.ts +0 -8
- package/src/types/base-types/Scalar.ts +0 -7
- package/src/types/base-types/ScalarNotSymbol.ts +0 -7
- package/src/types/base-types/Something.ts +0 -10
- package/src/types/base-types/Thenable.ts +0 -12
- package/src/types/base-types/Tuple.ts +0 -42
- package/src/types/base-types/fns/AnyFunction.ts +0 -10
- package/src/types/base-types/fns/EscapeFunction.ts +0 -25
- package/src/types/base-types/fns/FnAllowingProps.ts +0 -14
- package/src/types/base-types/fns/IdentityFunction.ts +0 -5
- package/src/types/base-types/fns/JustFunction.ts +0 -11
- package/src/types/base-types/fns/OptionalParamFn.ts +0 -42
- package/src/types/base-types/fns/RegularFn.ts +0 -11
- package/src/types/base-types/fns/TypedFunction.ts +0 -10
- package/src/types/base-types/fns/index.ts +0 -9
- package/src/types/base-types/functional/LeftRight.ts +0 -251
- package/src/types/base-types/functional/index.ts +0 -1
- package/src/types/base-types/index.ts +0 -27
- package/src/types/boolean-logic/LogicalCombinator.ts +0 -4
- package/src/types/boolean-logic/branching/Default.ts +0 -18
- package/src/types/boolean-logic/branching/Fail.ts +0 -38
- package/src/types/boolean-logic/branching/Handle.ts +0 -52
- package/src/types/boolean-logic/branching/If.ts +0 -45
- package/src/types/boolean-logic/branching/IfAllExtend.ts +0 -17
- package/src/types/boolean-logic/branching/IfAllLiteral.ts +0 -13
- package/src/types/boolean-logic/branching/IfEqual.ts +0 -31
- package/src/types/boolean-logic/branching/IfErrorCondition.ts +0 -20
- package/src/types/boolean-logic/branching/IfLength.ts +0 -34
- package/src/types/boolean-logic/branching/IfNever.ts +0 -13
- package/src/types/boolean-logic/branching/IfUnset.ts +0 -32
- package/src/types/boolean-logic/branching/Iff.ts +0 -55
- package/src/types/boolean-logic/branching/OnPass.ts +0 -113
- package/src/types/boolean-logic/branching/Passthrough.ts +0 -26
- package/src/types/boolean-logic/branching/README.md +0 -3
- package/src/types/boolean-logic/branching/WhenNever.ts +0 -17
- package/src/types/boolean-logic/branching/index.ts +0 -15
- package/src/types/boolean-logic/combinators/And.ts +0 -44
- package/src/types/boolean-logic/combinators/Compare.ts +0 -188
- package/src/types/boolean-logic/combinators/Not.ts +0 -68
- package/src/types/boolean-logic/combinators/Or.ts +0 -69
- package/src/types/boolean-logic/combinators/README.md +0 -3
- package/src/types/boolean-logic/combinators/Some.ts +0 -44
- package/src/types/boolean-logic/combinators/index.ts +0 -5
- package/src/types/boolean-logic/index.ts +0 -7
- package/src/types/boolean-logic/narrowing/As.ts +0 -10
- package/src/types/boolean-logic/narrowing/AsDoneFn.ts +0 -12
- package/src/types/boolean-logic/narrowing/AsIndexOf.ts +0 -24
- package/src/types/boolean-logic/narrowing/AsSomething.ts +0 -38
- package/src/types/boolean-logic/narrowing/index.ts +0 -5
- package/src/types/boolean-logic/operators/AllExtend.ts +0 -29
- package/src/types/boolean-logic/operators/AllLiteral.ts +0 -29
- package/src/types/boolean-logic/operators/AllNumericLiterals.ts +0 -14
- package/src/types/boolean-logic/operators/AllStringLiterals.ts +0 -14
- package/src/types/boolean-logic/operators/ApiOperators.ts +0 -30
- package/src/types/boolean-logic/operators/AreSameLength.ts +0 -29
- package/src/types/boolean-logic/operators/AreSameType.ts +0 -22
- package/src/types/boolean-logic/operators/Contains.ts +0 -76
- package/src/types/boolean-logic/operators/ContainsAll.ts +0 -31
- package/src/types/boolean-logic/operators/DoesExtend.ts +0 -16
- package/src/types/boolean-logic/operators/DoesNotExtend.ts +0 -14
- package/src/types/boolean-logic/operators/EndsWith.ts +0 -56
- package/src/types/boolean-logic/operators/Extends.ts +0 -14
- package/src/types/boolean-logic/operators/ExtendsAll.ts +0 -26
- package/src/types/boolean-logic/operators/ExtendsNone.ts +0 -16
- package/src/types/boolean-logic/operators/ExtendsSome.ts +0 -18
- package/src/types/boolean-logic/operators/HasArray.ts +0 -17
- package/src/types/boolean-logic/operators/HasCharacters.ts +0 -73
- package/src/types/boolean-logic/operators/HasIndex.ts +0 -18
- package/src/types/boolean-logic/operators/HasOtherCharacters.ts +0 -39
- package/src/types/boolean-logic/operators/HasParameters.ts +0 -18
- package/src/types/boolean-logic/operators/HasProp.ts +0 -20
- package/src/types/boolean-logic/operators/HasRequiredProps.ts +0 -17
- package/src/types/boolean-logic/operators/HasSameKeys.ts +0 -41
- package/src/types/boolean-logic/operators/HasSameValues.ts +0 -53
- package/src/types/boolean-logic/operators/HasUnionType.ts +0 -16
- package/src/types/boolean-logic/operators/HasWideValues.ts +0 -14
- package/src/types/boolean-logic/operators/HaveSameNumericSign.ts +0 -24
- package/src/types/boolean-logic/operators/IsAllCaps.ts +0 -23
- package/src/types/boolean-logic/operators/IsAllLowercase.ts +0 -22
- package/src/types/boolean-logic/operators/IsAny.ts +0 -10
- package/src/types/boolean-logic/operators/IsAnyEqual.ts +0 -14
- package/src/types/boolean-logic/operators/IsArray.ts +0 -12
- package/src/types/boolean-logic/operators/IsBoolean.ts +0 -13
- package/src/types/boolean-logic/operators/IsBooleanLiteral.ts +0 -20
- package/src/types/boolean-logic/operators/IsContainer.ts +0 -16
- package/src/types/boolean-logic/operators/IsCssHexadecimal.ts +0 -15
- package/src/types/boolean-logic/operators/IsDefined.ts +0 -6
- package/src/types/boolean-logic/operators/IsDotPath.ts +0 -55
- package/src/types/boolean-logic/operators/IsEmptyObject.ts +0 -19
- package/src/types/boolean-logic/operators/IsEmptyString.ts +0 -18
- package/src/types/boolean-logic/operators/IsEqual.ts +0 -23
- package/src/types/boolean-logic/operators/IsErrorCondition.ts +0 -19
- package/src/types/boolean-logic/operators/IsFalse.ts +0 -22
- package/src/types/boolean-logic/operators/IsFalsy.ts +0 -13
- package/src/types/boolean-logic/operators/IsFloat.ts +0 -24
- package/src/types/boolean-logic/operators/IsFnWithParams.ts +0 -37
- package/src/types/boolean-logic/operators/IsFunction.ts +0 -10
- package/src/types/boolean-logic/operators/IsGreaterThan.ts +0 -43
- package/src/types/boolean-logic/operators/IsInteger.ts +0 -18
- package/src/types/boolean-logic/operators/IsIterable.ts +0 -35
- package/src/types/boolean-logic/operators/IsLength.ts +0 -14
- package/src/types/boolean-logic/operators/IsLessThan.ts +0 -39
- package/src/types/boolean-logic/operators/IsLiteral.ts +0 -48
- package/src/types/boolean-logic/operators/IsLiteralFn.ts +0 -24
- package/src/types/boolean-logic/operators/IsLiteralUnion.ts +0 -21
- package/src/types/boolean-logic/operators/IsNarrowingFn.ts +0 -19
- package/src/types/boolean-logic/operators/IsNegativeNumber.ts +0 -23
- package/src/types/boolean-logic/operators/IsNever.ts +0 -10
- package/src/types/boolean-logic/operators/IsNonLiteralUnion.ts +0 -23
- package/src/types/boolean-logic/operators/IsNotEqual.ts +0 -7
- package/src/types/boolean-logic/operators/IsNothing.ts +0 -11
- package/src/types/boolean-logic/operators/IsNull.ts +0 -17
- package/src/types/boolean-logic/operators/IsNumber.ts +0 -14
- package/src/types/boolean-logic/operators/IsNumberLike.ts +0 -17
- package/src/types/boolean-logic/operators/IsNumericLiteral.ts +0 -14
- package/src/types/boolean-logic/operators/IsObject.ts +0 -23
- package/src/types/boolean-logic/operators/IsObjectLiteral.ts +0 -37
- package/src/types/boolean-logic/operators/IsOptionalScalar.ts +0 -28
- package/src/types/boolean-logic/operators/IsPositiveNumber.ts +0 -13
- package/src/types/boolean-logic/operators/IsReadonlyArray.ts +0 -14
- package/src/types/boolean-logic/operators/IsReadonlyObject.ts +0 -15
- package/src/types/boolean-logic/operators/IsScalar.ts +0 -25
- package/src/types/boolean-logic/operators/IsSingleChar.ts +0 -20
- package/src/types/boolean-logic/operators/IsSingularNoun.ts +0 -20
- package/src/types/boolean-logic/operators/IsString.ts +0 -16
- package/src/types/boolean-logic/operators/IsStringLiteral.ts +0 -16
- package/src/types/boolean-logic/operators/IsSymbol.ts +0 -8
- package/src/types/boolean-logic/operators/IsTrue.ts +0 -27
- package/src/types/boolean-logic/operators/IsTruthy.ts +0 -40
- package/src/types/boolean-logic/operators/IsTuple.ts +0 -27
- package/src/types/boolean-logic/operators/IsUndefined.ts +0 -9
- package/src/types/boolean-logic/operators/IsUnion.ts +0 -18
- package/src/types/boolean-logic/operators/IsUnionArray.ts +0 -17
- package/src/types/boolean-logic/operators/IsUnset.ts +0 -10
- package/src/types/boolean-logic/operators/IsUrl.ts +0 -65
- package/src/types/boolean-logic/operators/IsValidDotPath.ts +0 -42
- package/src/types/boolean-logic/operators/IsValidIndex.ts +0 -59
- package/src/types/boolean-logic/operators/IsVueRef.ts +0 -34
- package/src/types/boolean-logic/operators/IsWideType.ts +0 -116
- package/src/types/boolean-logic/operators/IsWideUnion.ts +0 -25
- package/src/types/boolean-logic/operators/MaybeError.ts +0 -32
- package/src/types/boolean-logic/operators/NarrowlyContains.ts +0 -23
- package/src/types/boolean-logic/operators/Network-operators.ts +0 -192
- package/src/types/boolean-logic/operators/NotEqual.ts +0 -11
- package/src/types/boolean-logic/operators/NotLength.ts +0 -12
- package/src/types/boolean-logic/operators/PhoneOperators.ts +0 -62
- package/src/types/boolean-logic/operators/README.md +0 -3
- package/src/types/boolean-logic/operators/Returns.ts +0 -16
- package/src/types/boolean-logic/operators/ReturnsBoolean.ts +0 -13
- package/src/types/boolean-logic/operators/ReturnsFalse.ts +0 -15
- package/src/types/boolean-logic/operators/ReturnsTrue.ts +0 -17
- package/src/types/boolean-logic/operators/SomeEqual.ts +0 -17
- package/src/types/boolean-logic/operators/SomeExtend.ts +0 -26
- package/src/types/boolean-logic/operators/StartsWith.ts +0 -54
- package/src/types/boolean-logic/operators/UnionHasArray.ts +0 -22
- package/src/types/boolean-logic/operators/Validate.ts +0 -54
- package/src/types/boolean-logic/operators/YouTube-operators.ts +0 -68
- package/src/types/boolean-logic/operators/index.ts +0 -103
- package/src/types/classes/Constructor.ts +0 -10
- package/src/types/classes/KlassMeta.ts +0 -28
- package/src/types/classes/index.ts +0 -2
- package/src/types/containers/IsEmptyContainer.ts +0 -21
- package/src/types/containers/IsNonEmptyContainer.ts +0 -15
- package/src/types/containers/RemoveEmpty.ts +0 -78
- package/src/types/containers/RemoveMarked.ts +0 -53
- package/src/types/containers/RemoveNever.ts +0 -69
- package/src/types/containers/RemoveUndefined.ts +0 -55
- package/src/types/containers/index.ts +0 -6
- package/src/types/dictionary/AddKeyValue.ts +0 -34
- package/src/types/dictionary/CamelKeys.ts +0 -42
- package/src/types/dictionary/CombinedKeys.ts +0 -21
- package/src/types/dictionary/CreateKV.ts +0 -30
- package/src/types/dictionary/CreateLookup.ts +0 -59
- package/src/types/dictionary/DefineObject.ts +0 -45
- package/src/types/dictionary/DictChangeValue.ts +0 -34
- package/src/types/dictionary/EnsureKeys.ts +0 -34
- package/src/types/dictionary/FilterProps.ts +0 -45
- package/src/types/dictionary/FromMaybeRef.ts +0 -13
- package/src/types/dictionary/Get.ts +0 -20
- package/src/types/dictionary/KebabKeys.ts +0 -42
- package/src/types/dictionary/Keys.ts +0 -171
- package/src/types/dictionary/KeysEqualValue.ts +0 -19
- package/src/types/dictionary/KeysNotEqualValue.ts +0 -20
- package/src/types/dictionary/KeysWithValue.ts +0 -51
- package/src/types/dictionary/KeysWithoutValue.ts +0 -18
- package/src/types/dictionary/KvFn.ts +0 -20
- package/src/types/dictionary/MakeKeysOptional.ts +0 -49
- package/src/types/dictionary/MakeKeysRequired.ts +0 -23
- package/src/types/dictionary/MakePropsMutable.ts +0 -51
- package/src/types/dictionary/MapTo.ts +0 -475
- package/src/types/dictionary/MaybeRef.ts +0 -17
- package/src/types/dictionary/MergeKVs.ts +0 -30
- package/src/types/dictionary/MutableProps.ts +0 -9
- package/src/types/dictionary/NonNumericKeys.ts +0 -8
- package/src/types/dictionary/NonStringKeys.ts +0 -15
- package/src/types/dictionary/OptionalKeys.ts +0 -36
- package/src/types/dictionary/OptionalProps.ts +0 -11
- package/src/types/dictionary/PascalKeys.ts +0 -42
- package/src/types/dictionary/ReadonlyKeys.ts +0 -19
- package/src/types/dictionary/ReadonlyProps.ts +0 -9
- package/src/types/dictionary/RemoveIndexKeys.ts +0 -22
- package/src/types/dictionary/RequireProps.ts +0 -15
- package/src/types/dictionary/RequiredKeys.ts +0 -27
- package/src/types/dictionary/RequiredProps.ts +0 -8
- package/src/types/dictionary/RetainProps.ts +0 -45
- package/src/types/dictionary/SharedKeys.ts +0 -21
- package/src/types/dictionary/SimplifyObject.ts +0 -11
- package/src/types/dictionary/SnakeKeys.ts +0 -42
- package/src/types/dictionary/StringKeys.ts +0 -8
- package/src/types/dictionary/TakeProp.ts +0 -16
- package/src/types/dictionary/UpsertKeyValue.ts +0 -29
- package/src/types/dictionary/ValidKey.ts +0 -16
- package/src/types/dictionary/Values.ts +0 -47
- package/src/types/dictionary/WithKeys.ts +0 -42
- package/src/types/dictionary/WithNumericKeys.ts +0 -8
- package/src/types/dictionary/WithStringKeys.ts +0 -9
- package/src/types/dictionary/WithValue.ts +0 -42
- package/src/types/dictionary/WithoutKeys.ts +0 -40
- package/src/types/dictionary/WithoutValue.ts +0 -20
- package/src/types/dictionary/index.ts +0 -64
- package/src/types/errors/AsError.ts +0 -110
- package/src/types/errors/CompleteError.ts +0 -80
- package/src/types/errors/ErrorCondition.ts +0 -126
- package/src/types/errors/ErrorConditionHandler.ts +0 -10
- package/src/types/errors/KindError.ts +0 -49
- package/src/types/errors/MapError.ts +0 -29
- package/src/types/errors/PartialError.ts +0 -25
- package/src/types/errors/ProxyError.ts +0 -45
- package/src/types/errors/StackTrace.ts +0 -14
- package/src/types/errors/Throw.ts +0 -58
- package/src/types/errors/index.ts +0 -10
- package/src/types/functional/Left.ts +0 -8
- package/src/types/functional/Option.ts +0 -0
- package/src/types/functional/Result.ts +0 -327
- package/src/types/functional/Right.ts +0 -8
- package/src/types/functional/index.ts +0 -3
- package/src/types/functions/AsFnMeta.ts +0 -32
- package/src/types/functions/FnFrom.ts +0 -14
- package/src/types/functions/FnMeta.ts +0 -36
- package/src/types/functions/FnProps.ts +0 -26
- package/src/types/functions/FnWithDescription.ts +0 -19
- package/src/types/functions/FnWithProps.ts +0 -26
- package/src/types/functions/HandleDoneFn.ts +0 -12
- package/src/types/functions/IdentityFn.ts +0 -20
- package/src/types/functions/LiteralFn.ts +0 -53
- package/src/types/functions/LogicFunction.ts +0 -11
- package/src/types/functions/NarrowingFn.ts +0 -73
- package/src/types/functions/OnlyFnProps.ts +0 -11
- package/src/types/functions/PromiseAll.ts +0 -13
- package/src/types/functions/RemoveFnProps.ts +0 -11
- package/src/types/functions/ToFn.ts +0 -22
- package/src/types/functions/TypeGuard.ts +0 -9
- package/src/types/functions/WrapperFn.ts +0 -40
- package/src/types/functions/index.ts +0 -28
- package/src/types/index.ts +0 -26
- package/src/types/kv/DictFromKv.ts +0 -3
- package/src/types/kv/KeyValue.ts +0 -12
- package/src/types/kv/KvFrom.ts +0 -8
- package/src/types/kv/KvTuple.ts +0 -14
- package/src/types/kv/index.ts +0 -15
- package/src/types/lists/AfterFirst.ts +0 -15
- package/src/types/lists/AllowNonTupleWhenSingular.ts +0 -18
- package/src/types/lists/ArrayElementType.ts +0 -17
- package/src/types/lists/AsArray.ts +0 -24
- package/src/types/lists/AsNumericArray.ts +0 -21
- package/src/types/lists/AsReadonlyArray.ts +0 -3
- package/src/types/lists/AsTuple.ts +0 -16
- package/src/types/lists/BeforeLast.ts +0 -34
- package/src/types/lists/ConvertAndMap.ts +0 -138
- package/src/types/lists/ConvertSet.ts +0 -44
- package/src/types/lists/ElementOf.ts +0 -7
- package/src/types/lists/Filter.ts +0 -86
- package/src/types/lists/FilterByProp.ts +0 -87
- package/src/types/lists/FilterLiterals.ts +0 -29
- package/src/types/lists/FilterWideTypes.ts +0 -24
- package/src/types/lists/Find.ts +0 -52
- package/src/types/lists/First.ts +0 -21
- package/src/types/lists/FirstOrElse.ts +0 -15
- package/src/types/lists/FirstString.ts +0 -7
- package/src/types/lists/Flatten.ts +0 -149
- package/src/types/lists/GetEach.ts +0 -62
- package/src/types/lists/IndexOf.ts +0 -151
- package/src/types/lists/Intersect.ts +0 -19
- package/src/types/lists/IntersectAll.ts +0 -26
- package/src/types/lists/Last.ts +0 -29
- package/src/types/lists/Length.ts +0 -65
- package/src/types/lists/LogicalReturns.ts +0 -30
- package/src/types/lists/MaxLength.ts +0 -44
- package/src/types/lists/NumericKeys.ts +0 -55
- package/src/types/lists/NumericSort.ts +0 -183
- package/src/types/lists/Pop.ts +0 -39
- package/src/types/lists/Push.ts +0 -25
- package/src/types/lists/ReplaceLast.ts +0 -14
- package/src/types/lists/Retain.ts +0 -81
- package/src/types/lists/RetainByProp.ts +0 -105
- package/src/types/lists/RetainLiterals.ts +0 -30
- package/src/types/lists/RetainWideTypes.ts +0 -31
- package/src/types/lists/ReturnTypes.ts +0 -20
- package/src/types/lists/Reverse.ts +0 -14
- package/src/types/lists/Second.ts +0 -22
- package/src/types/lists/Shift.ts +0 -50
- package/src/types/lists/Slice.ts +0 -133
- package/src/types/lists/TakeFirst.ts +0 -67
- package/src/types/lists/TakeLast.ts +0 -31
- package/src/types/lists/ToCSV.ts +0 -29
- package/src/types/lists/TruthyReturns.ts +0 -23
- package/src/types/lists/UnionFromProp.ts +0 -26
- package/src/types/lists/index.ts +0 -61
- package/src/types/literals/BooleanLike.ts +0 -9
- package/src/types/literals/Box.ts +0 -20
- package/src/types/literals/Choices.ts +0 -251
- package/src/types/literals/Color.ts +0 -54
- package/src/types/literals/ContainerBlockKey.ts +0 -22
- package/src/types/literals/ContainerKeyGuarantee.ts +0 -26
- package/src/types/literals/DoneFnTuple.ts +0 -31
- package/src/types/literals/ExpandRecursively.ts +0 -68
- package/src/types/literals/FromDefn.ts +0 -151
- package/src/types/literals/FromTokenNames.ts +0 -81
- package/src/types/literals/Narrow.ts +0 -10
- package/src/types/literals/Narrowable.ts +0 -9
- package/src/types/literals/NarrowableDefined.ts +0 -11
- package/src/types/literals/NarrowableScalar.ts +0 -14
- package/src/types/literals/OptRequired.ts +0 -4
- package/src/types/literals/RuntimeUnion.ts +0 -16
- package/src/types/literals/Unset.ts +0 -14
- package/src/types/literals/VueComputedRef.ts +0 -41
- package/src/types/literals/VueRef.ts +0 -23
- package/src/types/literals/index.ts +0 -19
- package/src/types/numeric-literals/Abs.ts +0 -31
- package/src/types/numeric-literals/AbsMaybe.ts +0 -21
- package/src/types/numeric-literals/Add.ts +0 -179
- package/src/types/numeric-literals/AsNegativeNumber.ts +0 -32
- package/src/types/numeric-literals/AsNumberWhenPossible.ts +0 -41
- package/src/types/numeric-literals/CSV.ts +0 -164
- package/src/types/numeric-literals/Decrement.ts +0 -21
- package/src/types/numeric-literals/Delta.ts +0 -70
- package/src/types/numeric-literals/Digit.ts +0 -10
- package/src/types/numeric-literals/DigitNonZero.ts +0 -8
- package/src/types/numeric-literals/Digitize.ts +0 -42
- package/src/types/numeric-literals/Increment.ts +0 -26
- package/src/types/numeric-literals/InvertNumericSign.ts +0 -18
- package/src/types/numeric-literals/LessThan.ts +0 -23
- package/src/types/numeric-literals/LessThanOrEqual.ts +0 -24
- package/src/types/numeric-literals/Negative.ts +0 -12
- package/src/types/numeric-literals/NextDigit.ts +0 -35
- package/src/types/numeric-literals/NumberLike.ts +0 -7
- package/src/types/numeric-literals/NumericRange.ts +0 -17
- package/src/types/numeric-literals/PriorDigit.ts +0 -35
- package/src/types/numeric-literals/Subtract.ts +0 -84
- package/src/types/numeric-literals/ToInteger.ts +0 -45
- package/src/types/numeric-literals/ToNumericArray.ts +0 -27
- package/src/types/numeric-literals/Zero.ts +0 -8
- package/src/types/numeric-literals/index.ts +0 -24
- package/src/types/queues/FifoQueue.ts +0 -39
- package/src/types/queues/LifoQueue.ts +0 -39
- package/src/types/queues/index.ts +0 -3
- package/src/types/runtime-types/AsType.ts +0 -65
- package/src/types/runtime-types/Dict.ts +0 -79
- package/src/types/runtime-types/FromLiteralTokens.ts +0 -56
- package/src/types/runtime-types/Rec.ts +0 -18
- package/src/types/runtime-types/Shape.ts +0 -384
- package/src/types/runtime-types/SimpleType.ts +0 -168
- package/src/types/runtime-types/StringLiteralToken.ts +0 -43
- package/src/types/runtime-types/TokenizeStringLiteral.ts +0 -65
- package/src/types/runtime-types/Type.ts +0 -381
- package/src/types/runtime-types/TypeOf.ts +0 -76
- package/src/types/runtime-types/TypeToken.ts +0 -384
- package/src/types/runtime-types/TypeTuple.ts +0 -22
- package/src/types/runtime-types/index.ts +0 -12
- package/src/types/sets/IntersectingKeys.ts +0 -17
- package/src/types/sets/Intersection.ts +0 -151
- package/src/types/sets/Relate.ts +0 -20
- package/src/types/sets/SetCandidate.ts +0 -9
- package/src/types/sets/Unique.ts +0 -87
- package/src/types/sets/UniqueKeys.ts +0 -36
- package/src/types/sets/UniqueKeysUnion.ts +0 -27
- package/src/types/sets/UniqueKv.ts +0 -17
- package/src/types/sets/index.ts +0 -9
- package/src/types/string-literals/AfterFirstChar.ts +0 -34
- package/src/types/string-literals/Cardinality.ts +0 -82
- package/src/types/string-literals/Chars.ts +0 -27
- package/src/types/string-literals/Concat.ts +0 -45
- package/src/types/string-literals/Date.ts +0 -156
- package/src/types/string-literals/DateTime.ts +0 -56
- package/src/types/string-literals/EmptyString.ts +0 -7
- package/src/types/string-literals/EmptyStringOr.ts +0 -12
- package/src/types/string-literals/EnsureLeading.ts +0 -70
- package/src/types/string-literals/EnsureLeadingEvery.ts +0 -22
- package/src/types/string-literals/EnsureSurround.ts +0 -17
- package/src/types/string-literals/EnsureTrailing.ts +0 -60
- package/src/types/string-literals/FindIndex.ts +0 -174
- package/src/types/string-literals/FirstChar.ts +0 -33
- package/src/types/string-literals/HasUppercase.ts +0 -16
- package/src/types/string-literals/IsCapitalized.ts +0 -18
- package/src/types/string-literals/Join.ts +0 -64
- package/src/types/string-literals/LastChar.ts +0 -35
- package/src/types/string-literals/PathJoin.ts +0 -55
- package/src/types/string-literals/Pluralize.ts +0 -107
- package/src/types/string-literals/Prepend.ts +0 -17
- package/src/types/string-literals/PrependAll.ts +0 -18
- package/src/types/string-literals/Proxmox.ts +0 -6
- package/src/types/string-literals/Repeat.ts +0 -14
- package/src/types/string-literals/RetainAfter.ts +0 -68
- package/src/types/string-literals/RetainUntil.ts +0 -69
- package/src/types/string-literals/Split.ts +0 -113
- package/src/types/string-literals/StrLen.ts +0 -17
- package/src/types/string-literals/StripAfter.ts +0 -24
- package/src/types/string-literals/StripBefore.ts +0 -24
- package/src/types/string-literals/StripLeading.ts +0 -48
- package/src/types/string-literals/StripSurround.ts +0 -34
- package/src/types/string-literals/StripTrailing.ts +0 -51
- package/src/types/string-literals/StripUntil.ts +0 -56
- package/src/types/string-literals/Suggest.ts +0 -52
- package/src/types/string-literals/Surround.ts +0 -48
- package/src/types/string-literals/Time.ts +0 -333
- package/src/types/string-literals/Truncate.ts +0 -59
- package/src/types/string-literals/UnderlyingType.ts +0 -29
- package/src/types/string-literals/casing/AllCaps.ts +0 -24
- package/src/types/string-literals/casing/CamelCase.ts +0 -32
- package/src/types/string-literals/casing/CapFirstAlpha.ts +0 -22
- package/src/types/string-literals/casing/CapitalizeWords.ts +0 -8
- package/src/types/string-literals/casing/DashToSnake.ts +0 -3
- package/src/types/string-literals/casing/DashUppercase.ts +0 -23
- package/src/types/string-literals/casing/KebabCase.ts +0 -48
- package/src/types/string-literals/casing/LowerAllCaps.ts +0 -17
- package/src/types/string-literals/casing/NamingConvention.ts +0 -14
- package/src/types/string-literals/casing/PascalCase.ts +0 -28
- package/src/types/string-literals/casing/RaiseAllLowercase.ts +0 -12
- package/src/types/string-literals/casing/SnakeCase.ts +0 -60
- package/src/types/string-literals/casing/index.ts +0 -12
- package/src/types/string-literals/character-sets/Alpha.ts +0 -19
- package/src/types/string-literals/character-sets/AlphaChar.ts +0 -10
- package/src/types/string-literals/character-sets/AlphaNumeric.ts +0 -31
- package/src/types/string-literals/character-sets/BCP.ts +0 -37
- package/src/types/string-literals/character-sets/CSV.ts +0 -26
- package/src/types/string-literals/character-sets/CarriageReturn.ts +0 -22
- package/src/types/string-literals/character-sets/Consonants.ts +0 -19
- package/src/types/string-literals/character-sets/Country.ts +0 -217
- package/src/types/string-literals/character-sets/DomainName.ts +0 -56
- package/src/types/string-literals/character-sets/DotPathFor.ts +0 -46
- package/src/types/string-literals/character-sets/Hexadecimal.ts +0 -27
- package/src/types/string-literals/character-sets/Indent.ts +0 -37
- package/src/types/string-literals/character-sets/InlineSvg.ts +0 -8
- package/src/types/string-literals/character-sets/IpAddress.ts +0 -161
- package/src/types/string-literals/character-sets/LowerAlpha.ts +0 -19
- package/src/types/string-literals/character-sets/LowerAlphaChar.ts +0 -10
- package/src/types/string-literals/character-sets/NonAlpha.ts +0 -7
- package/src/types/string-literals/character-sets/NumericChar.ts +0 -33
- package/src/types/string-literals/character-sets/Optional.ts +0 -48
- package/src/types/string-literals/character-sets/OptionalSpace.ts +0 -22
- package/src/types/string-literals/character-sets/PlusMinus.ts +0 -1
- package/src/types/string-literals/character-sets/Punctuation.ts +0 -9
- package/src/types/string-literals/character-sets/Repos.ts +0 -54
- package/src/types/string-literals/character-sets/SingularNoun.ts +0 -37
- package/src/types/string-literals/character-sets/SpecialChar.ts +0 -5
- package/src/types/string-literals/character-sets/StringDelimiter.ts +0 -5
- package/src/types/string-literals/character-sets/UpperAlphaChar.ts +0 -10
- package/src/types/string-literals/character-sets/ValueAtDotPath.ts +0 -61
- package/src/types/string-literals/character-sets/Variable.ts +0 -20
- package/src/types/string-literals/character-sets/Whitespace.ts +0 -19
- package/src/types/string-literals/character-sets/YouTube.ts +0 -238
- package/src/types/string-literals/character-sets/brackets/Brackets.ts +0 -7
- package/src/types/string-literals/character-sets/brackets/ClosingBracket.ts +0 -4
- package/src/types/string-literals/character-sets/brackets/OpeningBracket.ts +0 -4
- package/src/types/string-literals/character-sets/brackets/index.ts +0 -3
- package/src/types/string-literals/character-sets/css/color.ts +0 -98
- package/src/types/string-literals/character-sets/css/display-position.ts +0 -42
- package/src/types/string-literals/character-sets/css/global.ts +0 -4
- package/src/types/string-literals/character-sets/css/html-element.ts +0 -195
- package/src/types/string-literals/character-sets/css/index.ts +0 -11
- package/src/types/string-literals/character-sets/css/object.ts +0 -54
- package/src/types/string-literals/character-sets/css/overflow.ts +0 -55
- package/src/types/string-literals/character-sets/css/property.ts +0 -36
- package/src/types/string-literals/character-sets/css/props.ts +0 -115
- package/src/types/string-literals/character-sets/css/pseudo-classes.ts +0 -169
- package/src/types/string-literals/character-sets/css/selector.ts +0 -51
- package/src/types/string-literals/character-sets/css/sizing.ts +0 -35
- package/src/types/string-literals/character-sets/images/Exif.ts +0 -581
- package/src/types/string-literals/character-sets/images/ImgFormat.ts +0 -30
- package/src/types/string-literals/character-sets/images/index.ts +0 -2
- package/src/types/string-literals/character-sets/index.ts +0 -39
- package/src/types/string-literals/character-sets/phone/CountryPhoneNumber.ts +0 -20
- package/src/types/string-literals/character-sets/phone/DialCountryCode.ts +0 -10
- package/src/types/string-literals/character-sets/phone/GetPhoneCountryCode.ts +0 -29
- package/src/types/string-literals/character-sets/phone/GetPhoneNumberType.ts +0 -39
- package/src/types/string-literals/character-sets/phone/InternationalPhoneNumber.ts +0 -19
- package/src/types/string-literals/character-sets/phone/LocalPhoneNumber.ts +0 -14
- package/src/types/string-literals/character-sets/phone/PhoneAreaCode.ts +0 -7
- package/src/types/string-literals/character-sets/phone/PhoneCountryCode.ts +0 -14
- package/src/types/string-literals/character-sets/phone/PhoneNumber.ts +0 -112
- package/src/types/string-literals/character-sets/phone/PhoneNumberDelimiter.ts +0 -5
- package/src/types/string-literals/character-sets/phone/PhoneShortCode.ts +0 -37
- package/src/types/string-literals/character-sets/phone/RawPhoneNumber.ts +0 -88
- package/src/types/string-literals/character-sets/phone/RemovePhoneCountryCode.ts +0 -38
- package/src/types/string-literals/character-sets/phone/ToPhoneFormat.ts +0 -44
- package/src/types/string-literals/character-sets/phone/index.ts +0 -14
- package/src/types/string-literals/character-sets/phone.ts +0 -7
- package/src/types/string-literals/character-sets/quotation-marks/ClosingMark.ts +0 -20
- package/src/types/string-literals/character-sets/quotation-marks/OpeningMark.ts +0 -20
- package/src/types/string-literals/character-sets/quotation-marks/QuotationMark.ts +0 -33
- package/src/types/string-literals/character-sets/quotation-marks/SmartMark.ts +0 -28
- package/src/types/string-literals/character-sets/quotation-marks/StandardMark.ts +0 -22
- package/src/types/string-literals/character-sets/quotation-marks/index.ts +0 -6
- package/src/types/string-literals/character-sets/quotation-marks/individual-smart-marks.ts +0 -77
- package/src/types/string-literals/character-sets/tw/TwColor.ts +0 -138
- package/src/types/string-literals/character-sets/tw/index.ts +0 -1
- package/src/types/string-literals/character-sets/urls/Github.ts +0 -163
- package/src/types/string-literals/character-sets/urls/Social.ts +0 -43
- package/src/types/string-literals/character-sets/urls/Url.ts +0 -428
- package/src/types/string-literals/character-sets/urls/bitbucket.ts +0 -71
- package/src/types/string-literals/character-sets/urls/book-urls.ts +0 -8
- package/src/types/string-literals/character-sets/urls/index.ts +0 -6
- package/src/types/string-literals/character-sets/urls/news/australian.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/belgian.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/canadian.ts +0 -27
- package/src/types/string-literals/character-sets/urls/news/chinese.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/danish.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/dutch.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/french.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/german.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/index.ts +0 -63
- package/src/types/string-literals/character-sets/urls/news/indian.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/italian.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/japanese.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/mexican.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/norwegian.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/south-korean.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/spanish.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/swiss.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/turkish.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/uk.ts +0 -26
- package/src/types/string-literals/character-sets/urls/news/us.ts +0 -26
- package/src/types/string-literals/character-sets/urls/retail.ts +0 -59
- package/src/types/string-literals/geo/index.ts +0 -2
- package/src/types/string-literals/geo/state.ts +0 -63
- package/src/types/string-literals/geo/zip.ts +0 -34
- package/src/types/string-literals/index.ts +0 -56
- package/src/types/string-literals/metrics/acceleration.ts +0 -34
- package/src/types/string-literals/metrics/area.ts +0 -34
- package/src/types/string-literals/metrics/current.ts +0 -34
- package/src/types/string-literals/metrics/distance.ts +0 -33
- package/src/types/string-literals/metrics/energy.ts +0 -34
- package/src/types/string-literals/metrics/frequency.ts +0 -34
- package/src/types/string-literals/metrics/global.ts +0 -63
- package/src/types/string-literals/metrics/index.ts +0 -17
- package/src/types/string-literals/metrics/luminosity.ts +0 -34
- package/src/types/string-literals/metrics/mass.ts +0 -34
- package/src/types/string-literals/metrics/power.ts +0 -34
- package/src/types/string-literals/metrics/pressure.ts +0 -34
- package/src/types/string-literals/metrics/resistance.ts +0 -34
- package/src/types/string-literals/metrics/speed.ts +0 -31
- package/src/types/string-literals/metrics/temperature.ts +0 -34
- package/src/types/string-literals/metrics/time.ts +0 -34
- package/src/types/string-literals/metrics/voltage.ts +0 -34
- package/src/types/string-literals/metrics/volume.ts +0 -34
- package/src/types/string-literals/options/DropChars.ts +0 -47
- package/src/types/string-literals/options/TypeRequired.ts +0 -8
- package/src/types/string-literals/options/TypeStrength.ts +0 -9
- package/src/types/string-literals/options/index.ts +0 -3
- package/src/types/tsconfig.json +0 -51
- package/src/types/tuples/DictArray.ts +0 -21
- package/src/types/tuples/FirstKey.ts +0 -16
- package/src/types/tuples/FirstKeyValue.ts +0 -10
- package/src/types/tuples/FirstOfEach.ts +0 -16
- package/src/types/tuples/FixedLengthArray.ts +0 -28
- package/src/types/tuples/FromDictArray.ts +0 -13
- package/src/types/tuples/LastCharOfSome.ts +0 -0
- package/src/types/tuples/LastOfEach.ts +0 -21
- package/src/types/tuples/SecondOfEach.ts +0 -13
- package/src/types/tuples/index.ts +0 -19
- package/src/types/type-conversion/AsBoolean.ts +0 -16
- package/src/types/type-conversion/AsContainer.ts +0 -17
- package/src/types/type-conversion/AsDefined.ts +0 -8
- package/src/types/type-conversion/AsDictionary.ts +0 -5
- package/src/types/type-conversion/AsFunction.ts +0 -14
- package/src/types/type-conversion/AsNonNull.ts +0 -38
- package/src/types/type-conversion/AsNumber.ts +0 -29
- package/src/types/type-conversion/AsObject.ts +0 -6
- package/src/types/type-conversion/AsObjectKeys.ts +0 -21
- package/src/types/type-conversion/AsPropertyKey.ts +0 -11
- package/src/types/type-conversion/AsRecord.ts +0 -21
- package/src/types/type-conversion/AsRef.ts +0 -5
- package/src/types/type-conversion/AsString.ts +0 -28
- package/src/types/type-conversion/AsStringUnion.ts +0 -49
- package/src/types/type-conversion/Awaited.ts +0 -11
- package/src/types/type-conversion/Break.ts +0 -24
- package/src/types/type-conversion/IntersectWithAll.ts +0 -21
- package/src/types/type-conversion/JSON.ts +0 -40
- package/src/types/type-conversion/LeftWhitespace.ts +0 -19
- package/src/types/type-conversion/Merge.ts +0 -124
- package/src/types/type-conversion/MergeObjects.ts +0 -56
- package/src/types/type-conversion/Mutable.ts +0 -46
- package/src/types/type-conversion/ObjectToKvDict.ts +0 -21
- package/src/types/type-conversion/ReduceValues.ts +0 -32
- package/src/types/type-conversion/RemoveFromEnd.ts +0 -14
- package/src/types/type-conversion/RemoveFromStart.ts +0 -14
- package/src/types/type-conversion/RemoveIndex.ts +0 -27
- package/src/types/type-conversion/Replace.ts +0 -28
- package/src/types/type-conversion/ReplaceAll.ts +0 -87
- package/src/types/type-conversion/RetainChars.ts +0 -35
- package/src/types/type-conversion/ReturnValues.ts +0 -31
- package/src/types/type-conversion/RightWhitespace.ts +0 -13
- package/src/types/type-conversion/StringLength.ts +0 -34
- package/src/types/type-conversion/StringLiteralFromTuple.ts +0 -38
- package/src/types/type-conversion/StripChars.ts +0 -44
- package/src/types/type-conversion/ToBoolean.ts +0 -47
- package/src/types/type-conversion/ToContainer.ts +0 -41
- package/src/types/type-conversion/ToJsonValue.ts +0 -76
- package/src/types/type-conversion/ToNumber.ts +0 -54
- package/src/types/type-conversion/ToString.ts +0 -43
- package/src/types/type-conversion/ToStringArray.ts +0 -15
- package/src/types/type-conversion/ToUnion.ts +0 -11
- package/src/types/type-conversion/Trim.ts +0 -28
- package/src/types/type-conversion/TrimLeft.ts +0 -14
- package/src/types/type-conversion/TrimRight.ts +0 -14
- package/src/types/type-conversion/TupleToUnion.ts +0 -19
- package/src/types/type-conversion/UnionArrayToTuple.ts +0 -29
- package/src/types/type-conversion/UnionFilter.ts +0 -116
- package/src/types/type-conversion/UnionShift.ts +0 -30
- package/src/types/type-conversion/UnionToIntersection.ts +0 -10
- package/src/types/type-conversion/UnionToTuple.ts +0 -31
- package/src/types/type-conversion/UnionWithAll.ts +0 -18
- package/src/types/type-conversion/ValueOrReturnValue.ts +0 -28
- package/src/types/type-conversion/Widen.ts +0 -244
- package/src/types/type-conversion/WidenValues.ts +0 -37
- package/src/types/type-conversion/WithDefault.ts +0 -31
- package/src/types/type-conversion/form-fields.ts +0 -10
- package/src/types/type-conversion/index.ts +0 -71
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
|
-
import {
|
|
3
|
-
Dictionary,
|
|
4
|
-
If,
|
|
5
|
-
IsTrue,
|
|
6
|
-
HandleDoneFn,
|
|
7
|
-
AfterFirst,
|
|
8
|
-
First,
|
|
9
|
-
ExpandRecursively,
|
|
10
|
-
ShapeCallback,
|
|
11
|
-
AsString,
|
|
12
|
-
EmptyObject,
|
|
13
|
-
Scalar,
|
|
14
|
-
MergeObjects,
|
|
15
|
-
As,
|
|
16
|
-
} from "inferred-types/dist/types/index";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* **createChoice**(name, [value])
|
|
21
|
-
*
|
|
22
|
-
* Creates a "choice" for a Choice API. Values may be:
|
|
23
|
-
*
|
|
24
|
-
* - any `Scalar` value
|
|
25
|
-
* - a callback of the form `s => s.literal(42)`
|
|
26
|
-
* - or if left _undefined_ the value will be set to the name
|
|
27
|
-
*/
|
|
28
|
-
export type CreateChoice = <
|
|
29
|
-
TName extends string,
|
|
30
|
-
TValue extends ChoiceValue
|
|
31
|
-
>(name: TName, value?: TValue) => Choice;
|
|
32
|
-
|
|
33
|
-
export type ChoiceCallback = (cb: CreateChoice) => Choice;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export type Choice<
|
|
37
|
-
K extends string = string,
|
|
38
|
-
V = unknown
|
|
39
|
-
> = { name: K; value: V };
|
|
40
|
-
|
|
41
|
-
export type ChoiceValue = ShapeCallback | Scalar | Dictionary | undefined;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* **AsChoice**
|
|
45
|
-
*
|
|
46
|
-
* Converts a name/value pairing from createChoice() into a Choice.
|
|
47
|
-
*/
|
|
48
|
-
export type AsChoice<
|
|
49
|
-
TName extends string = string,
|
|
50
|
-
TValue extends ChoiceValue = ChoiceValue
|
|
51
|
-
> = [TValue] extends [ShapeCallback]
|
|
52
|
-
? {name: TName; value: HandleDoneFn<ReturnType<TValue>>}
|
|
53
|
-
: [TValue] extends [Scalar | Dictionary]
|
|
54
|
-
? {name: TName; value: TValue }
|
|
55
|
-
: {name: TName; value: TName};
|
|
56
|
-
|
|
57
|
-
type ProcessChoices<
|
|
58
|
-
T extends string | [string, Scalar] | Choice | ChoiceCallback
|
|
59
|
-
> = T extends string
|
|
60
|
-
? Choice<T,T>
|
|
61
|
-
: T extends [string, Scalar]
|
|
62
|
-
? Choice<T[0],T[1]>
|
|
63
|
-
: T extends Choice
|
|
64
|
-
? T
|
|
65
|
-
: T extends ChoiceCallback
|
|
66
|
-
? ReturnType<ChoiceCallback>
|
|
67
|
-
: never;
|
|
68
|
-
|
|
69
|
-
export type ToChoices<
|
|
70
|
-
T extends readonly (string | [string, Scalar] | Choice | ChoiceCallback)[]
|
|
71
|
-
> = {
|
|
72
|
-
[K in keyof T]: ProcessChoices<T[K]>
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export type ChoiceApiOptions = {
|
|
76
|
-
/**
|
|
77
|
-
* A choice may only be chosen once
|
|
78
|
-
*/
|
|
79
|
-
unique: boolean;
|
|
80
|
-
max: number | null;
|
|
81
|
-
/**
|
|
82
|
-
* the API style as it's presented after configuration
|
|
83
|
-
*/
|
|
84
|
-
style: "fn" | "object";
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export type ChoiceApi<
|
|
88
|
-
_TChoices extends readonly Choice[],
|
|
89
|
-
_TOptions extends ChoiceApiOptions
|
|
90
|
-
> = EmptyObject;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
export type ChoiceApiConfig<
|
|
94
|
-
TChoices extends readonly Choice[],
|
|
95
|
-
TOptions extends ChoiceApiOptions
|
|
96
|
-
> = {
|
|
97
|
-
done: () => ChoiceApi<TChoices, TOptions>;
|
|
98
|
-
allowChoicesToBeUsedOnlyOnce: () => ChoiceApiConfig<
|
|
99
|
-
TChoices,
|
|
100
|
-
As<MergeObjects<TOptions, {unique: true}>, ChoiceApiOptions>
|
|
101
|
-
>;
|
|
102
|
-
/**
|
|
103
|
-
* configured choices can be _reused_ multiple times
|
|
104
|
-
*/
|
|
105
|
-
allowChoicesToBeUsedMultipleTimes: () => ChoiceApiConfig<
|
|
106
|
-
TChoices,
|
|
107
|
-
As<MergeObjects<TOptions, {unique: false}>, ChoiceApiOptions>
|
|
108
|
-
>;
|
|
109
|
-
setStyle: <TStyle extends "fn" | "object">(style: TStyle) => ChoiceApiConfig<
|
|
110
|
-
TChoices,
|
|
111
|
-
As<MergeObjects<TOptions, {style: TStyle}>, ChoiceApiOptions>
|
|
112
|
-
>;
|
|
113
|
-
/**
|
|
114
|
-
* set a maximum number of choices that should be allowed
|
|
115
|
-
*/
|
|
116
|
-
maximumChoices: <TMax extends number>(max: TMax) => ChoiceApiConfig<
|
|
117
|
-
TChoices,
|
|
118
|
-
As<MergeObjects<TOptions, {max: TMax}>, ChoiceApiOptions>
|
|
119
|
-
>;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
// /**
|
|
125
|
-
// * **Choice**`<T>`
|
|
126
|
-
// *
|
|
127
|
-
// * Type utility which receives one of many _choice representations_
|
|
128
|
-
// * (from `ChoiceRepresentation`) and converts it into a simple key/value pair.
|
|
129
|
-
// */
|
|
130
|
-
// export type Choice<
|
|
131
|
-
// T extends ChoiceRepresentation = ChoiceRepresentation
|
|
132
|
-
// > = T extends {name: string; type: Fn}
|
|
133
|
-
// ? ReturnType<T["type"]> extends { done: Fn }
|
|
134
|
-
// ? Record<
|
|
135
|
-
// T["name"],
|
|
136
|
-
// ReturnType<ReturnType<T["type"]>["done"]>
|
|
137
|
-
// >
|
|
138
|
-
// : Record<T["name"], ReturnType<T["type"]>>
|
|
139
|
-
|
|
140
|
-
// : T extends {name: string; value: unknown}
|
|
141
|
-
// ? Record<T["name"], T["value"]>
|
|
142
|
-
// : T extends string
|
|
143
|
-
// ? Record<T,T>
|
|
144
|
-
// : T extends [name: string, value: unknown]
|
|
145
|
-
// ? If<
|
|
146
|
-
// IsFunction<T[1]>,
|
|
147
|
-
// Record<T[0], ReturnType<AsFunction<T[1]>>>,
|
|
148
|
-
// Record<T[0], T[1]>
|
|
149
|
-
// >
|
|
150
|
-
// : never;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
// type ToLookup<
|
|
154
|
-
// TInput extends readonly (ChoiceRepresentation|AsChoice)[],
|
|
155
|
-
// TOutput extends {[key:string]: unknown} = NonNullable<unknown>
|
|
156
|
-
// > = [] extends TInput
|
|
157
|
-
// ? ExpandRecursively<TOutput>
|
|
158
|
-
// : ToLookup<
|
|
159
|
-
// AfterFirst<TInput>,
|
|
160
|
-
// First<TInput> extends ChoiceRepresentation
|
|
161
|
-
// ? AsChoice<First<TInput>> & TOutput
|
|
162
|
-
// : First<TInput> extends Record<string, unknown>
|
|
163
|
-
// ? First<TInput> & TOutput
|
|
164
|
-
// : never
|
|
165
|
-
// >
|
|
166
|
-
|
|
167
|
-
// /**
|
|
168
|
-
// * **Choices**`<TInput>`
|
|
169
|
-
// *
|
|
170
|
-
// * Converts an tuple of `ChoiceRepresentation` elements into a lookup table
|
|
171
|
-
// * of name/values.
|
|
172
|
-
// */
|
|
173
|
-
// export type AsChoices<
|
|
174
|
-
// TInput extends readonly (ChoiceRepresentation|AsChoice)[] = readonly ChoiceRepresentation[],
|
|
175
|
-
// > = ToLookup<TInput>;
|
|
176
|
-
|
|
177
|
-
export type MultipleChoice<
|
|
178
|
-
TChoices extends Dictionary<string> = Dictionary<string>,
|
|
179
|
-
TForceUnique extends boolean = boolean,
|
|
180
|
-
TState extends readonly unknown[] = [],
|
|
181
|
-
TExclude extends string = never
|
|
182
|
-
> = {
|
|
183
|
-
selected: TState;
|
|
184
|
-
forceUnique: TForceUnique;
|
|
185
|
-
choices: TChoices;
|
|
186
|
-
<T extends string & Exclude<keyof TChoices, TExclude>>(s: T ):
|
|
187
|
-
MultipleChoice<
|
|
188
|
-
TChoices,
|
|
189
|
-
TForceUnique,
|
|
190
|
-
[
|
|
191
|
-
...TState,
|
|
192
|
-
T extends keyof TChoices
|
|
193
|
-
? TChoices[T]
|
|
194
|
-
: never
|
|
195
|
-
],
|
|
196
|
-
AsString<If<
|
|
197
|
-
IsTrue<TForceUnique>,
|
|
198
|
-
TExclude | T,
|
|
199
|
-
TExclude
|
|
200
|
-
>>
|
|
201
|
-
>;
|
|
202
|
-
/** return the selected choices */
|
|
203
|
-
done: () => TState;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* **MultiChoiceCallback**`<TApi>`
|
|
208
|
-
*
|
|
209
|
-
* Provides the typing so that you can easily incorporate a "choice"
|
|
210
|
-
* as a parameter to your functions.
|
|
211
|
-
*
|
|
212
|
-
* It is intended to be used with the runtime utility `handleDoneFn()`
|
|
213
|
-
* so that if a user doesn't terminate their callback with a call to
|
|
214
|
-
* `.done()` then this is done for them.
|
|
215
|
-
*/
|
|
216
|
-
export type MultiChoiceCallback<TApi extends MultipleChoice> = <
|
|
217
|
-
CB extends ((c: TApi) => unknown)
|
|
218
|
-
>(cb: CB) => HandleDoneFn<ReturnType<CB>>;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
type MergeKVs<
|
|
222
|
-
TInput extends readonly Dictionary[],
|
|
223
|
-
TOutput extends Dictionary = EmptyObject
|
|
224
|
-
> = [] extends TInput
|
|
225
|
-
? ExpandRecursively<TOutput>
|
|
226
|
-
: MergeKVs<
|
|
227
|
-
AfterFirst<TInput>,
|
|
228
|
-
First<TInput> extends keyof TOutput
|
|
229
|
-
? TOutput
|
|
230
|
-
: TOutput & First<TInput>
|
|
231
|
-
>;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* **ChoiceBuilder**
|
|
235
|
-
*
|
|
236
|
-
* Builds a Choice API surface:
|
|
237
|
-
*/
|
|
238
|
-
export type ChoiceBuilder= <
|
|
239
|
-
TChoices extends readonly Choice[]
|
|
240
|
-
>(...choices: TChoices) => ({
|
|
241
|
-
chooseMany: <
|
|
242
|
-
TForce extends boolean
|
|
243
|
-
>(force: TForce) =>
|
|
244
|
-
MultipleChoice<
|
|
245
|
-
MergeKVs<TChoices> extends Dictionary<string>
|
|
246
|
-
? MergeKVs<TChoices>
|
|
247
|
-
: never,
|
|
248
|
-
TForce
|
|
249
|
-
>;
|
|
250
|
-
});
|
|
251
|
-
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// https://www.w3schools.com/colors/colors_groups.asp
|
|
3
|
-
|
|
4
|
-
import { HexadecimalChar } from "inferred-types/dist/types/index";
|
|
5
|
-
|
|
6
|
-
export type NamedColor_Pink = "Pink" | "LightPink" | "HotPink" | "DeepPink" | "PaleVioletRed" | "MediumVioletRed";
|
|
7
|
-
export type NamedColor_Purple = "Lavender" | "Thistle" | "Plum" | "Orchid" | "Violet" | "Fuchsia" | "Magenta" | "MediumOrchid" | "DarkOrchid" | "DarkViolet" | "BlueViolet" | "DarkMagenta" | "Purple" | "MediumPurple" | "MediumSlateBlue" | "SlateBlue" | "DarkSlateBlue" | "RebeccaPurple" | "Indigo";
|
|
8
|
-
export type NamedColor_Red = "LightSalmon" | "Salmon" | "DarkSalmon" | "LightCoral" | "IndianRed" | "Crimson" | "Red" | "FireBrick" | "DarkRed" | "Maroon";
|
|
9
|
-
export type NamedColor_Orange = "Orange" | "DarkOrange" | "Coral" | "Tomato" | "OrangeRed";
|
|
10
|
-
export type NamedColor_Yellow = "Gold" | "Yellow" | "LightYellow" | "LemonChiffon" | "LightGoldenRodYellow" | "PapayaWhip" | "Moccasin" | "PeachPuff" | "PaleGoldenRod" | "Khaki" | "DarkKhaki";
|
|
11
|
-
export type NamedColor_Green = "GreenYellow" | "Chartreuse" | "LawnGreen" | "Lime" | "LimeGreen" | "PaleGreen" | "LightGreen" | "MediumSpringGreen" | "SpringGreen" | "MediumSpringGreen" | "SeaGreen" | "ForestGreen" | "Green" | "DarkGreen" | "YellowGreen" | "OliveDrab" | "DarkOliveGreen" | "MediumOliveGreen" | "MediumAquaMarine" | "DarkSeeGreen" | "LightSeaGreen" | "DarkCyan" | "Teal";
|
|
12
|
-
export type NamedColor_Cyan = "Aqua" | "Cyan" | "LightCyan" | "PaleTurquoise" | "Aquamarine" | "Turquoise" | "MediumTurquoise" | "DarkTurquoise";
|
|
13
|
-
export type NamedColor_Blue = "CadetBlue" | "SteelBlue" | "LightSteelBlue" | "LightBlue" | "PowerBlue" | "LightSkyBlue" | "SkyBlue" | "CornflowerBlue" | "DeepSkyBlue" | "DodgerBlue" | "RoyalBlue" | "Blue" | "MediumBlue" | "DarkBlue" | "MidnightBlue";
|
|
14
|
-
export type NamedColor_Brown = "Cornsilk" | "BlanchedAlmond" | "Bisque" | "NavajoWhite" | "White" | "BurlyWood" | "Tan" | "RosyBrown" | "SandyBrown" | "GoldenRod" | "DarkGoldenRod" | "Peru" | "Chocolate" | "Olive" | "SaddleBrown" | "Sienna" | "Brown";
|
|
15
|
-
export type NamedColor_White = "White" | "Snow" | "HoneyDew" | "MintCream" | "Azure" | "AliceBlue" | "GhostWhite" | "WhiteSmoke" | "SeaShell" | "Beige" | "OldLace" | "FloralWhite" | "Ivory" | "AntiqueWhite" | "Linen" | "LavenderBlush" | "MintyRose";
|
|
16
|
-
export type NamedColor_Gray = "Gainsboro" | "LightGray" | "Silver" | "DarkGray" | "DimGray" | "Gray" | `LightSlateGray` | "SlateGray" | "DarkSlateGray" | "Black";
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* **NamedColor**
|
|
20
|
-
*
|
|
21
|
-
* Most if not all CSS/HTML _named_ colors
|
|
22
|
-
*/
|
|
23
|
-
export type NamedColor = NamedColor_Gray | NamedColor_White | NamedColor_Brown | NamedColor_Blue | NamedColor_Cyan | NamedColor_Green | NamedColor_Yellow | NamedColor_Orange | NamedColor_Red | NamedColor_Purple | NamedColor_Pink;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* **NamedColorMinimal**
|
|
27
|
-
*
|
|
28
|
-
* A minimal set of _named_ colors recognized by CSS and HTML.
|
|
29
|
-
*/
|
|
30
|
-
export type NamedColorMinimal = "Gray" | "SlateGray" | "DarkSlateGray" | "Black" | "White" | "AliceBlue" | "WhiteSmoke" | "GhostWhite" | "Brown" | "Tan" | "Cornsilk" | "Blue" | "CadetBlue" | "SteelBlue" | "PowerBlue" | "DodgerBlue" | "DarkBlue" | "Cyan" | "Turquoise" | "Aquamarine" | "Teal" | "Gold" | "Yellow" | "LightYellow" | "Moccasin" | "Orange" | "DarkOrange" | "Tomato" | "Salmon" | "Red" | "FireBrick" | "DarkRed" | "Maroon" | "Plum" | "Violet" | "Purple" | "SlateBlue" | "DarkSlateBlue" | "Indigo";
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* **HexColor**
|
|
34
|
-
*
|
|
35
|
-
* A color value based in hexadecimal format
|
|
36
|
-
*/
|
|
37
|
-
export type HexColor = `#${HexadecimalChar}${HexadecimalChar}${string}`;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* **RgbColor**
|
|
42
|
-
*
|
|
43
|
-
* Type to enforce an `rgb()` color definition
|
|
44
|
-
*/
|
|
45
|
-
export type RgbColor = `rgb(${string},${string},${string})`;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* **RgbaColor**
|
|
50
|
-
*
|
|
51
|
-
* Type to enforce an `rgba()` color definition
|
|
52
|
-
*/
|
|
53
|
-
export type RgbaColor = `rgba(${string},${string},${string},${string})`;
|
|
54
|
-
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Container, Tuple } from "inferred-types/dist/types/index";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* **ContainerBlockKey**`<TContainer,TKey>`
|
|
6
|
-
*
|
|
7
|
-
* Returns the `TContainer` value intersected with a guarantee that the
|
|
8
|
-
* `TKey` key value exists.
|
|
9
|
-
* ```ts
|
|
10
|
-
* // { foo: 1; bar: unknown }
|
|
11
|
-
* type TO = ContainerBlockKey<{foo: 1}, "bar">;
|
|
12
|
-
* // number[] & readonly [unknown,unknown,unknown]
|
|
13
|
-
* type TA = ContainerBlockKey<number[], 2>;
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export type ContainerBlockKey<
|
|
17
|
-
TContainer extends Container,
|
|
18
|
-
TKey extends PropertyKey
|
|
19
|
-
> = TContainer extends Tuple
|
|
20
|
-
? TContainer & [...Tuple<unknown, TKey & number>, never]
|
|
21
|
-
: Exclude<TContainer, TKey>;
|
|
22
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Container, ExpandRecursively, Tuple } from "inferred-types/dist/types/index";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* **ContainerKeyGuarantee**`<TContainer,TKey,[TType]>`
|
|
6
|
-
*
|
|
7
|
-
* Returns the `TContainer` value intersected with a guarantee that the
|
|
8
|
-
* `TKey` key value exists.
|
|
9
|
-
* ```ts
|
|
10
|
-
* // { foo: 1; bar: unknown }
|
|
11
|
-
* type TO = ContainerKeyGuarantee<{foo: 1}, "bar">;
|
|
12
|
-
* // number[] & readonly [unknown,unknown,unknown]
|
|
13
|
-
* type TA = ContainerKeyGuarantee<number[], 2>;
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* - by default the guarantee is provided by assigning the `unknown`
|
|
17
|
-
* type but you can override this by setting `TType`
|
|
18
|
-
*/
|
|
19
|
-
export type ContainerKeyGuarantee<
|
|
20
|
-
TContainer extends Container,
|
|
21
|
-
TKey extends PropertyKey,
|
|
22
|
-
TType = unknown
|
|
23
|
-
> = TContainer extends Tuple
|
|
24
|
-
? TContainer & Readonly<[...Tuple<unknown, TKey & number>, TType]>
|
|
25
|
-
: ExpandRecursively<TContainer & Record<TKey, TType>>;
|
|
26
|
-
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { IsTrue, If, FnWithDescription, FnDefn, TupleToUnion, Narrow} from "inferred-types/dist/types/index";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* **DoneFnTuple**`<[TTuple],[TMakeUnion],[TFns]>`
|
|
6
|
-
*
|
|
7
|
-
* This type utility quickly builds the types you'll need for an
|
|
8
|
-
* API surface with the `done()` command returning the stored state
|
|
9
|
-
* as either a **Tuple** or a **Union** of the tuple state.
|
|
10
|
-
*
|
|
11
|
-
* **Related:** `HasDoneFn`, `Narrow`, `DoneFnKv`, `createDoneTupleFn`
|
|
12
|
-
*/
|
|
13
|
-
export type DoneFnTuple<
|
|
14
|
-
TFns extends {[key: string]: FnDefn} = {
|
|
15
|
-
add: [
|
|
16
|
-
<TAdd extends Narrow>(a: TAdd) => boolean,
|
|
17
|
-
"add a value to the tuple/union"
|
|
18
|
-
];
|
|
19
|
-
},
|
|
20
|
-
TMakeUnion extends boolean = false,
|
|
21
|
-
TState extends readonly Narrow[] = Narrow[],
|
|
22
|
-
> = {
|
|
23
|
-
[K in keyof TFns]: FnWithDescription<TFns[K]>
|
|
24
|
-
} & {
|
|
25
|
-
state: TState;
|
|
26
|
-
type_as_union: TMakeUnion;
|
|
27
|
-
done: FnWithDescription<[
|
|
28
|
-
() => If<IsTrue<TMakeUnion>, TupleToUnion<TState>, TState>,
|
|
29
|
-
"exits the API surface with the state which has been accumulated so far"
|
|
30
|
-
]>;
|
|
31
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
|
-
import { AfterFirst, AnyFunction, AsLiteralFn, AsNarrowingFn, Decrement, Dictionary, First, FnProps, IsNarrowingFn, IsUnion, Tuple, TupleToUnion, TypedFunction, UnionToTuple } from "inferred-types/dist/types/index";
|
|
3
|
-
|
|
4
|
-
type _ExpandTuple<
|
|
5
|
-
TLength extends number,
|
|
6
|
-
TContent extends Tuple,
|
|
7
|
-
TTuple extends Tuple = []
|
|
8
|
-
> = TLength extends 0
|
|
9
|
-
? Readonly<TTuple>
|
|
10
|
-
: _ExpandTuple<
|
|
11
|
-
Decrement<TLength>,
|
|
12
|
-
AfterFirst<TContent>,
|
|
13
|
-
[...TTuple, First<TContent>]
|
|
14
|
-
>;
|
|
15
|
-
|
|
16
|
-
type ExpandParameters<
|
|
17
|
-
TFn extends TypedFunction,
|
|
18
|
-
TParams extends readonly unknown[],
|
|
19
|
-
TResults extends readonly unknown[] = []
|
|
20
|
-
> = [] extends TParams
|
|
21
|
-
? IsNarrowingFn<TFn> extends true
|
|
22
|
-
? AsNarrowingFn<TResults,ReturnType<TFn>,ExpandDictionary<FnProps<TFn>>>
|
|
23
|
-
: AsLiteralFn<TResults,ReturnType<TFn>,ExpandDictionary<FnProps<TFn>>>
|
|
24
|
-
: ExpandParameters<
|
|
25
|
-
TFn,
|
|
26
|
-
AfterFirst<TParams>,
|
|
27
|
-
[
|
|
28
|
-
...TResults,
|
|
29
|
-
First<TParams> extends Dictionary
|
|
30
|
-
? ExpandDictionary<First<TParams>>
|
|
31
|
-
: First<TParams>
|
|
32
|
-
]
|
|
33
|
-
>;
|
|
34
|
-
|
|
35
|
-
export type ExpandTuple<T> = T extends Tuple
|
|
36
|
-
? _ExpandTuple<T["length"],T>
|
|
37
|
-
: T;
|
|
38
|
-
|
|
39
|
-
export type ExpandUnion<T> = IsUnion<T> extends true
|
|
40
|
-
? TupleToUnion<
|
|
41
|
-
ExpandTuple<UnionToTuple<T>>
|
|
42
|
-
>
|
|
43
|
-
: T
|
|
44
|
-
;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Recursively goes over an object based structure and tries to reduce
|
|
48
|
-
* it down to just a simple key/value type.
|
|
49
|
-
*/
|
|
50
|
-
export type ExpandRecursively<T> = T extends Dictionary
|
|
51
|
-
? { [K in keyof T]: T[K] extends AnyFunction
|
|
52
|
-
? T[K] extends TypedFunction
|
|
53
|
-
? ExpandParameters<T[K], Parameters<T[K]>>
|
|
54
|
-
: T[K]
|
|
55
|
-
: ExpandRecursively<T[K]>
|
|
56
|
-
}
|
|
57
|
-
: T;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Recursively goes over an object based structure and tries to reduce
|
|
61
|
-
* it down to just a simple key/value type.
|
|
62
|
-
*/
|
|
63
|
-
export type ExpandDictionary<T> = T extends Dictionary
|
|
64
|
-
? { [K in keyof T]: T[K] extends AnyFunction
|
|
65
|
-
? T[K]
|
|
66
|
-
: ExpandRecursively<T[K]>
|
|
67
|
-
}
|
|
68
|
-
: T;
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { Constant } from "inferred-types/dist/constants/index";
|
|
2
|
-
import { EmptyObject,
|
|
3
|
-
Dictionary,
|
|
4
|
-
ObjectKey,
|
|
5
|
-
Tuple,
|
|
6
|
-
IsEqual,
|
|
7
|
-
Contains,
|
|
8
|
-
Keys,
|
|
9
|
-
Values,
|
|
10
|
-
HandleDoneFn,
|
|
11
|
-
AfterFirst,
|
|
12
|
-
First,
|
|
13
|
-
AsDictionary,
|
|
14
|
-
TupleToUnion,
|
|
15
|
-
ExpandDictionary,
|
|
16
|
-
NarrowableScalar,
|
|
17
|
-
ShapeCallback,
|
|
18
|
-
UnionElDefn,
|
|
19
|
-
SimpleToken,
|
|
20
|
-
AsType
|
|
21
|
-
} from "inferred-types/dist/types/index";
|
|
22
|
-
|
|
23
|
-
type HandleObject<
|
|
24
|
-
TObj extends Dictionary,
|
|
25
|
-
TKeys extends readonly unknown[],
|
|
26
|
-
TResult extends Dictionary = EmptyObject
|
|
27
|
-
> = [] extends TKeys
|
|
28
|
-
? ExpandDictionary<TResult>
|
|
29
|
-
: HandleObject<
|
|
30
|
-
TObj,
|
|
31
|
-
AfterFirst<TKeys>,
|
|
32
|
-
First<TKeys> extends keyof TObj
|
|
33
|
-
? TObj[First<TKeys>] extends ShapeCallback
|
|
34
|
-
? Record<
|
|
35
|
-
First<TKeys>,
|
|
36
|
-
HandleDoneFn<ReturnType< TObj[First<TKeys>] >>
|
|
37
|
-
> & TResult
|
|
38
|
-
: TObj[First<TKeys>] extends SimpleToken
|
|
39
|
-
? Record<
|
|
40
|
-
First<TKeys>,
|
|
41
|
-
AsType<TObj[First<TKeys>]>
|
|
42
|
-
> & TResult
|
|
43
|
-
: Record<
|
|
44
|
-
First<TKeys>,
|
|
45
|
-
TObj[First<TKeys>]
|
|
46
|
-
> & TResult
|
|
47
|
-
: never
|
|
48
|
-
>;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
type ProcessUnion<
|
|
52
|
-
T extends UnionElDefn
|
|
53
|
-
> = T extends Tuple
|
|
54
|
-
? TupleToUnion<T>
|
|
55
|
-
: T extends ShapeCallback
|
|
56
|
-
? HandleDoneFn<ReturnType<T>>
|
|
57
|
-
: never;
|
|
58
|
-
type IterateUnion<T extends readonly UnionElDefn[]> = {
|
|
59
|
-
[K in keyof T]: ProcessUnion<T[K]>
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* **AsUnion**
|
|
64
|
-
*
|
|
65
|
-
* Receives a `UnionTokenSet`, a `ShapeCallback` or just a tuple of values
|
|
66
|
-
* and makes this into _union type_.
|
|
67
|
-
*/
|
|
68
|
-
export type AsUnion<T extends UnionElDefn | readonly [UnionElDefn, ...UnionElDefn[]]> = T extends UnionElDefn[]
|
|
69
|
-
? TupleToUnion<IterateUnion<T>>
|
|
70
|
-
: T extends UnionElDefn
|
|
71
|
-
? ProcessUnion<T>
|
|
72
|
-
: never;
|
|
73
|
-
|
|
74
|
-
export type IsDictionaryDefinition<T> = T extends Dictionary
|
|
75
|
-
? Contains<Values<T>, ShapeCallback>
|
|
76
|
-
: false;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* converts non-tuple definition types to actual type
|
|
80
|
-
*/
|
|
81
|
-
type ToType<
|
|
82
|
-
T,
|
|
83
|
-
TElse
|
|
84
|
-
> = [T] extends [ShapeCallback]
|
|
85
|
-
? HandleDoneFn<ReturnType<T>>
|
|
86
|
-
: [IsDictionaryDefinition<T>] extends [true]
|
|
87
|
-
? HandleObject<AsDictionary<T>, Keys<AsDictionary<T>>>
|
|
88
|
-
: T extends SimpleToken
|
|
89
|
-
? AsType<T>
|
|
90
|
-
: IsEqual<TElse, Constant<"not-set">> extends true
|
|
91
|
-
? T
|
|
92
|
-
: TElse extends SimpleToken
|
|
93
|
-
? AsType<TElse>
|
|
94
|
-
: TElse;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* iterates over tuple definition types to convert into real types
|
|
100
|
-
*/
|
|
101
|
-
type IterateOverDefinitions<
|
|
102
|
-
T extends readonly unknown[],
|
|
103
|
-
TElse
|
|
104
|
-
> = {
|
|
105
|
-
[K in keyof T]: ToType<T[K], TElse>;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export type TypeDefinition = NarrowableScalar | ShapeCallback;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* **DictShapeDefn**`<T>`
|
|
113
|
-
*
|
|
114
|
-
* A _dictionary_ shape which provides direct value input or use of
|
|
115
|
-
* the `ShapeCallback` API to any of the dictionaries values.
|
|
116
|
-
*
|
|
117
|
-
* Use of the generic `T` is not required but adding it as a separate
|
|
118
|
-
* generic will increase the narrowness of your types.
|
|
119
|
-
*/
|
|
120
|
-
export type DictTypeDefinition<
|
|
121
|
-
V extends TypeDefinition = TypeDefinition
|
|
122
|
-
> = Record<
|
|
123
|
-
ObjectKey,
|
|
124
|
-
V
|
|
125
|
-
>;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* **FromDefn**`<T, [TElse]>`
|
|
130
|
-
*
|
|
131
|
-
* Takes either a singular `T` or a tuple of values for `T` and
|
|
132
|
-
* looks for any cases where a `ShapeCallback` is found:
|
|
133
|
-
*
|
|
134
|
-
* - where it is found, it will resolve the type
|
|
135
|
-
* - if the type is a `SimpleToken` then this too is resolved
|
|
136
|
-
* - in other cases it simply proxies the values through
|
|
137
|
-
* - if `TElse` is set you can redirect values which don't use
|
|
138
|
-
* the ShapeCallback API to a specific type.
|
|
139
|
-
*
|
|
140
|
-
* Note: when dictionary objects are found the _values_ will be
|
|
141
|
-
* interrogated for ShapeCallback's.
|
|
142
|
-
*/
|
|
143
|
-
export type FromDefn<
|
|
144
|
-
T,
|
|
145
|
-
TElse = Constant<"not-set">
|
|
146
|
-
> = T extends readonly unknown[]
|
|
147
|
-
? IterateOverDefinitions<T,TElse>
|
|
148
|
-
: ToType<T,TElse>;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { ObjectKey } from "../base-types/ObjectKey";
|
|
2
|
-
import { IsNever } from "../boolean-logic/operators/IsNever";
|
|
3
|
-
|
|
4
|
-
export type WideTokenNames = "string"
|
|
5
|
-
| "number"
|
|
6
|
-
| "boolean"
|
|
7
|
-
| "null"
|
|
8
|
-
| "undefined"
|
|
9
|
-
| "never"
|
|
10
|
-
| "unknown"
|
|
11
|
-
| "string[]"
|
|
12
|
-
| "number[]"
|
|
13
|
-
| "boolean[]"
|
|
14
|
-
| "unknown[]";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export type ConvertWideTokenNames<T extends WideTokenNames> = T extends "string"
|
|
18
|
-
? string
|
|
19
|
-
: T extends "number"
|
|
20
|
-
? number
|
|
21
|
-
: T extends "boolean"
|
|
22
|
-
? boolean
|
|
23
|
-
: T extends "null"
|
|
24
|
-
? null
|
|
25
|
-
: T extends "undefined"
|
|
26
|
-
? undefined
|
|
27
|
-
: T extends "never"
|
|
28
|
-
? never
|
|
29
|
-
: T extends "unknown"
|
|
30
|
-
? unknown
|
|
31
|
-
: T extends "string[]"
|
|
32
|
-
? string[]
|
|
33
|
-
: T extends "number[]"
|
|
34
|
-
? number[]
|
|
35
|
-
: T extends "boolean[]"
|
|
36
|
-
? boolean[]
|
|
37
|
-
: T extends "unknown[]"
|
|
38
|
-
? unknown[]
|
|
39
|
-
: never;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export type WideContainerNames = "object"
|
|
43
|
-
| "Dictionary"
|
|
44
|
-
| "Map"
|
|
45
|
-
| "Set"
|
|
46
|
-
| "WeakMap";
|
|
47
|
-
|
|
48
|
-
type ConvertWideContainerNames<T extends WideContainerNames> = T extends "object"
|
|
49
|
-
? object
|
|
50
|
-
: T extends "Dictionary"
|
|
51
|
-
? Record<ObjectKey,unknown>
|
|
52
|
-
: T extends "Map"
|
|
53
|
-
? Map<unknown,unknown>
|
|
54
|
-
: T extends "Set"
|
|
55
|
-
? Set<unknown>
|
|
56
|
-
: T extends "WeakMap"
|
|
57
|
-
? WeakMap<object, unknown>
|
|
58
|
-
: never;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* **FromWideTokens**`<T, [TElse]>`
|
|
62
|
-
*
|
|
63
|
-
* Looks for `WideContainerNames` or `WideTokenNames` and converts them to
|
|
64
|
-
* the type they describe. If it is `T` is not any of these tokens it is
|
|
65
|
-
* simply proxied through.
|
|
66
|
-
*
|
|
67
|
-
* If you'd prefer to setup a different type for when no token is matched
|
|
68
|
-
* you can add it under `TElse`.
|
|
69
|
-
*/
|
|
70
|
-
export type FromWideTokens<
|
|
71
|
-
T,
|
|
72
|
-
TElse = never
|
|
73
|
-
> = T extends WideTokenNames | WideContainerNames
|
|
74
|
-
? T extends WideTokenNames
|
|
75
|
-
? ConvertWideTokenNames<T>
|
|
76
|
-
: T extends WideContainerNames
|
|
77
|
-
? ConvertWideContainerNames<T>
|
|
78
|
-
: never
|
|
79
|
-
: IsNever<TElse> extends true
|
|
80
|
-
? T
|
|
81
|
-
: TElse
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Narrowable } from "./Narrowable";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* **Narrow**
|
|
5
|
-
*
|
|
6
|
-
* Just like the `Narrowable` type, this type is used in the _extends_
|
|
7
|
-
* clause during runtime to extract the narrowest types possible. Unlike
|
|
8
|
-
* the `Narrowable` type, **Narrow** _excludes_ **symbols**.
|
|
9
|
-
*/
|
|
10
|
-
export type Narrow = Exclude<Narrowable, symbol>;
|