0.0.1 • Published 4 years ago

@znemz/types v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

@znemz/types

ModifiedType

interface OriginalType {
  a: string;
  b: boolean;
  c: number;
}

type ModifiedType = Modify<
  OriginalType,
  {
    a: number;
    b: number;
  }
>;

// ModifiedType = { a: number; b: number; c: number; }

cast

Syntax sugar to force a type casting to unknown and then to desired type.

  type A;
  type B;

  const b:B = ....
  const bIsNowA = cast<A>(b);

External modules