Why doesn't typescript have a throws type to annotate functions that can throw an error?

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • It has been extensively discussed: https://github.com/microsoft/TypeScript/issues/13219

  • neverthrow

    Type-Safe Errors for JS & TypeScript

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • fp-ts

    Functional programming in TypeScript

  • Yep. In many languages you could return Either and that data structure composes nicely. Lots of ways to do that in typescript. fp-ts is my favorite. Especially nice is using Try which is a specialized version of Either.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • TypeScript: why you shouldn't throw errors to control the program flow

    2 projects | dev.to | 10 Apr 2023
  • Question about error handling in Typescript

    3 projects | /r/typescript | 20 Aug 2022
  • How to use advanced Typescript to define a `pipe` function

    2 projects | dev.to | 11 Jun 2022
  • Help - Higher kinded types

    3 projects | /r/typescript | 24 Aug 2021
  • Is it possible to give utility types as arguments to other utlities?

    2 projects | /r/typescript | 7 Apr 2021