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
Table of Contents
1 Introduction
2 The proofreader API
3 Shared infrastructure
3.1 Common APIs
Conformance
Document conventions
Index
Terms defined by this specification
Terms defined by reference
References
Normative References
IDL Index
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"
};
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
Availability , in § 3.1
availability() , in § 2
availability(options) , in § 2
"available" , in § 3.1
"capitalization" , in § 2
correctedInput , in § 2
correction , in § 2
corrections , in § 2
CorrectionType , in § 2
create() , in § 2
CreateMonitor , in § 3.1
CreateMonitorCallback , in § 3.1
create(options) , in § 2
"downloadable" , in § 3.1
"downloading" , in § 3.1
endIndex , in § 2
expectedInputLanguages
explanation , in § 2
"grammar" , in § 2
includeCorrectionExplanations
includeCorrectionTypes
"missing-words" , in § 2
monitor , in § 2
ondownloadprogress , in § 3.1
outputLanguage
"preposition" , in § 2
ProofreadCorrection , in § 2
Proofreader , in § 2
ProofreaderCreateCoreOptions , in § 2
ProofreaderCreateOptions , in § 2
ProofreaderProofreadOptions , in § 2
proofread(input) , in § 2
proofread(input, options) , in § 2
ProofreadResult , in § 2
"punctuation" , in § 2
signal
"spelling" , in § 2
startIndex , in § 2
type , in § 2
"unavailable" , in § 3.1
Terms defined by reference
[DOM] defines the following terms:
[HTML] defines the following terms:
[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"
};