Typescript glossary Page

TypeScript Glossary



In part excerpted from Learning TypeScript by Josh Goldberg Glossary

Return to TypeScript glossary - JavaScript glossary, TypeScript, TypeScript DevOps - JavaScript DevOps, TypeScript topics - JavaScript topics, TypeScript bibliography - JavaScript bibliography - Web development bibliography

" (LrnTS 2022)


TypeScript Glossary

* Ambient Context - TypeScript Ambient Context - "An area in code where you can declare types but cannot declare implementations. Generally used in reference to .d.ts declaration files." (LrnTS 2022). See Also Declaration File

* Any - TypeScript Any - "any: a type that is allowed to be used anywhere and can be given anything. any can act as a top type, in that any type can be provided to a location of type any. Most of the time you probably want to use unknown for more accurate type safety." (LrnTS 2022). See Also Unknown, Top Type

* Argument - TypeScript Argument - "Something being provided as an input, used to refer to a value being passed to a function. For functions, an argument is the value being passed to a call, while a parameter is the value inside the function." (LrnTS 2022). See Also Parameter

* Assignable, Assignability - TypeScript Assignable, TypeScript Assignability - "Whether one type is allowed to be used in place of another." (LrnTS 2022)

* Billion Dollar Mistake]] - TypeScript Billion Dollar Mistake]] - "The catchy industry term for many type systems allowing values such as null to be used in places that require a different type. Coined by Tony Hoare in reference to the amount of damage it seems to have caused." (LrnTS 2022). See Also Strict Null Checking

* Bottom Type - TypeScript Bottom Type - "A type that has no possible values — the empty set of types. No type is assignable to the bottom type. TypeScript provides the never keyword to indicate a bottom type." (LrnTS 2022). See Also Never.

* Call Signature - TypeScript Call Signature - "Type system description of how a function may be called. Includes a list of parameters and a return type." (LrnTS 2022)

* Camel Case - TypeScript Camel Case - "A naming convention where the first letter of each compound word after the first in a name is capitalized, like camelCase. The convention for names of members in many TypeScript type system constructs, including members of classes and interfaces." (LrnTS 2022)

* Cast, Type Cast - TypeScript Cast]], TypeScript Type Cast - "An assertion to TypeScript that a value is of a different type than what TypeScript would otherwise expect." (LrnTS 2022)

* Class - TypeScript Class - "JavaScript syntax sugar around functions that assign to a prototype. TypeScript allows working with JavaScript classes." (LrnTS 2022)

* Compile - TypeScript Compile - "Turn source code into another format. TypeScript includes a compiler that turns .ts/.tsx TypeScript source code into .js files." (LrnTS 2022). See Also Transpile

* Conditional Type - TypeScript Conditional Type - "A type that resolves to one of two possible types, based on an existing type." (LrnTS 2022)

* Const Assertion - TypeScript Const Assertion - "as const type assertion shorthand that tells TypeScript to use the most literal, readonly possible form of a value’s type." (LrnTS 2022)

* Constituent, Constituent Type - TypeScript Constituent, TypeScript Constituent Type - "One of the types in an intersection or union type." (LrnTS 2022)

* Declaration File - TypeScript Declaration File - "A file with the .d.ts extension. Declaration files create an ambient context, meaning they can only declare types and cannot declare implementations." (LrnTS 2022). See Also Ambient Context

* Declaration File - TypeScript Declaration File - "An experimental JavaScript proposal to allow annotating a class or class member with a function marked by a @. Doing so would have the function be run on that class or class member upon creation." (LrnTS 2022)

* Dynamically Typed, Dynamic Typing]] - TypeScript Dynamically Typed, TypeScript Dynamic Typing]] - "A classification of programming language that does not natively include a type checker. Examples of dynamically typed programming languages include JavaScript and Ruby." (LrnTS 2022)

* DefinitelyTyped - TypeScript DefinitelyTyped - "The massive repository of community-authored type definitions for packages (DT for short). It contains thousands of .d.ts definitions along with automation around reviewing change proposals and publishing updates. Those definitions are published as packages under the @types/ organization on npm, such as @types/react." (LrnTS 2022)

* Derived Interface - TypeScript Derived Interface - "An interface that extends at least one other interface, referred to as a base interface. Doing so copies all the members of the base interface into the derived interface." (LrnTS 2022)

