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.
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.
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?
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: Exploring the Functor type class and its use cases