@@ -94,18 +94,23 @@ const SET_OPTIONS = {
9494 */
9595type SetOptions = typeof SET_OPTIONS ;
9696
97+ /**
98+ * See {@link SET_OPTIONS}
99+ */
100+ type ProgrammaticOptionsKey = keyof SetOptions ;
101+
97102/**
98103 * See {@link SET_OPTIONS}
99104 */
100105type ProgrammaticOptionsBase = {
101- - readonly [ K in keyof SetOptions ] ?: SetOptions [ K ] [ '_type' ] | undefined ;
106+ - readonly [ K in ProgrammaticOptionsKey ] ?: SetOptions [ K ] [ '_type' ] | undefined ;
102107} ;
103108
104109/**
105110 * See {@link SET_OPTIONS}
106111 */
107112type CliOptionsBase = {
108- - readonly [ K in keyof SetOptions as SetOptions [ K ] [ 'cli' ] extends true ? K : never ] ?:
113+ - readonly [ K in ProgrammaticOptionsKey as SetOptions [ K ] [ 'cli' ] extends true ? K : never ] ?:
109114 K extends 'toolModules' ? string [ ] | undefined : SetOptions [ K ] [ '_type' ] | undefined
110115} ;
111116
@@ -122,7 +127,7 @@ type MakeExperimental<T, K extends string = never> = T & {
122127 * See {@link SET_OPTIONS}
123128 */
124129type ExperimentalOptions = keyof {
125- [ K in keyof SetOptions as SetOptions [ K ] [ 'experimental' ] extends true ? K : never ] : unknown
130+ [ K in ProgrammaticOptionsKey as SetOptions [ K ] [ 'experimental' ] extends true ? K : never ] : unknown
126131} & string ;
127132
128133/**
@@ -138,7 +143,7 @@ type ProgrammaticOptions = MakeExperimental<ProgrammaticOptionsBase, Experimenta
138143/**
139144 * See {@link SET_OPTIONS}
140145 */
141- type ExperimentalOptionKey = keyof SetOptions & string ;
146+ type ExperimentalOptionKey = ProgrammaticOptionsKey & string ;
142147
143148/**
144149 * Experimental options list.
@@ -167,7 +172,7 @@ const EXPERIMENTAL_CLI_OPTIONS = new Set<ExperimentalOptionKey>(
167172 *
168173 * See {@link SET_OPTIONS}
169174 */
170- const PROGRAMMATIC_OPTIONS = Object . keys ( SET_OPTIONS ) as ReadonlyArray < keyof SetOptions > ;
175+ const PROGRAMMATIC_OPTIONS = Object . keys ( SET_OPTIONS ) as ReadonlyArray < ProgrammaticOptionsKey > ;
171176
172177export {
173178 EXPERIMENTAL_CLI_OPTIONS ,
@@ -184,5 +189,6 @@ export {
184189 type MakeExperimental ,
185190 type ProgrammaticOptions ,
186191 type ProgrammaticOptionsBase ,
192+ type ProgrammaticOptionsKey ,
187193 type SetOptions
188194} ;
0 commit comments