@wcauchois/program-builder > Arguments

Arguments type

Type helper to get the Arguments type of a Program.

Signature:
export declare type Arguments<T> = T extends Program<infer U> ? U : never;

Remarks

Use TypeScript's typeof operator to get the type of your program variable, then pass it as a type argument to this type to get the arguments type for your program.

Note you can use typeof before a variable is declared, in case you want to define your main function before your program-building for readability.

Example:

async function main(args: Arguments<typeof Program>) {
// Do things with args
}
const program = ProgramBuilder.newBuilder().build();