* Discriminant - TypeScript Discriminant]] - "The member of a discriminated union that has the same name but different value in each constituent type. In type Color = { result: string, status: 0 } | { error: Error, status: 1 }, the status member acts as the discriminant." (LrnTS 2022)

* Discriminated Union, Discriminated Type Union - TypeScript Discriminated Union, TypeScript Discriminated Type Union - "A union of types where a “discriminant” member exists with the same name but different value in each constituent type. Checking the value of the discriminant acts as a form of type narrowing." (LrnTS 2022)

* Distributivity - TypeScript Distributivity]] - "A property of TypeScript’s conditional types when given union template types: meaning their resultant type will be a union of applying that conditional type to each of the constituents (types in the union type). In other words, ConditionalType is the same as Conditional | Conditional." (LrnTS 2022)

* Duck [[Typed - TypeScript Duck Typed - "A common phrase for how JavaScript’s type system behaves. It comes from the phrase “if it looks like a duck and quacks like a duck, it’s probably a duck”. It means that JavaScript allows any value to be passed anywhere; if an object is asked for a member that doesn’t exist, the result will be undefined." (LrnTS 2022). See Also Structurally Typed

* Emit, Emitted [[Code - TypeScript Emit]], TypeScript Emitted Code - "The output from a compiler, such as .js files often produced by running tsc. The TypeScript compiler’s JavaScript and/or definition file emits can be controlled by its compiler options." (LrnTS 2022)

* Enum - TypeScript Enum]] - "A set of literal values stored in an object with a friendly name for each value. Enums are a rare example of TypeScript-specific syntax extension to vanilla JavaScript." (LrnTS 2022)

* Evolving Any - TypeScript Evolving Any]] - "A special case of implicit any for variables who don’t have a type annotation or initial value. Their type will be evolved to whatever they are used with." (LrnTS 2022). See Also Implicit Any

* Extending an Interface - TypeScript Extending an Interface - "When an interface declares that it extends another interface. Doing so copies all members of the original interface into the new one." (LrnTS 2022). See Also Interface

* Function Overload, Over[[loaded Function - TypeScript Function Overload, TypeScript Overloaded Function - "A way to describe a function able to be called with drastically different sets of parameters." (LrnTS 2022)

* Generic - TypeScript Generic - "Allowing a different type to be substituted for a construct each time a new usage of the construct is created. Classes, interfaces, and type aliases may be made generic." (LrnTS 2022)

* Generic Type Argument, Type Argument - TypeScript Generic Type Argument, TypeScript Type Argument - "A substituted type for a generic. Generic type arguments may be different for each instance of the construct but will remain consistent within that instance." (LrnTS 2022)

* Global Variable - TypeScript Global Variable - "A variable that exists in the global scope, such as setTimeout in environments such as browsers, Deno, and Node." (LrnTS 2022)

* IDE, Integrated [[Development Environment - TypeScript IDE, TypeScript Integrated Development Environment - "Program that provides developer tooling on top of a text editor for source code. IDEs generally come with debuggers, syntax highlighting, and plugins that surface complaints from programming languages such as type errors. This book uses VS Code for its IDE examples but others include Atom, Emacs, Vim, Visual Studio, and WebStorm." (LrnTS 2022)

* Implementation Signature - TypeScript Implementation Signature - "The final signature declared on an overloaded function, used for its implementation’s parameters." (LrnTS 2022). See Also Function Overload

* Implicit Any - TypeScript Implicit Any]] - "When TypeScript cannot immediately deduce the type of a class property, function parameter, or variable, it implicitly assumes the type to be any. Implicit any types for class properties and function parameters may be configured to be type errors using the noImplicitAny compiler option." (LrnTS 2022)

* Interface - TypeScript Interface - "A named set of properties. TypeScript will know value that’s declared to be of a particular interface’s type will have that interface’s declared properties." (LrnTS 2022)

* Interface Merging - TypeScript Interface Merging - "A property of interfaces that when multiple with the same name are declared in the same scope, they combine into one interface instead of causing a type error about conflicting names. This is most commonly used by definition authors to augment global interfaces such as Window." (LrnTS 2022)

* Inter[[section Type - TypeScript Intersection Type - "A type that uses the & operator to indicate it has all the properties of both its constituents." (LrnTS 2022)

* JSDoc - TypeScript JSDoc - "A standard for /** ... */ block comments that describe pieces of code such as classes, functions, and variables. Often used in JavaScript projects to roughly describe types." (LrnTS 2022)

* Literal - TypeScript Literal - "A value that is known to be a distinct instance of a primitive." (LrnTS 2022)

* Mapped [[Types]] - TypeScript Mapped Types]] - "A type that takes in another type and performs some operation on each member of that type. In other words, it maps from members of one type into a new set of members." (LrnTS 2022)

* Module - TypeScript Module - "A file with a top-level export or import. These are generally either files in your source code or files in node_modules/ packages." (LrnTS 2022). See Also Script.

* Module Resolution - TypeScript Module Resolution - "The set of steps used to determine what file a module import resolves to. The TypeScript compiler can have this specified by its moduleResolution compiler option." (LrnTS 2022)

* Namespace]] - TypeScript Namespace]] - "An old construct in TypeScript that creates a globally available object with “exportedcontents available to call as members of that object. Namespaces are a rare example of TypeScript-specific syntax extension to vanilla JavaScript. These days they’re mostly used in .d.ts declaration files." (LrnTS 2022)

