Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start on updating the templates for modules #543

Merged
merged 6 commits into from
Jul 31, 2020
Merged

Start on updating the templates for modules #543

merged 6 commits into from
Jul 31, 2020

Conversation

orta
Copy link
Contributor

@orta orta commented Apr 30, 2020

No description provided.

@orta orta requested a review from sandersn April 30, 2020 19:11
@github-actions
Copy link
Contributor

github-actions bot commented Apr 30, 2020

Messages
📖

Deployed to a PR branch - playground tsconfig old handbook

Got false positives?

Make changes to the global settings spellcheck.json in /artsy/peril-settings.

Typos for module.d.ts.md

Line Typo
9 ## Common CommonJS Patterns
11 A module using CommonJS patterns uses `module.exports
52 In CommonJS you can export any value as t
58 e described by the following .d.ts:
76 One style of exporting in CommonJS is to export a function.
95 ing export default in your .d.ts files requires [`esModuleInte
125 ort many of these patterns, a CommonJS module would need to look som
186 type` in TypeScript code or [JSDoc imports](/docs/handbook/jsdoc
300 n submitting these changes to DefinitelyTyped for everyone to also use, the
304 ks, and start to fill out the index.d.ts
305 4. When you're happy, clone [DefinitelyTyped/DefinitelyTyped](https://gith
305 happy, clone [DefinitelyTyped/DefinitelyTyped](https://github.com/Definitel

Typos for module-plugin.d.ts.md

Line Typo
63 # The Impact of ES6 on Module Plugins
65 Some plugins add or modify top-level expor
66 While this is legal in CommonJS and other loaders, ES6 module

Typos for global.d.ts.md

Line Typo
22 r example, if you were using [jQuery](https://jquery.com/), the `$
68 - CommonJS/Node.js-style imports of the
68 - CommonJS/Node.js-style imports of the form `va
75 and require the DOM (or have no dependencies) may still be gl

Typos for global-plugin.d.ts.md

Line Typo
10 y popular libraries, such as [Moment.js](http://momentjs.com/), are w
11 For example, in Node.js or using RequireJS, you would
11 example, in Node.js or using RequireJS, you would write:
43 often demonstrate a "Using in Node.js" example showing require,
49 Examples include [jQuery](https://jquery.com/), [Momen
49 Query](https://jquery.com/), [Moment.js](http://momentjs.com/), [loda
49 t.js](http://momentjs.com/), [lodash](https://lodash.com/), and ma
78 ## Module Plugin or UMD Plugin
78 ## Module Plugin or UMD Plugin
80 A module plugin changes the shape of another
81 For example, in Moment.js, moment-range adds a new `r
89 ## Global Plugin
91 A global plugin is global code that changes
96 ### Identifying global plugins
98 Global plugins are generally easy to identif
126 al, they're similar to global plugins, but need a require call to
203 low is to only declare types namespaced by whatever global variable
221 # The Impact of ES6 on Module Plugins
223 Some plugins add or modify top-level expor
224 While this is legal in CommonJS and other loaders, ES6 module

Typos for global-modifying-module.d.ts.md

Line Typo
17 al, they're similar to global plugins, but need a require call to

Typos for Publishing.md

