Skip to content

Releases: Veetaha/ts-typedefs

ts-typedefs 3.2.0

13 Dec 02:10
Compare
Choose a tag to compare
View changes

Language support

  • "typescript" package peer dependency minimum version was updated to 3.7.x

New units

  • MutuallyExclusive<> - type to declare mutually exclusive object types (union of objects discriminated by undefined property values)

ts-typedefs 3.0.0

27 Jun 11:58
Compare
Choose a tag to compare
View changes

Language support

  • Added support for typescript 3.5+.

Removed

  • Op.UnionNotIncludes<>, use Op.UnionExcludes<> instead.

Breaking changes

  • Obj<> defines an object with any value type instead of unknown value type by default. This decision was made due to the default generic type arguments behavior changes see this issue for details. Since the behavior has changed, leaving unknown as the default would prevent the library from compiling.

New units

  • TupleFirstItem<>
  • TupleLastItem<>
  • TupleShift<>
  • TuplePop<>
  • TupleUnshift<>
  • TuplePush<>

ts-typedefs 2.5.0

19 Apr 23:21
Compare
Choose a tag to compare
View hanges

Compatible changes

  • PropertyDecorator<> now accepts the second optional argument (property name limit).
  • MethodDecorator<> now accepts the third optional argument (method name limit).
  • AccessorDecorator<> now accepts the second optional argument (accessor property name limit).

Bug fixes

  • FindKeys<> and FilterProps<> respectively now do not return an object with undefined property when searching/filtering an object type with optional properties.

ts-typedefs 2.4.0

19 Apr 12:48
Compare
Choose a tag to compare
View hanges

Deprecated units

  • Removed MarkKeyOptionalIfUndefined<>

New units

  • Prototypeful<>
  • InstanceType<>
  • NonNullableProps<>
  • DeepMapValues<>
  • PickAsNonNullableProps<>

ts-typedefs 2.3.0

16 Apr 14:11
Compare
Choose a tag to compare
View hanges

Deprecated units

All deprecated units will be removed in the next minor update.

  • MarkKeyOptionalIfUndefined<> - renamed to OptionalLikelyUndefProps<>

Compatible changes

  • AccessorDecorator<> first argument is now any by default

New units

  • PickAsOptional<>
  • PickAsRequired<>
  • PickAsReadonly<>
  • PickAsMutable<>
  • PickAsNullableProps<>

Bug fixes

  • PropertyDecorator<> now takes optional properties into account.

ts-typedefs 2.2.0

11 Apr 00:01
Compare
Choose a tag to compare
View changes

Compatible changes

  • Mutable<TObj, TKeys = keyof TObj> - now accepts the second optional argument.

New units

  • IsNullable<>
  • CanBeNull<>
  • CanBeUndef<>
  • NullableProps<>
  • More flexible versions of standard typedefs:
    • Partial<TObj, TKeys = keyof TObj>
    • Required<TObj, TKeys = keyof TObj>
    • Readonly<TObj, TKeys = keyof TObj>

Bug fixes

  • Fixed definition of DeepRequired<>, now it works correctly for any nested object types.

ts-typedefs 2.1.1

04 Apr 17:23
Compare
Choose a tag to compare
View changes

Compatible changes

  • Changed ReadonlyObj<> and Obj<> TKey constraints to PropertyKey and default values to any

Internal

  • Optimized instantiation of MarkKeyOptionalIfUndefined<> type.

ts-typedefs 2.1.0

03 Apr 15:45
Compare
Choose a tag to compare
View changes

Breaking changes

  • typescript was moved from dependencies to peerDependencies.
  • Not<T, ...> type now expands to the second optional argument (never by default) instead of true when T is exactly of boolean type.
  • If<TCond, ...> type now expands to the fourth optional argument (never by default) instead of else branch when TCond is exactly of boolean type.

Compatible changes

  • Not<> now accepts the second optional argument (see in docs).
  • If<> now accepts the fourth optional argument (see in docs).

New units

  • AreSame<>
  • Is[Not]Unknown<>
  • Is[Not]Any<>
  • Is[Not]Never<>
  • NotExtends<>
  • UnionExcludes<>

Removed

  • literal(): use new value as const syntax.

Bug fixes

  • Op.UnionIncludes<TNeedle> now defines true if TNeedle is an item of the checked type union, but not on the contrary (as it was previously).

Internal

  • Refactored tests structure.
  • Removed unnecessary tsconfig.json options.

ts-typedefs 2.0.1

29 Mar 20:16
Compare
Choose a tag to compare
View changes
  • Migrated to TypeScript 3.4.1
    • Fixed breaking change: FilterProps<> argument operator tree deepness must be one level less from now as it caused Excessively deep compile error
    • literal() runtime function is deprecated, use new value as const syntax instead of literal(value)
  • Added types
    • Tag<>
    • Op.NotExtends<>
    • Op.UnionNotIncludes<>

ts-typedefs 1.4.0

24 Mar 23:06
Compare
Choose a tag to compare
View changes

Added FuncContext type to infer typeof this for the given function.