Skip to content

Conversation

@orta
Copy link
Contributor

@orta orta commented Mar 4, 2021

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2021

Got false positives?

Make changes to the global settings spellcheck.json in /microsoft/TypeScript-Website.

Make changes to this repo's settings in spellcheck.json.

Typos for Enums.md

Line Typo
9 Enums are one of the few features T
11 Enums allow a developer to define a
12 Using enums can make it easier to documen
13 both numeric and string-based enums.
15 ## Numeric enums
17 first start off with numeric enums, which are probably more fami
18 An enum can be defined using the `enu
29 Above, we have a numeric enum where Up is initialized wit
45 from other values in the same enum.
47 Using an enum is simple: just access any me
47 mber as a property off of the enum itself, and declare types usi
47 e types using the name of the enum:
62 Numeric enums can be mixed in [computed and
63 The short story is, enums without initializers either n
63 or have to come after numeric enums initialized with numeric cons
63 c constants or other constant enum members.
76 ## String enums
78 String enums are a similar concept, but ha
79 In a string enum, each member has to be consta
79 teral, or with another string enum member.
90 While string enums don't have auto-incrementing
90 incrementing behavior, string enums have the benefit that they "s
91 he runtime value of a numeric enum, the value is often opaque -
91 ings) can often help), string enums allow you to give a meaningfu
91 ndependent of the name of the enum member itself.
93 ## Heterogeneous enums
95 Technically enums can be mixed with string and
108 Each enum member has a value associated
109 An enum member is considered constant
111 It is the first member in the enum and it has no initializer, in
120 initializer and the preceding enum member was a numeric consta
121 case the value of the current enum member will be the value of t
121 be the value of the preceding enum member plus one.
139 - The enum member is initialized with a
139 s initialized with a constant enum expression.
140 A constant enum expression is a subset of Typ
141 An expression is a constant enum expression if it is:
143 1. a literal enum expression (basically a strin
144 o previously defined constant enum member (which can originate f
144 an originate from a different enum)
145 3. a parenthesized constant enum expression
146 4. one of the +, -, ~ unary operators applied to constant
146 operators applied to constant enum expression
147 inary operators with constant enum expressions as operands
149 mpile time error for constant enum expressions to be evaluated t
151 In all other cases enum member is considered computed
165 ## Union enums and enum member types
165 ## Union enums and enum member types
167 a special subset of constant enum members that aren't calculate
167 at aren't calculated: literal enum members.
168 A literal enum member is a constant enum mem
168 ral enum member is a constant enum member with no initialized va
172 - a unary minus applied to any numeric
174 When all members in an enum have literal enum values, som
174 mbers in an enum have literal enum values, some special semantic
176 The first is that enum members also become types as
177 n only have the value of an enum member:
202 The other change is that enum types themselves effectively
202 vely become a union of each enum member.
203 With union enums, the type system is able to l
203 t of values that exist in the enum itself.
225 ## Enums at runtime
227 Enums are real objects that exist a
228 For example, the following enum
255 ## Enums at compile time
257 Even though Enums are real objects that exist a
257 et a Type that represents all Enum keys as strings.
286 ty names for members, numeric enums members also get a _reverse m
286 get a reverse mapping from enum values to enum names.
286 mapping_ from enum values to enum names.
310 In this generated code, an enum is compiled into an object th
311 References to other enum members are always emitted as
313 Keep in mind that string enum members do not get a revers
315 ### const enums
317 In most cases, enums are a perfectly valid solutio
319 al indirection when accessing enum values, it's possible to use
319 it's possible to use const enums.
320 Const enums are defined using the `
320 Const enums are defined using the const
320 g the const modifier on our enums:
329 Const enums can only use constant e
329 Const enums can only use constant enum ex
329 t enums can only use constant enum expressions and unlike regula
329 xpressions and unlike regular enums they are completely removed d
330 Const enum members are inlined at u
330 Const enum members are inlined at use si
331 This is possible since const enums cannot have computed me
331 This is possible since const enums cannot have computed members.
368 ## Ambient enums
370 Ambient enums are used to describe the shap
370 the shape of already existing enum types.
380 tween ambient and non-ambient enums is that, in regular enums, me
380 ent enums is that, in regular enums, members that don't have an i
380 red constant if its preceding enum member is considered constant
381 In contrast, an ambient (and non-const) enum member that does not ha
381 t, an ambient (and non-const) enum member that does not have ini
383 ## Objects vs Enums
385 peScript, you may not need an enum when an object with `as const
419 b.com/rbuckton/proposal-enum) enums are added to JavaScript then

Typos for Advanced Types.md

Line Typo
201 These _typeof type guards_ are reco
201 These typeof type **guards** are recognized in two differe
208 _instanceof type guards_ are
208 instanceof type **guards** are a way of narrowing types
209 orrow our industrial strength string-padder example from earlier:
264 The inventor of null, Tony Hoare, calls this his ["billion dol
442 const bear = getBear()
442 const bear = getBear()
443 bear.name
444 bear.honey
456 const bear = getBear();
456 const bear = getBear();
457 bear.name;
458 bear.honey;
472 const src = 'const a = "Hello World
472 const src = 'const a = "Hello World"';
472 const src = 'const a = "Hello World"';
473 window.ts.transpileModule(src, {});
473 window.ts.transpileModule(src, {});
496 ## Enum Member Types
498 mentioned in [our section on enums](./enums.html#union-enums-and
498 enums-and-enum-member-types), enum members have types when every
500 pes", we're referring to both enum member types as well as numer
505 This is called F-bounded polymorphism, a lot of people
714 Or we might want a readonly version:
820 example, if Person.name was readonly, Partial<Person>.name would
820 artial.name` would be readonly and optional.
865 as an index to an object. In otherwords, keyof any is currently equ

