TypeScript

Keyof for Nested Objects

Problem interface User { parent: { name: string; }; age: number; name: string; } type Column = { key: keyof User; }; const columns: Column[] = [ { key: 'name' }, { key: 'name1' }, { key:'parent.name' } ];

Jul 22, 2025

Writing TypeScript in Monaco Editor

Implementing a TypeScript editor using Monaco involves more than just setting the language. This post covers how to configure type declarations and other essential editor settings.

Jan 20, 2024

Global Type Definition Issues in Third-party Packages

When global types in third-party packages don't apply, here’s how to wire them up in TS or JS projects and the ideal @types approach.

Apr 5, 2022

Add Global Constants to a Frontend Project

Expose config from package.json into the built app via webpack DefinePlugin, with typing in TS and pitfalls to avoid.

Jan 25, 2022

Contributing TS Type Declarations to Open Source Projects

How to create, package, and reference TypeScript declaration files when contributing typings to open-source projects.

Sep 12, 2021

Lesser-Known TypeScript Types

Covers `never`, `ArrayLike`, and `PromiseLike`, when to use them, and links to further reading.

Sep 5, 2021

Extend AxiosRequestConfig in TypeScript

Use declaration merging to add custom properties (e.g., loading flags) to AxiosRequestConfig without sacrificing type safety.

Jan 11, 2021

TypeScript Enum vs. ES6 Symbol

Compares TypeScript enums and ES6 symbols so you know when to choose each for identifiers and constants.

Dec 2, 2020

Understanding TypeScript

Key takeaways about TypeScript, including use cases and implementation details, to help you work with the language more effectively.

Nov 10, 2020

Upgrading TypeScript to v4

Notes from upgrading to TypeScript 4.0—packages to bump, issues encountered, and fixes.

Oct 21, 2020

TypeScript Decorator Practice

Overview of TypeScript decorators, how to enable them, and a practical example transforming Redux action types.

May 16, 2020

Migrating from ts-loader to babel-loader

Why I switched from ts-loader to babel-loader, sample configuration, performance notes, and common questions.

May 2, 2020

Eliminating Dead Code in TS Projects

How to remove dead code in TypeScript projects with compiler settings, lint rules, and tooling so you keep the codebase lean.

Mar 29, 2020

JavaScript method vs function vs member

This article explains the differences between JavaScript methods, functions, and members, including their advantages, implementation details, and related resources. These concepts help improve efficiency in JavaScript development.

Mar 1, 2020

regeneratorRuntime is not defined

Troubleshooting the regeneratorRuntime runtime error after adding redux-saga-promise, covering root cause and fixes in Webpack and Jest.

Feb 2, 2020

Difference Between implements and extends in TypeScript

Clarifies how implements vs. extends behave in TypeScript and compares them with Java.

Jan 30, 2020

Unknown vs. Any in TypeScript

Highlights the core difference between `unknown` and `any`, with examples of type narrowing and why `unknown` is safer.

Jan 12, 2020

Duplicate identifier LibraryManagedAttributes

This article introduces the solution to the Duplicate identifier LibraryManagedAttributes error, including the advantages, implementation details, and related resources that can help improve efficiency when dealing with this TypeScript compilation issue.

Dec 24, 2019

Type Issues When Using React with TypeScript

This article introduces type issues when using React with TypeScript, including their advantages, implementation details, and relevant resources. These steps can help improve efficiency when handling React TypeScript type issues.

Oct 23, 2019

interface vs type in TypeScript

When to use interfaces vs. type aliases, what the TypeScript docs recommend, and how the ESLint/TSLint rule works.

Oct 15, 2019

JSX.Element vs React.ReactNode Comparison

This article provides a detailed comparison between JSX.Element and React.ReactNode types in React with TypeScript, including their differences, usage scenarios, and practical examples from antd source code.

Sep 28, 2019

TSLint Does Not Catch TypeScript Errors

Explains why linting alone isn’t enough—TSLint enforces style but won’t catch TypeScript type errors, so add tsc to your git hooks.

Sep 10, 2019

Type Casting vs. Type Assertions in TypeScript

Clarifies that TypeScript’s `as` syntax performs compile-time assertions, not runtime casts, and compares it with TypeScript’s type inference and Java’s casting.

Aug 18, 2019

[Translation] TypeScript vs. JavaScript: Should You Migrate Your Project to TypeScript?

This post compares TypeScript and JavaScript and discusses whether you should migrate a project to TypeScript, covering advantages, differences, and decision factors.

Jun 30, 2018

TypeScript Version Always Shows 1.0

Why `tsc --version` reported 1.0.3.0 on Windows even after installing a newer TypeScript, and how removing the SDK path fixed it.

Sep 6, 2017