File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -352,3 +352,18 @@ export class FutureInput extends Future<any> {
352
352
this . schema = schema ?? { } ;
353
353
}
354
354
}
355
+
356
+ /**
357
+ * Specify an `input` future that can be assigned a name when create a new module.
358
+ * Input types and validation paramters may optionally be described using a JSON Schema object.
359
+ *
360
+ * Default values may also be specified here and will be used if user input is not provided for this input.
361
+ */
362
+ export function input ( schema ?: FutureInput [ "schema" ] ) {
363
+ // NOTE: using `any` as the return type here for now to ease using
364
+ // this in general node input args or helper functions.
365
+ //
366
+ // Once we ship our Future type reorganization work, we can just
367
+ // use this as-is (Future<any>)
368
+ return new FutureInput ( schema ) as any ;
369
+ }
Original file line number Diff line number Diff line change 1
- import { FutureAnyObject , FutureInput , FutureString } from "substrate/Future" ;
1
+ import { FutureAnyObject , FutureString , input } from "substrate/Future" ;
2
2
import { StreamingResponse } from "substrate/SubstrateStreamingResponse" ;
3
3
4
4
export const sb = {
5
5
concat : FutureString . concat ,
6
6
jq : FutureAnyObject . jq ,
7
7
interpolate : FutureString . interpolate ,
8
- input : ( schema ?: FutureInput [ "schema" ] ) => new FutureInput ( schema ) as any ,
8
+ input,
9
9
streaming : {
10
10
fromSSEResponse : StreamingResponse . fromReponse ,
11
11
} ,
You can’t perform that action at this time.
0 commit comments