File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -434,11 +434,13 @@ async function topLevel() {
434434 } ) ;
435435 console . log ( proofreaderAvailability2 ) ;
436436
437- const proofreaderResult : ProofreadResult = await proofreader . proofread ( "foo" ) ;
437+ const proofreaderResult : ProofreadResult = await proofreader . proofread ( "foo" , {
438+ signal : ( new AbortController ( ) ) . signal ,
439+ } ) ;
438440 console . log ( proofreaderResult ) ;
439441
440442 // for await (
441- // const chunk of proofreader.proofreadStreaming("foo")
443+ // const chunk of proofreader.proofreadStreaming("foo", { signal: (new AbortController()).signal } )
442444 // ) {
443445 // console.log(chunk);
444446 // }
Original file line number Diff line number Diff line change @@ -397,8 +397,8 @@ declare abstract class Proofreader implements DestroyableModel {
397397 static create ( options ?: ProofreaderCreateOptions ) : Promise < Proofreader > ;
398398 static availability ( options ?: ProofreaderCreateCoreOptions ) : Promise < Availability > ;
399399
400- proofread ( input : string ) : Promise < ProofreadResult > ;
401- // proofreadStreaming(input: string): ReadableStream<unknown>;
400+ proofread ( input : string , options ?: ProofreaderProofreadOptions ) : Promise < ProofreadResult > ;
401+ // proofreadStreaming(input: string, options?: ProofreaderProofreadOptions ): ReadableStream<unknown>;
402402
403403 readonly includeCorrectionTypes : boolean ;
404404 readonly includeCorrectionExplanations : boolean ;
@@ -420,6 +420,10 @@ interface ProofreaderCreateOptions extends ProofreaderCreateCoreOptions {
420420 monitor ?: CreateMonitorCallback ;
421421}
422422
423+ interface ProofreaderProofreadOptions {
424+ signal ?: AbortSignal ;
425+ }
426+
423427interface ProofreadResult {
424428 correctedInput : string ;
425429 corrections : ProofreadCorrection [ ] ;
You can’t perform that action at this time.
0 commit comments