Log in Sign up
3 Matching Annotations
  1. Aug 2021
  2. stackoverflow.com stackoverflow.com
    As const is ignored when there is a type definition
    1
    1. TylerRick 24 Aug 2021
      in Public
      This could be achieved using a dummy validating function. const validateType = <T> (obj:T) => undefined
      null/empty/no-op
    Visit annotations in context

    Tags

    • null/empty/no-op

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/57069802/as-const-is-ignored-when-there-is-a-type-definition
  3. github.com github.com
    [Feature request] allow use `as const` + `type` or `interface` · Issue #31062 · microsoft/TypeScript
    1
    1. TylerRick 24 Aug 2021
      in Public
      <ITest>foo; //a useless javascript line, but checks the var `foo` is assignable to `ITest`
      null/empty/no-op
    Visit annotations in context

    Tags

    • null/empty/no-op

    Annotators

    • TylerRick

    URL

    github.com/microsoft/TypeScript/issues/31062
  4. stackoverflow.com stackoverflow.com
    Why must a type predicate's type be assignable to its parameter's type?
    1
    1. TylerRick 24 Aug 2021
      in Public
      If you really don't want to use any, you could use an empty interface - {} - instead:
      TypeScript: interface null/empty/no-op
    Visit annotations in context

    Tags

    • TypeScript: interface
    • null/empty/no-op

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/50421015/why-must-a-type-predicates-type-be-assignable-to-its-parameters-type
Share:
Group. Only group members will be able to view this annotation.
Only me. No one else will be able to view this annotation.
Hypothes.is
  • About
  • Blog
  • Bioscience
  • Education
  • Jobs
  • Help
  • Contact
  • Terms of Service
  • Privacy Policy