* never - TypeScript never]] - "The TypeScript type representing the bottom type: a type that can have no possible values." (LrnTS 2022). See Also Bottom Type.

* Non-[[Null Assertion - TypeScript Non-Null Assertion - "A shorthand ! that asserts a type is not null or undefined." (LrnTS 2022)

* Null - TypeScript Null - "One of the two primitive types in JavaScript that represents a lack of value. null represents an intentional lack of value while undefined represents a more general lack of value." (LrnTS 2022). See Also Undefined.

* Optional - TypeScript Optional - "A function parameter, class property, or member of an interface or object type that doesn’t need to be provided. Indicated by placing a ? after its name, or for function parameters and class properties, alternately by providing a default value with a =." (LrnTS 2022)

* Over[[load Signature - TypeScript Overload Signature - "One of the signatures declared on an overloaded function to describe a way it may be called." (LrnTS 2022). See Also Function Overload

* Override - TypeScript Override]] - "Redeclaring a property on a subclass, derived interface, object that already exists on the base." (LrnTS 2022)

* Parameter - TypeScript Parameter - "A received input, commonly referring to what a function declares. For functions, an argument is the value being passed to a call, while a parameter is the value inside the function." (LrnTS 2022). See Also Argument

* Parameter Property - TypeScript Parameter Property - "A TypeScript syntax extension for declaring a property assigned to a member property of the same type at the beginning of a class constructor." (LrnTS 2022)

* Pascal Case - TypeScript Pascal Case - "A naming convention where the first letter of each compound word in a name is capitalized, like PascalCase. The convention for names of many TypeScript type system constructs, including generics, interfaces, and type aliases." (LrnTS 2022)

* Project References]] - TypeScript Project References]] - "A feature of TypeScript configuration files where they can reference other configuration files’ projects as dependencies. This allows you to use TypeScript as a build coordinator to enforce a project dependency tree." (LrnTS 2022)

* Primitive - TypeScript Primitive - "An immutable data type built into JavaScript that is not an object. They are: null, undefined, boolean, string, number, bigint, and symbol." (LrnTS 2022)

* Privacy, Private Field - TypeScript Privacy, TypeScript Private Field - "A feature of JavaScript where class members whose names begin with # can only be accessed inside that same class." (LrnTS 2022)

* Readonly - TypeScript Readonly - "A TypeScript type system feature where adding the readonly keyword in front of a class or object member indicates it can’t be reassigned." (LrnTS 2022)

* Rick Roll - "An internet meme where users are tricked into listening to and/or watching a music video of Rick Astley’s seminal classic “Never Gonna Give You Up”. I have hidden several in this book." (LrnTS 2022) See Also https://joshuakgoldberg.com/what-is-rick-rolling

* Refactor - TypeScript Refactor - "A change to code that keeps most or all of its behaviors the same. The TypeScript language service is able to perform some refactors on source code when asked, such as moving complex lines of code into a const variable." (LrnTS 2022)

* Return Type - TypeScript Return Type - "The type that must be returned by a function. If multiple return statements exist in the function with different types, it will be a union of all those possible types. If the function cannot possibly return, it will be never." (LrnTS 2022)

* Script - TypeScript Script - "Any source code file that is not a module." (LrnTS 2022). See Also Module.

* Strict Mode - TypeScript Strict Mode - "A collection of compiler options that increase the amount of strictness and number of checks the TypeScript type checker performs. This can be enabled for tsc with the --strict flag and in TSConfiguration files with the "strict": true compilerOption." (LrnTS 2022)