Line Typo
8 , it is time to publish it to npm.
9 ish your declaration files to npm:
11 1. bundling with your npm package
12 ps://www.npmjs.com/~types) on npm.
16 mmend submitting the types to DefinitelyTyped, which will publish them to t
16 the @types organization on npm.
18 ncluding declarations in your npm package
40 l dependencies are managed by npm.
42 authored a package that used Browserify and TypeScript.
60 ts declaration files with its npm packages, so we needed to dep
78 Do use `/// <reference types="..
93 - Do depend on the npm type declar
93 - Do depend on the npm type declaration package if i
122 ## Matching behavior
124 e matches is by using Node's [semver ranges](https://github.com/np
143 he order could have different behavior, so the above sample would no
160 published automatically from [DefinitelyTyped](https://github.com/Definitel
161 ase submit a pull request to [DefinitelyTyped](https://github.com/Definitel

Typos for Library Structures.md

Line Typo
31 can you only get it through npm or only from a CDN?
41 Almost every modern Node.js library falls into the module
43 mple, express only works in Node.js and must be loaded using the
43 and must be loaded using the CommonJS require function.
45 2015, ECMAScript 6, and ES6), CommonJS, and RequireJS have similar n
45 pt 6, and ES6), CommonJS, and RequireJS have similar notions of _impo
46 In JavaScript CommonJS (Node.js), for example, you w
46 In JavaScript CommonJS (Node.js), for example, you would writ
120 r example, if you were using [jQuery](https://jquery.com/), the `$
177 - CommonJS/Node.js-style imports of the
177 - CommonJS/Node.js-style imports of the form `va
184 and require the DOM (or have no dependencies) may still be gl
194 y popular libraries, such as [Moment.js](http://momentjs.com/), are w
195 For example, in Node.js or using RequireJS, you would
195 example, in Node.js or using RequireJS, you would write:
227 often demonstrate a "Using in Node.js" example showing require,
233 Examples include [jQuery](https://jquery.com/), [Momen
233 Query](https://jquery.com/), [Moment.js](http://momentjs.com/), [loda
233 t.js](http://momentjs.com/), [lodash](https://lodash.com/), and ma
293 low is to only declare types namespaced by whatever global variable
321 In ES6-compl module loaders, the top-level
326 tsconfig/#esModuleInterop) in tsconfig.json.

Typos for Introduction.md

Line Typo
13 common case for learning how .d.ts files work is that you're typ
13 work is that you're typing an npm package with no types.
14 an jump straight to [Modules .d.ts](/docs/handbook/declaration-f
31 at your structure is, see the d.ts Template section in the sideb
36 The [Do's and Don'ts](/docs/handbook/declaration-f
47 ## Publish to npm
49 your declaration files to an npm package, and shows how to man

Typos for Do's and Don'ts.md

Line Typo
20 Do use the types number, `stri
57 Do use the return type void fo
91 Do write callback parameters as
102 that differ only on callback arity:
113 Do write a single overload using
113 le overload using the maximum arity:
142 Do sort overloads by putting the
170 Do use optional parameters whene
219 Do use union types whenever poss

Typos for Deep Dive.md

Line Typo
31 - An enum declaration (`enum E { A, B,
68 ful aspects of this combining behavior.
76 Enum declarations behave similarly
108 s a very good opportunity for destructuring in the consuming code:
182 We could also add a namespaced type to a class:
197 hows all sorts of interesting behavior:

Typos for By Example.md

Line Typo
73 > 3 - color: Optional string, e.g. '#ff00
73 olor: Optional string, e.g. '#ff00ff'
132 > You can provide LogOptions to .log(...) and alert opti

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.
48 re surrounded by the backtick/backquote (`) character, and embe
128 ## Enum
130 dition to the standard set of datatypes from JavaScript is the enum
131 As in languages like C#, an enum is a way of giving more frien
142 By default, enums begin numbering their members
155 lly set all the values in the enum:
166 A handy feature of enums is that you can also go from
166 the name of that value in the enum.
167 that mapped to in the Color enum above, we could look up the c
307 able to, every type; however, no type is a subtype of, or assi
391 Object are the same as the lowercase versions.

Typos for Converting Twoslash Code Samples.md

Line Typo
1 ### A Guide to Converting to Twoslash
3 To run the site with Twoslash enabled you need to use `yarn
5 t Website should run through [Twoslash](https://github.com/microsoft
7 Without twoslash a code sample looks like:
10 ```ts
38 ```ts twoslash
38 ```ts twoslash
68 A twoslash code sample can do a lot -
68 - the best documentation for twoslash lives inside the [bug workben

Generated by 🚫 dangerJS against 45bc892

@@ -4,6 +4,276 @@ layout: docs
permalink: /docs/handbook/declaration-files/templates/global-plugin-d-ts.html
---

## _UMD_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure UMD is a common term (any more?) so perhaps the title should use a more compositional term like .. uh .. "Dual module/global imports"?

I talked to a customer today who missed UMD export as namespace completely because it was described on a page named module.d.ts and he was looking for a page named global-mixed.d.ts or something.

@orta
Copy link
Contributor Author

orta commented Jul 17, 2020

Paired with @Ethan-Arrowood today on this and got it quite a bit closer to ocmpletion

orta and others added 3 commits July 31, 2020 11:05
@orta orta marked this pull request as ready for review July 31, 2020 17:26
@orta orta merged commit d7aa5ff into v2 Jul 31, 2020
@jakebailey jakebailey deleted the new-dts branch May 17, 2024 22:02
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