diff --git a/typings/index.d.ts b/typings/index.d.ts index bdfb2cccb..84c857a59 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -277,7 +277,8 @@ export interface OptionValues { export class Command { args: string[]; processedArgs: any[]; - commands: Command[]; + readonly commands: readonly Command[]; + readonly options: readonly Option[]; parent: Command | null; constructor(name?: string); diff --git a/typings/index.test-d.ts b/typings/index.test-d.ts index 10740b0be..e5245afb2 100644 --- a/typings/index.test-d.ts +++ b/typings/index.test-d.ts @@ -28,7 +28,8 @@ expectType(commander.createArgument('')); expectType(program.args); // eslint-disable-next-line @typescript-eslint/no-explicit-any expectType(program.processedArgs); -expectType(program.commands); +expectType(program.commands); +expectType(program.options); expectType(program.parent); // version