-
Notifications
You must be signed in to change notification settings - Fork 440
Adds targets for the other environments #1062
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### `@types/audioworklet` - Types for the global scope of Audio Worklets | ||
|
||
> The AudioWorklet interface of the Web Audio API is used to supply custom audio processing scripts that execute in a separate thread to provide very low latency audio processing. The worklet's code is run in the AudioWorkletGlobalScope global execution context, using a separate Web Audio thread which is shared by the worklet and other audio nodes. | ||
|
||
From [MDN Web Docs: AudioWorklet](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorklet) | ||
|
||
This package contains type definitions which will set up the global environment for your TypeScript project to match the runtime environment of an Audio Worklet. The APIs inside `@types/audioworklet` are [generated from](https://github.com/microsoft/TypeScript-DOM-lib-generator/) the specifications for [Web Audio](https://webaudio.github.io/web-audio-api/). | ||
|
||
## Installation | ||
|
||
To use `@types/audioworklet` you need to do two things: | ||
|
||
1. Install the dependency: `npm install @types/audioworklet --save-dev`, `yarn add @types/audioworklet --dev` or `pnpm add @types/audioworklet --dev`. | ||
1. Update your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig) to avoid clashing with the DOM APIs. There are two cases to consider depending on if you have `lib` defined in your `tsconfig.json` or not. | ||
|
||
1. **Without "lib"** - You will need to add `"lib": []`. The value you want to add inside your lib should correlate to your [`"target"`](https://www.typescriptlang.org/tsconfig#target). For example if you had `"target": "es2017"`, then you would add `"lib": ["es2017"]` | ||
1. **With "lib"** - You should remove `"dom"`. | ||
|
||
That's all. | ||
|
||
|
||
## SemVer | ||
|
||
This project does not respect semantic versioning as almost every change could potentially break a project, though we try to minimize removing types. | ||
|
||
`@types/audioworklet` follow the specifications, so when they mark a function/object/API/type as deprecated or removed - that is respected. | ||
|
||
## Deploy Metadata | ||
|
||
You can read what changed in version {{version}} at {{release_href}}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### `@types/serviceworker` - Types for the global scope of Service Workers | ||
|
||
> Service workers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). They are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. They will also allow access to push notifications and background sync APIs. | ||
|
||
From [MDN Web Docs: Service Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) | ||
|
||
This package contains type definitions which will set up the global environment for your TypeScript project to match the runtime environment of a Service Worker. The APIs inside `@types/serviceworker` are [generated from](https://github.com/microsoft/TypeScript-DOM-lib-generator/) the specifications for JavaScript. Given the size and state of constant change in web browsers, `@types/serviceworker` only has APIs which have passed a certain level of standardization and are available in at least two of the most popular browser engines. | ||
|
||
## Installation | ||
|
||
To use `@types/serviceworker` you need to do two things: | ||
|
||
1. Install the dependency: `npm install @types/serviceworker --save-dev`, `yarn add @types/serviceworker --dev` or `pnpm add @types/serviceworker --dev`. | ||
1. Update your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig) to avoid clashing with the DOM APIs. There are two cases to consider depending on if you have `lib` defined in your `tsconfig.json` or not. | ||
|
||
1. **Without "lib"** - You will need to add `"lib": []`. The value you want to add inside your lib should correlate to your [`"target"`](https://www.typescriptlang.org/tsconfig#target). For example if you had `"target": "es2017"`, then you would add `"lib": ["es2017"]` | ||
1. **With "lib"** - You should remove `"dom"`. | ||
|
||
That's all. | ||
|
||
|
||
## SemVer | ||
|
||
This project does not respect semantic versioning as almost every change could potentially break a project, though we try to minimize removing types. | ||
|
||
`@types/serviceworker` follow the specifications, so when they mark a function/object/API/type as deprecated or removed - that is respected. | ||
|
||
## Deploy Metadata | ||
|
||
You can read what changed in version {{version}} at {{release_href}}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### `@types/sharedworker` - Types for the global scope of Web Workers | ||
|
||
> The SharedWorker interface represents a specific kind of worker that can be accessed from several browsing contexts, such as several windows, iframes or even workers. They implement an interface different than dedicated workers and have a different global scope, `SharedWorkerGlobalScope`. | ||
|
||
From [MDN Web Docs: SharedWorker API](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker) | ||
|
||
This package contains type definitions which will set up the global environment for your TypeScript project to match the runtime environment of a Web Worker. The APIs inside `@types/sharedworker` are [generated from](https://github.com/microsoft/TypeScript-DOM-lib-generator/) the specifications for JavaScript. | ||
|
||
## Installation | ||
|
||
To use `@types/sharedworker` you need to do two things: | ||
|
||
1. Install the dependency: `npm install @types/sharedworker --save-dev`, `yarn add @types/sharedworker --dev` or `pnpm add @types/sharedworker --dev`. | ||
1. Update your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig) to avoid clashing with the DOM APIs. There are two cases to consider depending on if you have `lib` defined in your `tsconfig.json` or not. | ||
|
||
1. **Without "lib"** - You will need to add `"lib": []`. The value you want to add inside your lib should correlate to your [`"target"`](https://www.typescriptlang.org/tsconfig#target). For example if you had `"target": "es2017"`, then you would add `"lib": ["es2017"]` | ||
1. **With "lib"** - You should remove `"dom"`. | ||
|
||
That's all. | ||
|
||
|
||
## SemVer | ||
|
||
This project does not respect semantic versioning as almost every change could potentially break a project, though we try to minimize removing types. | ||
|
||
`@types/sharedworker` follow the specifications, so when they mark a function/object/API/type as deprecated or removed - that is respected. | ||
|
||
## Deploy Metadata | ||
|
||
You can read what changed in version {{version}} at {{release_href}}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### `@types/webworker` - Types for the global scope of Web Workers | ||
|
||
> The Worker interface of the Web Workers API represents a background task that can be created via script, which can send messages back to its creator. Creating a worker is done by calling the `Worker("path/to/worker/script")` constructor. | ||
|
||
From [MDN Web Docs: Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Worker) | ||
|
||
This package contains type definitions which will set up the global environment for your TypeScript project to match the runtime environment of a Web Worker. The APIs inside `@types/webworker` are [generated from](https://github.com/microsoft/TypeScript-DOM-lib-generator/) the specifications for JavaScript. | ||
|
||
## Installation | ||
|
||
To use `@types/webworker` you need to do two things: | ||
|
||
1. Install the dependency: `npm install @types/webworker --save-dev`, `yarn add @types/webworker --dev` or `pnpm add @types/webworker --dev`. | ||
1. Update your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig) to avoid clashing with the DOM APIs. There are two cases to consider depending on if you have `lib` defined in your `tsconfig.json` or not. | ||
|
||
1. **Without "lib"** - You will need to add `"lib": []`. The value you want to add inside your lib should correlate to your [`"target"`](https://www.typescriptlang.org/tsconfig#target). For example if you had `"target": "es2017"`, then you would add `"lib": ["es2017"]` | ||
1. **With "lib"** - You should remove `"dom"`. | ||
|
||
That's all. | ||
|
||
|
||
## SemVer | ||
|
||
This project does not respect semantic versioning as almost every change could potentially break a project, though we try to minimize removing types. | ||
|
||
`@types/webworker` follow the specifications, so when they mark a function/object/API/type as deprecated or removed - that is respected. | ||
|
||
## Deploy Metadata | ||
|
||
You can read what changed in version {{version}} at {{release_href}}. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are at it: how can
index.iterable.d.ts
be referenced? 👀 Should the step be added to readme?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm, I thought it would be automatically be included in all builds because it lives in @types and we read all the files in there. Haven't actually checked though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow it doesn't work like that in my environment (see there is no
index.iterable.d.ts
):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, the build pipeline will probably need to add something like
/// <reference path="..." />
to theindex.dt.s
A user can probably get these imported into their globals via
import "web/index.iterable"
but that's weaksauceThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that would mean packages will require es6+ 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
/// <reference path="./index.iterable.d.ts" />
to the top ofindex.d.ts
automatically includes it. I think this is a reasonable enough default if we document it as supporting ES6+There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, since it's probably time to concentrate on es6+ 😁