From cab98179815ff45202d50e40d137b15f1ba73716 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Mon, 29 Aug 2022 19:42:11 -0300 Subject: [PATCH 1/4] expose options as readonly --- typings/index.d.ts | 1 + typings/index.test-d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/typings/index.d.ts b/typings/index.d.ts index 9f3d8dff8..3e133db6d 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -277,6 +277,7 @@ export class Command { processedArgs: any[]; commands: Command[]; parent: Command | null; + readonly options: ReadonlyArray>; constructor(name?: string); diff --git a/typings/index.test-d.ts b/typings/index.test-d.ts index 94c0b53d1..88312e527 100644 --- a/typings/index.test-d.ts +++ b/typings/index.test-d.ts @@ -30,6 +30,7 @@ expectType(program.args); expectType(program.processedArgs); expectType(program.commands); expectType(program.parent); +expectType>>(program.options); // version expectType(program.version('1.2.3')); From 5fa0eaffc2cadd82d344a3e5fed18fa237f43cf1 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 2 Sep 2022 09:51:28 -0300 Subject: [PATCH 2/4] export options as plain array --- typings/index.d.ts | 2 +- typings/index.test-d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 3e133db6d..b7b9ffb68 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -277,7 +277,7 @@ export class Command { processedArgs: any[]; commands: Command[]; parent: Command | null; - readonly options: ReadonlyArray>; + readonly options: Option[]; constructor(name?: string); diff --git a/typings/index.test-d.ts b/typings/index.test-d.ts index 88312e527..56f77b678 100644 --- a/typings/index.test-d.ts +++ b/typings/index.test-d.ts @@ -30,7 +30,7 @@ expectType(program.args); expectType(program.processedArgs); expectType(program.commands); expectType(program.parent); -expectType>>(program.options); +expectType(program.options); // version expectType(program.version('1.2.3')); From f486095f57b09d56aa6cdf63567c3c6d3c9eb671 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 8 Sep 2022 07:06:22 -0300 Subject: [PATCH 3/4] Update index.d.ts --- typings/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index b7b9ffb68..da6343de8 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -276,8 +276,8 @@ export class Command { args: string[]; processedArgs: any[]; commands: Command[]; + options: Option[]; parent: Command | null; - readonly options: Option[]; constructor(name?: string); From 010d15157a96ff223784cfb6ecf59bed5b528211 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 8 Sep 2022 07:07:09 -0300 Subject: [PATCH 4/4] Update index.test-d.ts --- typings/index.test-d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings/index.test-d.ts b/typings/index.test-d.ts index 56f77b678..f641f20b2 100644 --- a/typings/index.test-d.ts +++ b/typings/index.test-d.ts @@ -29,8 +29,8 @@ expectType(program.args); // eslint-disable-next-line @typescript-eslint/no-explicit-any expectType(program.processedArgs); expectType(program.commands); -expectType(program.parent); expectType(program.options); +expectType(program.parent); // version expectType(program.version('1.2.3'));