diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 0338bdb..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,12 +0,0 @@ -# See the documentation at -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates -version: 2 -updates: - # Update actions used by .github/workflows in this repository. - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - groups: - actions-org: # Groups all Github-authored actions into a single PR. - patterns: ["actions/*"] diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml deleted file mode 100644 index 6be3501..0000000 --- a/.github/workflows/auto-publish.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: CI -on: - pull_request: {} - push: - branches: [main] -jobs: - main: - name: Build, Validate and Deploy - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 - with: - python-version: '3.12' - - uses: w3c/spec-prod@v2 - with: - GH_PAGES_BRANCH: gh-pages - BUILD_FAIL_ON: warning diff --git a/.gitignore b/.gitignore deleted file mode 100644 index dcaf716..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -index.html diff --git a/.pr-preview.json b/.pr-preview.json deleted file mode 100644 index e3e7155..0000000 --- a/.pr-preview.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "src_file": "index.bs", - "type": "bikeshed", - "params": { - "force": 1 - } -} - diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 1461168..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -All Reports in this Repository are licensed by Contributors -under the -[W3C Software and Document License](https://www.w3.org/copyright/software-license/). - -Contributions to Specifications are made under the -[W3C CLA](https://www.w3.org/community/about/agreements/cla/). - -Contributions to Test Suites are made under the -[W3C 3-clause BSD License](https://www.w3.org/copyright/3-clause-bsd-license-2008/) diff --git a/README.md b/README.md deleted file mode 100644 index d029aeb..0000000 --- a/README.md +++ /dev/null @@ -1,343 +0,0 @@ -# Proofreader API Explainer - -*This proposal is an early design sketch by ODML and Chrome built-in AI team to describe the problem below and solicit -feedback on the proposed solution. It has not been approved to ship in Chrome.* - -Proofreading is the process of examining a text carefully to find and correct errors such as grammar, spelling, and punctuation to generate an error-free text before it is published or shared. Browsers and operating systems are increasingly offering proofreading capability to help their users compose (examples: [Oodles of improvements to Chrome's Spell Checking](https://chrome.googleblog.com/2013/03/oodles-of-improvements-to-chromes-spell.html), [Use Writing Tools with Apple Intelligence on Mac](https://support.apple.com/guide/mac-help/use-writing-tools-mchldcd6c260/mac)). - -Web applications can also benefit from such proofreading capability. This proposal introduces a new JavaScript API which, by exposing high-level functionality of a language model, corrects and labels a variety of errors from user input. Specifically, the proposed proofreading API in this explainer exposes three specific higher-level functionalities for proofreading: - - -1. Error Correction: Correct input text by the user -2. Error Labeling: For each correction made to each error in the input text, label the error type(s) (e.g. spelling, punctuation, etc.) -3. Error Explanation: Annotates each error with a plain language explanation - -Note that Labeling & Explanation are independent features that can be either added or dropped. - -## Goals - -Our goals are to: - -* Help web developers perform real-time proofreading (e.g. of user input) on short phrases/sentences/paragraphs of freeform text. -* Allow web developers to build flexible proofreading UI/UX. -* Offer higher-level APIs with specific inputs and output formats that can support error labeling and explanations, abstracting away the underlying implementation (e.g. OS feature, language model, etc.). -* Enable progressive enhancement, so web developers can gracefully handle varying levels of user agent support. - -The following are explicit non-goals: - -* Proofreading for markdown or other formats/syntaxes (e.g. not intended for JS code) -* Check for consistent style and formatting throughout a user-provided input - -## Use cases - -* Proofread and suggest corrections to user messages in chat applications -* Proofread and help polish email drafting -* Catch errors and provide corrections during note-taking -* Proofread a comment to a forum/article/blog -* Provide high-quality interactive proofreading, along with labeling & explanations for the correction when writing documents - -## Examples - -### Basic usage -Create a proofreader object customized as necessary, and call its method to proofread an input: - -```js -const proofreader = await Proofreader.create({ - includeCorrectionTypes: true, - includeCorrectionExplanations: true, -}); - -const corrections = await proofreader.proofread("I seen him yesterday at the store, and he bought two loafs of bread."); -``` - -`proofread()` corrects the input text and returns a list of corrections made. Additional proofreading features can be configured using includeCorrectionTypes and `includeCorrectionExplanations`. When `includeCorrectionTypes` is set to `true`, `proofread()` will provide the error type labels associated for each correction made to each error. When `includeCorrectionExplanations` is set to `true`, `proofread()` will provide an annotation for each error with a plain language explanation. - -Detailed design for the corrections output is [discussed later](#proofreading-correction-output). - -### Repeated usage - -A created proofreader object can be used multiple times. **The only shared state is the initial configuration options**; the inputs do not build on each other. - -```js -const proofreader = await Proofreader.create(); - -editBoxEl.addEventListener("blur", async (event) => { - const corrections = await proofreader.proofread(event.target.value); -}); -``` - -### Expected input languages - -The default behavior for the proofreader object assumes that the input language is unknown. In this case, implementations will use whatever "base" capabilities they have available for these operations, and might throw "`NotSupportedError`" `DOMExceptions` if they encounter languages they don't support. - -It’s better practice, if possible, to supply the `create()` method with information about the expected languages in use. This allows the implementation to download any necessary supporting material, such as fine-tunings or safety-checking models, and to immediately reject the promise returned by `create()` if the web developer wants to use languages that the browser is not capable of supporting: - -```js -const proofreader = await Proofreader.create({ - includeCorrectionTypes: true, - expectedInputLanguages: ["en"], -}); -``` - -### Expected explanation language - -When explanations for corrections are requested for the proofreading result, the default behavior for the proofreader object assumes that the explanation language is unknown and will be the same as the input language. - -Similar to input languages, it’s better practice, if possible, to supply the `create()` method with the expected explanation languages. - -```js -const proofreader = await Proofreader.create({ - includeCorrectionExplanations: true, - expectedInputLanguagues: ["en"], - correctionExplanationLanguage: "en", -}); -``` - -### Multilingual content -When there are multiple languages in the proofreading input, developers could specify them by adding to the list of `expectedInputLanguages` in the `create()` method. - -```js -const proofreader = await Proofreader.create({ - includeCorrectionTypes: true, - expectedInputLanguages: ["en", "ja"], -}); -``` - -### Testing available options before creation -The proofreading API is customizable during the `create()` calls, with various options including the language option above. All options are given in more detail in the [later section](#full-api-surface-in-web-idl). - -However, not all models will necessarily support every language, and it might require a download to get the appropriate fine-tuning or other collateral necessary on the first use. - -In the simple case, web developers should call `create()`, and handle failures gracefully. However, if they want to provide a differentiated user experience, which lets users know ahead of time that the feature will not be possible or might require a download, they can use the API’s promise-returning `availability()` method. This method lets developers know, before calling `create()`, what is possible with the implementation. - -The method will return a promise that fulfills with one of the following availability values: -“`unavailable`” means that the implementation does not support the requested options. -“`downloadable`” means that the implementation supports the requested options, but it will have to download something (e.g. a machine learning model or fine-tuning) before it can do anything. -“`downloading`” means that the implementation supports the requested options, but it will have to finish an ongoing download before it can do anything. -“`available`” means that the implementation supports the requested options without requiring any new downloads. - -An example usage is the following: - -```js -const options = { includeCorrectionTypes: true, expectedInputLanguages: ["en"] }; - -const supportsOurUseCase = await Proofreader.availability(options); - -if (supportsOurUseCase !== "unavailable") { - // We're good! Let's do the proofreading using the built-in API. - if (supportsOurUseCase !== "available") { - console.log("Sit tight, we need to do some downloading..."); - } - const proofreader = await Proofreader.create(options); - console.log(await proofreader.proofread(editBoxEl.textContent)); -} else { - // Either the API overall, or the combination of correction-with-labels with - // English input, is not available. - // Handle the failure / run alternatives. -} -``` - -### Download progress -For cases where using the API is only possible after a download, you can monitor the download progress (e.g. in order to show your users a progress bar) using code such as the following: - -```js -const proofreader = await Proofreader.create({ - ...otherOptions, - monitor(m) { - m.addEventListener("downloadprogress", e => { - console.log(`Downloaded ${e.loaded * 100}%`); - }); - } -}); -``` - -If the download fails, then `downloadprogress` events will stop being fired, and the promise returned by `create()` will be rejected with a "`NetworkError`" `DOMException`. - -Note that some implementations might require multiple entities to be downloaded, e.g. a base model plus a LoRA fine-tuning. In such a case, web developers do not get the ability to monitor the individual downloads. All of them are bundled into the overall `downloadprogress` events, and the `create()` promise is not fulfilled until all downloads and loads are successful. - -### Destruction and aborting - -The API comes equipped with a couple of `signal` options that accept `AbortSignal`s, to allow aborting the creation of the proofreader, or the operations themselves: - -```js -const controller = new AbortController(); -stopButton.onclick = () => controller.abort(); - -const proofreader = await Proofreader.create({ signal: controller.signal }); -await proofreader.proofread(document.body.textContent, { signal: controller.signal }); -``` - -Additionally, the proofreader object itself has a `destroy()` method, which is a convenience method with equivalent behavior for cases where the proofreader object has already been created. - -Destroying a proofreader will: - -Reject any ongoing operations (`proofread()`). -And, most importantly, allow the user agent to unload the machine learning models from memory. (If no other APIs are using them.) -Allowing such destruction provides a way to free up the memory used by the language model without waiting for garbage collection, since models can be quite large. - -Aborting the creation process will reject the promise returned by `create()`, and will also stop signaling any ongoing download progress. (The browser may then abort the downloads, or may continue them. Either way, no further `downloadprogress` events will be fired.) - -## Detailed design discussion - -### Proofreading correction output - -For each input, the method `proofread()` returns a promise of `ProofreadResult`: - -```idl -dictionary ProofreadResult { - DOMString correctedInput; - sequence corrections; -} -``` - -`correctedInput` is the fully corrected version of the input, while `corrections` contains a list of corrections made, their locations in the original input (e.g. so web developers can create UI to highlight the error), and optionally labels/explanations. - -```idl -dictionary ProofreadCorrection { - unsigned long long startIndex; - unsigned long long endIndex; - DOMString correction; - sequence types; // exists if proofreader.includeCorrectionTypes === true - DOMString explanation; // exists if proofreader.includeCorrectionExplanations === true -} - -enum CorrectionType { "spelling", "punctuation", "capitalization", "preposition", "missing-words", "grammar" }; -``` - -`types` only exists when the proofreader object is configured with `includeCorrectionTypes = true`, while `explanation` only exists when the proofreader object is configured with `includeCorrectionExplanations = true`. - -Each correction could be associated with multiple correction type labels. For example: - -```js -const original_text = "`thatd` a good amt of time!!! !" // `thatd` is the text to be corrected -const proofread_text = "`That's` a good amount of time!" // `That's` is the corrected text -``` -where the correction from "thatd" to "That's" contains three types of correction - "Capitalization", "Spelling" and "Punctuation". When there's only one label, the sequence will be of size 1. - -Not all correction types here will be applicable to all languages, and in the future we might propose more specific correction types. The generic catch-all type, if no more-specific type matches, is `"grammar"`. - -To get an error in the input, use `input.substring(startIndex, endIndex)`. Corrections in the `corrections` list will be organized in ascending order based on the `startIndex` of the correction. - -Example usage of the output to highlight an error in input: - -```js -let inputRenderIndex = 0; - -for (const correction of corrections) { - // Render part of input that has no error. - if (correction.startIndex > inputRenderIndex) { - const unchangedInput = document.createElement('span'); - unchangedInput.textContent = input.substring(inputRenderIndex, correction.startIndex); - editBox.append(unchangedInput); - } - // Render part of input that has an error and highlight as such. - const errorInput = document.createElement('span'); - errorInput.textContent = input.substring(correction.startIndex, correction.endIndex); - errorInput.classList.add('error'); - editBox.append(errorInput); - inputRenderIndex = correction.endIndex; -} - -// Render the rest of the input that has no error. -if (inputRenderIndex !== input.length){ - const unchangedInput = document.createElement('span'); - unchangedInput.textContent = input.substring(inputRenderIndex, input.length); - editBox.append(unchangedInput); -} -``` - -### Full API surface in Web IDL -```idl -[Exposed=(Window,Worker), SecureContext] -interface Proofreader { - static Promise create(optional ProofreaderCreateOptions options = {}); - static Promise availability(optional ProofreaderCreateCoreOptions options = {}); - - Promise proofread( - DOMString input, - optional ProofreaderProofreadOptions options = {} - ); - ReadableStream proofreadStreaming( - DOMString input, - optional ProofreaderProofreadOptions options = {} - ); - - // whether to provide correction types for each correction as part of the proofreading result. - readonly attribute boolean includeCorrectionTypes; - // whether to provide explanations for each correction as part of the proofreading result. - readonly attribute boolean includeCorrectionExplanations; - readonly attribute DOMString? correctionExplanationLanguage; - readonly attribute FrozenArray? expectedInputLanguages; - - undefined destroy(); -}; - -dictionary ProofreaderCreateCoreOptions { - boolean includeCorrectionTypes = false; - boolean includeCorrectionExplanations = false; - DOMString correctionExplanationLanguage; - sequence expectedInputLanguages; -}; - -dictionary ProofreaderCreateOptions : ProofreaderCreateCoreOptions { - AbortSignal signal; - AICreateMonitorCallback monitor; -}; - -dictionary ProofreaderProofreadOptions { - AbortSignal signal; -}; - -dictionary ProofreadResult { - DOMString correctedInput; - sequence corrections; -}; - -dictionary ProofreadCorrection { - unsigned long long startIndex; - unsigned long long endIndex; - DOMString correction; - sequence types; - DOMString explanation; -}; - -enum CorrectionType { - "spelling", - "punctuation", - "capitalization", - "preposition", - "missing-words", - "grammar" -}; -``` - -## Alternatives considered and under consideration - -### Provide explanations only asynchronously -To offer a more comprehensive proofreading API, in addition to labeling the error type for each correction made, we considered annotating each correction with an explanation. Users of such proofreading capability can benefit from it to improve their writing skills. - -However, due to technical limitations of the on-device language model, generating a short explanation for each correction takes significantly longer than real-time, not to mention multiple explanations for all corrections within a short sentence/paragraph. - -To address this, we propose to only offer **streaming explanations** asynchronously from the list of corrections (ProofreadCorrection) through a streaming API. Specifically, instead of returning explanations for all corrections at one time, we would return one correction’s explanation at a time as they become available. This way, web developers can provide sooner UI updates to the users to make the experience less jarring. - -### Interaction with other browser-integrated proofreading features - -As web developers implement UX around this proofreading API, if users’ browser supports other integrated proofreading features, the UX could get confusing with two features trying to help at once. - -The [spellcheck](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck) attribute from HTML available across browsers might help developers signal to the browser to turn off its integrated spelling check if it has one. For example, when `spellcheck` is set to `false`, no red underlines/squiggly lines will appear to indicate a spelling error. - -For more sophisticated browser-integrated proofreading features, it’s an open question how to address the potential conflicts. For example, for browser extensions, one option is for web developers to detect the presence of certain extensions and then decide the behavior of their own proofreading feature. - -### Customization with user-mutable dictionary -While the proposed Proofreading API corrects user input based on general knowledge, there could be cases where users would prefer to ignore correcting certain proper names, acronyms, etc. For example, the proposed [Dictionary API](https://github.com/Igalia/explainers/blob/main/document-local-dictionary/README.md) allows users to add and remove words from the browser’s custom dictionary to address special use cases. - -The Proofreading API can potentially allow users to specify a custom dictionary and avoid correcting any words included in the dictionary. - -However, in cases where ignoring certain words for correction could potentially change the meaning/structure of a sentence, it could be a bit tricky to proofread with pre-trained language models. Therefore, we are moving forward without integration with custom dictionaries until further exploration and evaluation are done. Nevertheless, we invite discussion of all of these APIs within the Web Machine Learning Community Group. - -## Privacy considerations -This API follows the same structure as the Writing Assistance API, and thus shares the same privacy considerations as the Writing Assistance API. Please see [the specification](https://webmachinelearning.github.io/writing-assistance-apis/#privacy). - -## Security considerations - -This API also shares the same security considerations as the Writing Assistance API. Please see [the specification](https://webmachinelearning.github.io/writing-assistance-apis/#security). diff --git a/index.bs b/index.bs deleted file mode 100644 index 40d7a76..0000000 --- a/index.bs +++ /dev/null @@ -1,114 +0,0 @@ - - -
-urlPrefix: https://tc39.es/ecma402/; spec: ECMA-402
-    type: dfn; text: [[AvailableLocales]]; url: sec-internal-slots
-    type: dfn; text: Unicode canonicalized locale identifier; url: sec-language-tags
-    type: abstract-op; text: LookupMatchingLocaleByBestFit; url: sec-lookupmatchinglocalebybestfit
-    type: abstract-op; text: IsStructurallyValidLanguageTag; url: sec-isstructurallyvalidlanguagetag
-    type: abstract-op; text: CanonicalizeUnicodeLocaleId; url: sec-canonicalizeunicodelocaleid
-urlPrefix: https://tc39.es/ecma262/; spec: ECMA-262
-    type: abstract-op; text: floor; url: eqn-floor
-    type: dfn; text: current realm; url: current-realm
-
- - - -