* Strict Null Checking - TypeScript Strict Null Checking - "A strict mode for TypeScript where null and undefined are no longer allowed to be provided to types that don’t explicitly include them." (LrnTS 2022). See Also Billion Dollar Mistake]]

* Structurally Typed - TypeScript Structurally Typed - "A type system where any value that happens to satisfy a type is allowed to be used as an instance of that type." (LrnTS 2022). See Also Duck [[Typed

* Subclass - TypeScript Subclass - "A class that extends another class, referred to as a base class. Doing so copies members of the base class’s prototype to the child class’s." (LrnTS 2022)

* Target - TypeScript Target - "The TypeScript compiler option to specify how far back in syntax support JavaScript code needs to be transpiled, such as es5 or es2017. Although target defaults to es3 for backwards compatibility reasons, it’s advisable use as new JavaScript syntax as possible per your target platform(s), as supporting newer JavaScript features in older environments necessitates creating more JavaScript code." (LrnTS 2022)

* Thenable - TypeScript Thenable - "A JavaScript object with a .then method that takes in up to two callback functions and returns another Thenable. Most commonly implemented by the built-in Promise class but user-defined classes and objects can work like a Thenable as well." (LrnTS 2022)

* Transpile - TypeScript Transpile - "A term for compilation that turns source code from one human-readable programming language into another. TypeScript includes a compiler that turns .ts/.tsx TypeScript source code into .js files, which is sometimes referred to as transpilation." (LrnTS 2022). See Also Compile

* Top Type - TypeScript Top Type - "A type that can represent any possible type in a system." (LrnTS 2022). See Also Any, Unknown

* TSConfig - TypeScript TSConfig - "A JSON configuration file for TypeScript. Most commonly named tsconfig.json or in the pattern tsconfig.*.json. Editors such as VS Code will read from a tsconfig.json file in a directory to determine TypeScript language service configuration options." (LrnTS 2022)

* Tuple - TypeScript Tuple - "An array of a fixed size where each element is given an explicit type. For example, number, string | undefined is a tuple of size 2 where the first element is type number and the second element is type string | undefined." (LrnTS 2022)

* Type - TypeScript Type - "An understanding of what members and capabilities a value has. These can be primitives such as string, literals such as 123, or more complex shapes like functions and objects." (LrnTS 2022)

* Type Annotation - TypeScript Type Annotation - "An annotation after a name used to indicate its type. Consists of `: ` and the name of a type." (LrnTS 2022)

* Type Guard - TypeScript Type Guard - "A piece of runtime logic that can be understood in the type system to only allow some logic if a value is a particular type." (LrnTS 2022)

* Type Narrowing - TypeScript Type Narrowing - "When TypeScript can deduce a more specific type for a value inside a block of code that is gated on a type guard." (LrnTS 2022)

* Type system - TypeScript Type system - "The set of rules for how a programming language understands what types the constructs in a program may have." (LrnTS 2022)

* Undefined - TypeScript Undefined - "One of the two primitive types in JavaScript that represents a lack of value. null represents an intentional lack of value while undefined represents a more general lack of value." (LrnTS 2022). See Also Null.

* Unknown - TypeScript Unknown - "The TypeScript concept representing the top type. unknown does not allow arbitrary member access without type narrowing." (LrnTS 2022). See Also Any, Top Type

* Union - TypeScript Union - "A type describing a value that can be two or more possible types. Represented by the | pipe between each possible type." (LrnTS 2022)

* Type Predicate - TypeScript Type Predicate - "A function with a return type annotated to act as a type guard. Type predicate functions return a boolean value that indicates whether a value is a type." (LrnTS 2022)

* Visibility - TypeScript Visibility]] - "Specifying whether a class member is visible to code outside the class. Indicated before the member’s declaration with the public, protected, and private keywords. Visibility and its keywords predate JavaScript’s true # member privacy and exist only in the TypeScript type system." (LrnTS 2022). See Also Privacy.

* Void - [[TypeScript Void - "A type indicating the lack of returned value from a function, represented by the void keyword in TypeScript. Functions are thought of as returning void if they have no return statements that return a value." (LrnTS 2022)


Fair Use Sources


Fair Use Sources:
* 1098110331 (LrnTS 2022)

{{navbar_typescript}}

{{navbar_footer}}