diff --git a/typings/index.d.ts b/typings/index.d.ts index b69ea9104..876d30e91 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 7b8af12ea..2d94f7e82 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