Introduction

- -For now, see the [explainer](https://github.com/webmachinelearning/proofreader-api/blob/main/README.md). - -

The proofreader API

- - -[Exposed=Window, SecureContext] -interface Proofreader { - static Promise<Proofreader> create(optional ProofreaderCreateOptions options = {}); - static Promise<Availability> availability(optional ProofreaderCreateCoreOptions options = {}); - - Promise<ProofreadResult> proofread( - DOMString input, - optional ProofreaderProofreadOptions options = {} - ); - - readonly attribute boolean includeCorrectionTypes; - readonly attribute boolean includeCorrectionExplanations; - - readonly attribute FrozenArray<DOMString>? expectedInputLanguages; - readonly attribute DOMString? outputLanguage; -}; - -dictionary ProofreaderCreateCoreOptions { - boolean includeCorrectionTypes = false; - boolean includeCorrectionExplanations = false; - - sequence<DOMString> expectedInputLanguages; - DOMString outputLanguage; -}; - -dictionary ProofreaderCreateOptions : ProofreaderCreateCoreOptions { - AbortSignal signal; - CreateMonitorCallback monitor; -}; - -dictionary ProofreaderProofreadOptions { - AbortSignal signal; -}; - -dictionary ProofreadResult { - DOMString correctedInput; - sequence<ProofreadCorrection> corrections; -}; - -dictionary ProofreadCorrection { - unsigned long long startIndex; - unsigned long long endIndex; - DOMString correction; - sequence<CorrectionType> type; - DOMString explanation; -}; - -enum CorrectionType { "spelling", "punctuation", "capitalization", "preposition", "missing-words", "grammar" }; - - -

Shared infrastructure

- -

Common APIs

- - -[Exposed=Window, SecureContext] -interface CreateMonitor : EventTarget { - attribute EventHandler ondownloadprogress; -}; - -callback CreateMonitorCallback = undefined (CreateMonitor monitor); - -enum Availability { - "unavailable", - "downloadable", - "downloading", - "available" -}; - diff --git a/index.html b/index.html new file mode 100644 index 0000000..7813573 --- /dev/null +++ b/index.html @@ -0,0 +1,1933 @@ + + + + + Proofreader API + + + + + + + + + + + + + + + + + + + + +
+

+

+

Proofreader API

+

Draft Community Group Report, +

+
+ More details about this document +
+
+
This version: +
https://webmachinelearning.github.io/proofreader-api +
Issue Tracking: +
GitHub +
Editors: +
(Google) +
(Google) +
+
+
+
+ +
+
+
+

Abstract

+

The proofreader API provides high-level interfaces to call on browser or operating system’s built-in language model to help with proofreading tasks.

+
+

Status of this document

+
+

+ This specification was published by the Web Machine Learning Community Group. + It is not a W3C Standard nor is it on the W3C Standards Track. + + Please note that under the + W3C Community Contributor License Agreement (CLA) + there is a limited opt-out and other conditions apply. + + Learn more about + W3C Community and Business Groups. +

+

+
+
+ +
+

1. Introduction

+

For now, see the explainer.

+

2. The proofreader API

+
[Exposed=Window, SecureContext]
+interface Proofreader {
+    static Promise<Proofreader> create(optional ProofreaderCreateOptions options = {});
+    static Promise<Availability> availability(optional ProofreaderCreateCoreOptions options = {});
+
+    Promise<ProofreadResult> proofread(
+        DOMString input,
+        optional ProofreaderProofreadOptions options = {}
+    );
+
+    readonly attribute boolean includeCorrectionTypes;
+    readonly attribute boolean includeCorrectionExplanations;
+
+    readonly attribute FrozenArray<DOMString>? expectedInputLanguages;
+    readonly attribute DOMString? outputLanguage;
+};
+
+dictionary ProofreaderCreateCoreOptions {
+    boolean includeCorrectionTypes = false;
+    boolean includeCorrectionExplanations = false;
+
+    sequence<DOMString> expectedInputLanguages;
+    DOMString outputLanguage;
+};
+
+dictionary ProofreaderCreateOptions : ProofreaderCreateCoreOptions {
+    AbortSignal signal;
+    CreateMonitorCallback monitor;
+};
+
+dictionary ProofreaderProofreadOptions {
+    AbortSignal signal;
+};
+
+dictionary ProofreadResult {
+    DOMString correctedInput;
+    sequence<ProofreadCorrection> corrections;
+};
+
+dictionary ProofreadCorrection {
+    unsigned long long startIndex;
+    unsigned long long endIndex;
+    DOMString correction;
+    sequence<CorrectionType> type;
+    DOMString explanation;
+};
+
+enum CorrectionType { "spelling", "punctuation", "capitalization", "preposition", "missing-words", "grammar" };
+
+

3. Shared infrastructure

+

3.1. Common APIs

+
[Exposed=Window, SecureContext]
+interface CreateMonitor : EventTarget {
+    attribute EventHandler ondownloadprogress;
+};
+
+callback CreateMonitorCallback = undefined (CreateMonitor monitor);
+
+enum Availability {
+    "unavailable",
+    "downloadable",
+    "downloading",
+    "available"
+};
+
+
+
+

Conformance

+

Document conventions

+

Conformance requirements are expressed + with a combination of descriptive assertions + and RFC 2119 terminology. + The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” + in the normative parts of this document + are to be interpreted as described in RFC 2119. + However, for readability, + these words do not appear in all uppercase letters in this specification. + +

+

All of the text of this specification is normative + except sections explicitly marked as non-normative, examples, and notes. [RFC2119] + +

+

Examples in this specification are introduced with the words “for example” + or are set apart from the normative text + with class="example", + like this: + +

+
+ + +

This is an example of an informative example. +

+
+

Informative notes begin with the word “Note” + and are set apart from the normative text + with class="note", + like this: + +

+

Note, this is an informative note.

+
+ +

Index

+

Terms defined by this specification

+ +

Terms defined by reference

+
    +
  • + [DOM] defines the following terms: +
      +
    • AbortSignal +
    • EventTarget +
    +
  • + [HTML] defines the following terms: +
      +
    • EventHandler +
    +
  • + [WEBIDL] defines the following terms: +
      +
    • DOMString +
    • Exposed +
    • FrozenArray +
    • Promise +
    • SecureContext +
    • boolean +
    • sequence +
    • undefined +
    • unsigned long long +
    +
+

References

+

Normative References

+
+
[DOM] +
Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/ +
[HTML] +
Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/ +
[RFC2119] +
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119 +
[WEBIDL] +
Edgar Chen; Timothy Gu. Web IDL Standard. Living Standard. URL: https://webidl.spec.whatwg.org/ +
+

IDL Index

+
[Exposed=Window, SecureContext]
+interface Proofreader {
+    static Promise<Proofreader> create(optional ProofreaderCreateOptions options = {});
+    static Promise<Availability> availability(optional ProofreaderCreateCoreOptions options = {});
+
+    Promise<ProofreadResult> proofread(
+        DOMString input,
+        optional ProofreaderProofreadOptions options = {}
+    );
+
+    readonly attribute boolean includeCorrectionTypes;
+    readonly attribute boolean includeCorrectionExplanations;
+
+    readonly attribute FrozenArray<DOMString>? expectedInputLanguages;
+    readonly attribute DOMString? outputLanguage;
+};
+
+dictionary ProofreaderCreateCoreOptions {
+    boolean includeCorrectionTypes = false;
+    boolean includeCorrectionExplanations = false;
+
+    sequence<DOMString> expectedInputLanguages;
+    DOMString outputLanguage;
+};
+
+dictionary ProofreaderCreateOptions : ProofreaderCreateCoreOptions {
+    AbortSignal signal;
+    CreateMonitorCallback monitor;
+};
+
+dictionary ProofreaderProofreadOptions {
+    AbortSignal signal;
+};
+
+dictionary ProofreadResult {
+    DOMString correctedInput;
+    sequence<ProofreadCorrection> corrections;
+};
+
+dictionary ProofreadCorrection {
+    unsigned long long startIndex;
+    unsigned long long endIndex;
+    DOMString correction;
+    sequence<CorrectionType> type;
+    DOMString explanation;
+};
+
+enum CorrectionType { "spelling", "punctuation", "capitalization", "preposition", "missing-words", "grammar" };
+
+[Exposed=Window, SecureContext]
+interface CreateMonitor : EventTarget {
+    attribute EventHandler ondownloadprogress;
+};
+
+callback CreateMonitorCallback = undefined (CreateMonitor monitor);
+
+enum Availability {
+    "unavailable",
+    "downloadable",
+    "downloading",
+    "available"
+};
+
+
+ + + \ No newline at end of file