TypeScript
import * as cli from '@darkobits/saffron';
interface Schema {
spline: string;
algorithm: 'RTA-20' | 'RTA-21' | 'RTA-22';
}
cli.command<Schema>({
handler: ({ argv, config }) => {
// argv is of type Schema.
// config is of type Schema.
}
});
cli.init();import * as cli from '@darkobits/saffron';
interface Arguments {
spline: string;
algorithm: 'RTA-20' | 'RTA-21' | 'RTA-22';
}
interface Configuration {
// Configuration schema here.
}
cli.command<Arguments, Configuration>({
handler: ({ argv, config }) => {
// argv is of type Arguments.
// config is of type Configuration.
}
});
cli.init();Last updated