@@ -166,12 +166,10 @@ export class OutputBuilder {
166166 return this ;
167167 }
168168
169- setAdditionalRegisters < T extends AdditionalRegistersInput > (
170- registers : SequentialNonMandatoryRegisters < T >
171- ) : OutputBuilder {
169+ setAdditionalRegisters ( registers : NonMandatoryRegisters < ConstantInput > ) : OutputBuilder {
172170 const hexRegisters : NonMandatoryRegisters = { } ;
173171 for ( const key in registers ) {
174- const r = registers [ key ] as ConstantInput ;
172+ const r = registers [ key as keyof NonMandatoryRegisters ] ;
175173 if ( ! r ) continue ;
176174
177175 hexRegisters [ key as keyof NonMandatoryRegisters ] = typeof r === "string" ? r : r . toHex ( ) ;
@@ -237,8 +235,6 @@ export class OutputBuilder {
237235
238236export type ConstantInput = SConstant | HexString ;
239237
240- export type AdditionalRegistersInput = NonMandatoryRegisters < ConstantInput > ;
241-
242238export type OnlyR4Register < T = HexString > = {
243239 R4 : T ;
244240} & NonMandatoryRegisters < T > ;
@@ -277,19 +273,3 @@ export type R4ToR9Registers<T = HexString> = {
277273 R8 : T ;
278274 R9 : T ;
279275} & NonMandatoryRegisters < T > ;
280-
281- export type SequentialNonMandatoryRegisters < T extends AdditionalRegistersInput > = T extends {
282- R9 : ConstantInput ;
283- }
284- ? R4ToR9Registers < ConstantInput >
285- : T extends { R8 : ConstantInput }
286- ? R4ToR8Registers < ConstantInput >
287- : T extends { R7 : ConstantInput }
288- ? R4ToR7Registers < ConstantInput >
289- : T extends { R6 : ConstantInput }
290- ? R4ToR6Registers < ConstantInput >
291- : T extends { R5 : ConstantInput }
292- ? R4ToR5Registers < ConstantInput >
293- : T extends { R4 : ConstantInput }
294- ? OnlyR4Register < ConstantInput >
295- : T ;
0 commit comments