Typos for Understanding Errors.md

Line Typo
26 of that as TypeScript saying "_T and S are not compatible
26 TandS` are not compatible"_.

Typos for _Creating Types from Types.md

Line Typo
17 - [Keyof Type Operator](/docs/handbook
18 - [Typeof Type Operator](/docs/handbook

Typos for Typeof Type Operator.md

Line Typo
46 refer to the type that the _value f_ has, we use typeof:
46 the type that the value f**** has, we use typeof:

Typos for Template Literal Types.md

Line Typo
208 function applyStringMapping(symbol: Symbol, str: string)
208 StringMapping(symbol: Symbol, str: string) {
209 switch (intrinsicTypeKinds.get(symbol.escapedName as string)
209 witch (intrinsicTypeKinds.get(symbol.escapedName as string)) {
210 case IntrinsicTypeKind.Uppercase: return str.toUpperCase();
210 sicTypeKind.Uppercase: return str.toUpperCase();
211 case IntrinsicTypeKind.Lowercase: return str.toLowerCase();
211 sicTypeKind.Lowercase: return str.toLowerCase();
212 case IntrinsicTypeKind.Capitalize: return str.charAt(0).toUpper
212 icTypeKind.Capitalize: return str.charAt(0).toUpperCase() + str.slice(
212 italize: return str.charAt(0).toUpperCase() + str.slice(1);
212 str.charAt(0).toUpperCase() + str.slice(1);
213 case IntrinsicTypeKind.Uncapitalize: return str.charAt(0).toLower
213 TypeKind.Uncapitalize: return str.charAt(0).toLowerCase() + str.slice(
213 italize: return str.charAt(0).toLowerCase() + str.slice(1);
213 str.charAt(0).toLowerCase() + str.slice(1);
215 return str;

Typos for Generics.md

Line Typo
54 `, it's also just as precise (ie, it doesn't lose any informat
209 ot possible to create generic enums and namespaces.

Typos for Conditional Types.md

Line Typo
9 act that values can be easily introspected, those decisions are also bas
62 These overloads for createLabel describe a single JavaScript

Typos for Type Declarations.md

Line Typo
35 tputs; they are only used for typechecking.

Typos for The Handbook.md

Line Typo
11 ding trivial interactivity to webpages, JavaScript has grown to be a
11 choice for both frontend and backend applications of every size. W
13 TypeScript is to be a static typechecker for JavaScript programs - in
13 s of the program are correct (typechecked).
26 f the language's features and behaviors.
28 A reader who completes the walkthrough should be able to:
48 gure TypeScript with webpack, rollup, parcel, react, babel, closur
48 arcel, react, babel, closure, lerna, rush, bazel, preact, vue, an
48 babel, closure, lerna, rush, bazel, preact, vue, angular, svelte
48 closure, lerna, rush, bazel, preact, vue, angular, svelte, jquery
48 preact, vue, angular, svelte, jquery, yarn, or npm are out of scop
52 s between TypeScript and your favored programming language, and cle

Typos for Object Types.md

