File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ declare module 'replicate' {
5858
5959 export type Training = Prediction ;
6060
61+ type RunIdentifier = `${string } /${string } :${string } `;
62+
6163 interface RunOptions {
6264 input : any ;
6365 wait ?: {
@@ -87,8 +89,8 @@ declare module 'replicate' {
8789 fetch : Function ;
8890
8991
90- run ( identifier : string , options : RunOptions & { stream : true } ) : Promise < AsyncIterable < any > > ;
91- run ( identifier : string , options : RunOptions ) : Promise < object > ;
92+ run ( identifier : RunIdentifier , options : RunOptions & { stream : true } ) : Promise < AsyncIterable < any > > ;
93+ run ( identifier : RunIdentifier , options : RunOptions ) : Promise < object > ;
9294
9395 request ( route : string , parameters : any ) : Promise < any > ;
9496 paginate < T > ( endpoint : ( ) => Promise < Page < T > > ) : AsyncGenerator < [ T ] > ;
Original file line number Diff line number Diff line change @@ -558,10 +558,12 @@ describe('Replicate client', () => {
558558
559559 await expect ( client . run ( 'owner/model:invalid' , options ) ) . rejects . toThrow ( ) ;
560560
561+ // @ts -expect-error
561562 await expect ( client . run ( 'owner:abc123' , options ) ) . rejects . toThrow ( ) ;
562563
563564 await expect ( client . run ( '/model:abc123' , options ) ) . rejects . toThrow ( ) ;
564565
566+ // @ts -expect-error
565567 await expect ( client . run ( ':abc123' , options ) ) . rejects . toThrow ( ) ;
566568 } ) ;
567569
You can’t perform that action at this time.
0 commit comments