You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,21 @@ engine | how to run tests | base data inherits from | mandatory ch
65
65
66
66
If you have no access to all required browsers / versions of browsers, use [Sauce Labs](https://saucelabs.com/), [BrowserStack](https://www.browserstack.com/) or [Cloud Browser](https://ieonchrome.com/).
67
67
68
+
## How to add new TypeScript definitions
69
+
70
+
- TypeScript definitions should be added to the [`packages/core-js-types/src/base`](./packages/core-js-types/src/base) directory.
71
+
- Our type definitions are built on top of ES6. If any related type is missing in ES6, it must be added to the [`packages/core-js-types/src/base/core-js-types`](./packages/core-js-types/src/base/core-js-types) directory and imported via triple-slash directives in your type definition file.
72
+
- Place your type definition into the folder that matches its kind ([`packages/core-js-types/src/base/proposals`](./packages/core-js-types/src/base/proposals), [`packages/core-js-types/src/base/web`](./packages/core-js-types/src/base/web)).
73
+
- Type definitions for the pure version are either generated from the global version types or created manually in the [`packages/core-js-types/src/base/pure`](./packages/core-js-types/src/base/pure) folder. Type build rules for the pure version can be modified using the `@type-options` directive:
74
+
-`no-extends` – do not extend the base type when adding a prefix to the type/interface
75
+
-`no-prefix` – do not add a prefix to the type/interface name
76
+
-`no-constructor` – use it when the type has no constructor (for example, `Math`)
77
+
-`export-base-constructor` – export the base type’s constructor instead of the prefixed one
78
+
-`no-export` – do not export this type
79
+
-`no-redefine` – do not redefine the type’s constructor
80
+
-`prefix-return-type` – add a prefix to the return type
81
+
- All type definitions must be covered by TSC tests. Add them to the [`tests/type-definitions`](./tests/type-definitions) directory.
82
+
68
83
## Style and standards
69
84
70
85
The coding style should follow our [`eslint.config.js`](./tests/eslint/eslint.config.js). You can test it by calling [`npm run lint`](#testing). Different places have different syntax and standard library limitations:
0 commit comments