Do TypeScript Types Provide Enough Documentation On Their Own?

Do TypeScript Types Provide Enough Documentation On Their Own?

Can you learn enough from the TypeScript types for a library to use it? Let’s find out as we hack the undocumented AWS UI Toolkit.

Here is an interesting question; are the types in your TypeScript project enough documentation, on their own, to allow someone to learn the library?

That was the question I asked myself when I saw the Amazon had released a React UI library for AWS. They only released the code and the TypeScript types. No documentation. No storybook or styleguidist. Just the code and the types.

Now I love digging into UI libraries. And this was a fun challenge. Can I learn the library from just the source? So I started a Create React App using the typescript template, then installed the @awsui/components-react library and started my sleuthing.

The first thing to realize is that VS Code loves TypeScript, and in this journey it will be your invaluable partner. For example, you can right click on the import and ask for the definitions, as shown in the screenshot below.

Image for post

Using VS Code to navigate to the definitions

And that takes you to the central definitions file that lists all the components and their properties.

Image for post

Just a few of the fascinating components in the AWS UI toolkit

Jackpot! Now I know what’s in there. But how to use it?

programming javascript typescript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

What is TypeScript? Why TypeScript? and Why Not TypeScript?

TypeScript extends JavaScript by adding Types. There are many great reasons to switch to TypeScript. Especially if your team uses JavaScript. There are some reasons to not use TypeScript as there are with any language or framework.

TypeScript Tutorial For JavaScript Developers - TypeScript Basics

TypeScript Tutorial For JavaScript Developers - TypeScript Basics. I will show you guys 4 example of JavaScript code, and how to convert it to TypeScript. This is a typescript beginners tutorial.

TypeScript: A Superset of JavaScript

Multi-paradigm, Functional, Generic, Imperative, Object-Oriented. In this article, I have shared the essential information about TypeScript programming language. This article contains a basic overview, brief history, features and applications of TypeScript. TypeScript is getting more popular in Full-stack development. In terms of popularity, in the last two years TypeScript pulled ahead of Ruby, Shell, and C.

Functional Programming: Using the Functor Type Class in TypeScript

Functional Programming: Exploring the Functor type class and its use cases

JavaScript Vs TypeScript

Get to know here difference between JavaScript & TypeScript, In this blog explained with pros and cons of TypeScript & JavaScript.