Validators in a single file interface StringValidator { isAcceptable(s: string): boolean; } let
Symbol.toStringTag A String value that is used in the creation of the default string description of an object. Called by the built-in
Symbol.species A function valued property that is the constructor function that is used to create derived objects.
Writing the function type Now that we’ve typed the function, let’s write the full type of the function out by looking at the each piece of the
Classes Classes work similarly to object literal types and interfaces with one exception: they have both a static and an instance type. When
Add modules to the code Before we get to Browserify, let’s build our code out and add modules to the mix. This is the structure you’re more
Exporting a declaration Any declaration (such as a variable, function, class, type alias, or interface) can be exported by adding the export
Organizing Types Documentation The greeter object can log to a file or display
Debug In Edge, press F12 and click the Debugger tab. Look in the first localhost folder, then src/app.ts
Exhaustiveness checking We would like the compiler to tell us when we don’t cover all variants of the discriminated union. For example, if we
Page 19 of 29