Line Typo
85 says is that if the property is set, it better have a specifi
272 g letters and packages in the U.S.
318 ate we have to write, and for signaling intent that several different
666 readonly property modifier, assignability isn't bidirectional between r
713 We can also [destructure tuples](https://developer.moz
728 to name our variables when we destructure them.
853 s tend to be created and left un-modified in most code, so annotating t

Typos for Narrowing.md

Line Typo
45 Much like how TypeScript analyzes runtime values using static t
48 that our programs can take to analyze the most specific possible ty
159 bove by checking if strs is truthy.
187 ire body of the function in a truthy check, but this has a subtle
312 h - is `string
346 TypeScript was able to analyze this code and see that the re
350 When a variable is analyzed, control flow can split off a
537 We need to communicate what we know to the type checker.

Typos for More on Functions.md

Line Typo
129 For example, a standalone version of map would look l
393 this actually means is that _callback might get invoked w
393 k` might get invoked with one argument_.
430 a Date that takes either a timestamp (one argument) or a month/day
515 value that might be a string or an array, because TypeScript
795 ## Assignability of Functions
866 - [v1 handbook](https://www.typescr

Typos for Modules.md

Line Typo
219 Script transpiler like Babel, swc or esbuild to know what impor
309 There is a mis-match in features between CommonJS

Typos for Everyday Types.md

Line Typo
39 t a particular value to cause typechecking errors.
306 ther room of Spanish speakers wearings hats, after combining those r
402 const bear = getBear()
402 const bear = getBear()
403 bear.name
404 bear.honey
416 const bear = getBear();
416 const bear = getBear();
417 bear.name;
418 bear.honey;
430 ts: TypeScriptAPI
432 const src = 'const a = "Hello World
432 const src = 'const a = "Hello World"';
432 const src = 'const a = "Hello World"';
433 window.ts.transpileModule(src, {});
433 window.ts.transpileModule(src, {});
443 ts: TypeScriptAPI
644 With strictNullChecks on, when a value is null or `u
671 ### Enums
673 Enums are a feature added to JavaSc
673 sure. You can read more about enums in the [Enum reference page](
673 read more about enums in the [Enum reference page](/docs/handboo
694 You can learn more about BigInt in [the TypeScript 3.2 releas

Typos for Classes.md

Line Typo
42 n is optional, but will be an implict any if not specified.
92 TypeScript does not analyze methods you invoke from the c
278 Like other langauges with object-oriented features
503 As a result, subclassing Error, Array, and others
504 , and the like use ECMAScript 6's new.target to adjust the pr
645 lass/) which explains more of C#'s reasoning.
851 having some peculiar runtime behaviors.
1230 ith no members is generally a supertype of anything else.

Typos for Basics.md

Line Typo
10 ue in JavaScript has a set of behaviors you can observe from running
52 of the value - what sorts of behaviors and capabilities it has.
82 ght have ended up doing large refactorings and adding a lot of different
86 tems_ describe the shapes and behaviors of what our values will be wh
196 to automatically fix errors, refactorings to easily re-organize code, a
197 rm, so it's likely that [your favorite editor has TypeScript support
226 Tada!
228 Wait, "tada" what exactly?
275 you can run, and so there's a tradeoff on what sorts of things a typ
346 de class="query">code comment colored like this it mea
390 cript called ECMAScript 2015 (a.k.a. ECMAScript 6, ES2015, ES6, et
391 ECMAScript 3 or ECMAScript 5 (a.k.a. ES3 and ES5).

Typos for Literal Types.md

Line Typo
13 today: strings, numbers, and booleans; by using literal types you c
36 hese features together to get enum-like behavior with strings.

Typos for Interfaces.md

Line Typo
11 "duck typing" or "structural subtyping".
109 ## Readonly properties
187 to createSquare is spelled ****colour instead of color.
644 When interacting with 3rd-party JavaScript, you may need to u

Typos for Generics.md

Line Typo
56 `, it's also just as precise (ie, it doesn't lose any informat
211 ot possible to create generic enums and namespaces.

Typos for Functions.md

Line Typo
12 key role in describing how to do things.
250 avaScript, though, first read Yehuda Katz's [Understanding JavaScr
251 Yehuda's article explains the inner wo

Typos for Classes.md

Line Typo
71 ase classes are often called superclasses.
138 hat each member be explicitly labeled public to be visible.
303 ## Readonly modifier
305 You can make properties readonly by using the readonly keywo
306 Readonly properties must be initialize
325 example, we had to declare a readonly member name and a construct
401 o prove to ourselves that our accessor is now checking the length of

Typos for Basic Types.md

Line Typo
15 The most basic datatype is the simple true/false valu
23 ther floating point values or BigIntegers.
24 get the type number, while BigIntegers get the type bigint.
38 ng programs in JavaScript for webpages and servers alike is working
39 ng` to refer to these textual datatypes.
49 re surrounded by the backtick/backquote (`) character, and embe
129 ## Enum
131 dition to the standard set of datatypes from JavaScript is the enum
132 As in languages like C#, an enum is a way of giving more frien
143 By default, enums begin numbering their members
156 lly set all the values in the enum:
167 A handy feature of enums is that you can also go from
167 the name of that value in the enum.
168 that mapped to in the Color enum above, we could look up the c
308 able to, every type; however, no type is a subtype of, or assi

Typos for New TypeScript Version.md

Line Typo
3 hen it'll probably take about 15-30m.
46 - Update [tsconfigRules.ts](https://github.com/microsoft
65 ion for the RC and update the dropdown to be the RC.
90 tes via this file: [packages/**typescriptlang-org**/src/lib/release-plan.json](h
90 [packages/typescriptlang-org/**src**/lib/release-plan.json](https

Typos for README.md

Line Typo
54 - [How i8n Works For Site Copy](./docs/H
60 ## TypeScriptLang-Org
69 env var NO_TRANSLATIONS as truthy will make the website only lo
123 vailable on npm: [@typescript/vfs](https://www.npmjs.com/packag
149 contact [o[email protected]](mailto:
149 contact [openco[email protected]](mailto:openc
149 contact [opencode@microsoft.com](mailto:[email protected]

Generated by 🚫 dangerJS against 85928bc

@orta orta merged commit c347f58 into v2 Mar 4, 2021
@jakebailey jakebailey deleted the new_handbook branch May 17, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants