We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YargsInstance
deno.ts
I keep needing this type when implementing commands, as this is the type of the argument supplied to the command builder.
Also, it would be really helpful if the types in deno-types.ts were also exported from deno.ts as well.
deno-types.ts
What I am doing now:
import yargs from "yargs/deno.ts"; import { Arguments } from "yargs/deno-types.ts"; import { YargsInstance } from "yargs/build/lib/yargs-factory.js"; export const hello = { command: "hello", builder(yargs: YargsInstance) { return yargs.option("name", name) }, async handler(args: Arguments) { await console.log(`Hello ${args.name}!`) }, } await yargs() .scriptName("example") .command(hello) .strictCommands() .demandCommand(1) .parse(Deno.args);
Ideally, from a Deno users perspective the I think it would be nice if they all came out of a single import:
import { yargs, YargsInstance, Arguments } from "yargs/deno.ts";
The text was updated successfully, but these errors were encountered:
Related: #1799
In node, the TypeScript types are supplied by Definitely Typed and maintained separately. I don't know if you can make use of those from Deno.
Sorry, something went wrong.
I think deno just treats them as two separate modules. It natively imports typescript files so whatever is in that file is what it interprets.
Here is an example usage for reference: https://github.com/Optum/semver-cli/blob/main/deps/yargs.ts
No branches or pull requests
I keep needing this type when implementing commands, as this is the type of the argument supplied to the command builder.
Also, it would be really helpful if the types in
deno-types.ts
were also exported fromdeno.ts
as well.What I am doing now:
Ideally, from a Deno users perspective the I think it would be nice if they all came out of a single import:
The text was updated successfully, but these errors were encountered: