# tc39/proposal-type-annotations

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tc39-proposal-type-annotations).**

4,386 stars · 52 forks · JavaScript

## Links

- GitHub: https://github.com/tc39/proposal-type-annotations
- Homepage: https://tc39.es/proposal-type-annotations/
- awesome-repositories: https://awesome-repositories.com/repository/tc39-proposal-type-annotations.md

## Description

This is an ECMAScript proposal that adds static type syntax to JavaScript, enabling type checking without a separate transpilation step. The proposal defines a standard for type annotations, interfaces, generics, and type imports and exports that are stripped during execution, allowing code to run natively in existing JavaScript engines while still being validated by external type checkers.

The proposal introduces generic type parameters using angle-bracket syntax on functions, classes, and type declarations, which are removed at runtime. It also provides syntax for type annotations on variables, parameters, class members, and function signatures, all of which are treated as non-executable metadata. Additional capabilities include type assertions, optional parameter marking, typed `this` parameters, and reusable type aliases created with `type` and `interface` declarations.

Type definitions can be shared across modules using `import type` and `export type` statements that are ignored at runtime and do not trigger module resolution. The proposal covers class member type annotations, generic type argument specification, and generic type parameter declaration, all designed to be stripped away during execution.

## Tags

### Programming Languages & Runtimes

- [ECMAScript Type Specifications](https://awesome-repositories.com/f/programming-languages-runtimes/ecmascript-type-specifications.md) — Defines a standard for type syntax, interfaces, generics, and type imports/exports stripped at runtime.
- [Runtime-Stripped Generic Parameters](https://awesome-repositories.com/f/programming-languages-runtimes/generic-types/runtime-stripped-generic-parameters.md) — Introduces angle-bracket generic type parameters that are removed during execution.
- [Variable Type Declarations](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/type-system-tools/type-definitions/variable-type-declarations.md) — Attaches type information to variable declarations and function parameters using colon syntax. ([source](https://cdn.jsdelivr.net/gh/tc39/proposal-type-annotations@main/README.md))
- [Runtime-Ignored Type Execution](https://awesome-repositories.com/f/programming-languages-runtimes/type-annotations/runtime-ignored-type-execution.md) — Treats type annotations on variables, parameters, and class members as non-executable metadata.
- [Type Annotation Stripping](https://awesome-repositories.com/f/programming-languages-runtimes/type-annotations/type-annotation-stripping.md) — Annotates JavaScript with static type syntax that is stripped at runtime for direct execution. ([source](https://tc39.es/proposal-type-annotations/))
- [Explicit Type Argument Syntax](https://awesome-repositories.com/f/programming-languages-runtimes/generic-types/explicit-type-argument-syntax.md) — Provides syntax for specifying explicit type arguments in generic calls and instantiations. ([source](https://cdn.jsdelivr.net/gh/tc39/proposal-type-annotations@main/README.md))
- [Type Parameter Declaration Syntax](https://awesome-repositories.com/f/programming-languages-runtimes/generic-types/type-parameter-declaration-syntax.md) — Defines type parameters on functions, classes, and type declarations using angle brackets. ([source](https://cdn.jsdelivr.net/gh/tc39/proposal-type-annotations@main/README.md))
- [Type-Only Imports](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/type-system-tools/type-definitions/ambient-type-declarations/type-only-imports.md) — Shares type definitions across modules using import/export statements ignored at runtime. ([source](https://cdn.jsdelivr.net/gh/tc39/proposal-type-annotations@main/README.md))
- [Named Type Aliases](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/type-system-tools/type-definitions/variable-type-declarations/named-type-aliases.md) — Creates named types with `type` and `interface` declarations that are stripped at runtime. ([source](https://cdn.jsdelivr.net/gh/tc39/proposal-type-annotations@main/README.md))
- [Class Member Annotations](https://awesome-repositories.com/f/programming-languages-runtimes/type-annotations/class-member-annotations.md) — Attaches types to class properties, methods, and constructor parameters for validation. ([source](https://cdn.jsdelivr.net/gh/tc39/proposal-type-annotations@main/README.md))
- [Static Type Assertions](https://awesome-repositories.com/f/programming-languages-runtimes/type-conversion-and-casting/static-type-assertions.md) — Overrides inferred types using assertion syntax without any runtime effect. ([source](https://cdn.jsdelivr.net/gh/tc39/proposal-type-annotations@main/README.md))

### Software Engineering & Architecture

- [Non-Compiled Static Typing](https://awesome-repositories.com/f/software-engineering-architecture/typescript-type-definitions/static-type-checking/non-compiled-static-typing.md) — Adds runtime-ignored type annotations to JavaScript for static type checking without compilation.
- [Static Type Checking](https://awesome-repositories.com/f/software-engineering-architecture/typescript-type-definitions/static-type-checking.md) — Validates code with static analysis while keeping the runtime module graph free of type information.
