11export declare namespace Base {
2- interface Options { }
2+ interface Options { }
33}
44
55declare type ApiExtension = {
@@ -23,33 +23,34 @@ declare type UnionToIntersection<Union> = (
2323declare type AnyFunction = ( ...args : any ) => any ;
2424declare type ReturnTypeOf < T extends AnyFunction | AnyFunction [ ] > =
2525 T extends AnyFunction
26- ? ReturnType < T >
27- : T extends AnyFunction [ ]
28- ? UnionToIntersection < Exclude < ReturnType < T [ number ] > , void > >
29- : never ;
26+ ? ReturnType < T >
27+ : T extends AnyFunction [ ]
28+ ? UnionToIntersection < Exclude < ReturnType < T [ number ] > , void > >
29+ : never ;
3030
3131type ClassWithPlugins = Constructor < any > & {
3232 plugins : Plugin [ ] ;
3333} ;
3434
3535type RemainingRequirements < PredefinedOptions > =
3636 keyof PredefinedOptions extends never
37- ? Base . Options
38- : Omit < Base . Options , keyof PredefinedOptions >
37+ ? Base . Options
38+ : Omit < Base . Options , keyof PredefinedOptions >
3939
4040type NonOptionalKeys < Obj > = {
41- [ K in keyof Obj ] : { } extends Pick < Obj , K > ? never : K ;
41+ [ K in keyof Obj ] : { } extends Pick < Obj , K > ? undefined : K ;
4242} [ keyof Obj ] ;
4343
44- type RequiredIfRemaining < PredefinedOptions , NowProvided > =
45- NonOptionalKeys < RemainingRequirements < PredefinedOptions > > extends never
46- ? [ ( Partial < Base . Options > & NowProvided ) ?]
47- : [ Partial < Base . Options > & RemainingRequirements < PredefinedOptions > & NowProvided ] ;
44+ type RequiredIfRemaining < PredefinedOptions , NowProvided > =
45+ NonOptionalKeys < RemainingRequirements < PredefinedOptions > > extends undefined
46+ ? [ ( Partial < Base . Options > & NowProvided ) ?]
47+ : [ Partial < Base . Options > & RemainingRequirements < PredefinedOptions > & NowProvided ] ;
4848
4949type ConstructorRequiringVersion < Class extends ClassWithPlugins , PredefinedOptions > = {
5050 defaultOptions : PredefinedOptions ;
5151} & {
5252 new < NowProvided > ( ...options : RequiredIfRemaining < PredefinedOptions , NowProvided > ) : Class & {
53+ debugKeys : NonOptionalKeys < RemainingRequirements < PredefinedOptions > > ;
5354 options : NowProvided & PredefinedOptions ;
5455 } ;
5556} ;
@@ -79,9 +80,9 @@ export declare class Base<TOptions extends Base.Options = Base.Options> {
7980 static plugin <
8081 Class extends ClassWithPlugins ,
8182 Plugins extends [ Plugin , ...Plugin [ ] ] ,
82- > (
83- this : Class ,
84- ...plugins : Plugins ,
83+ > (
84+ this : Class ,
85+ ...plugins : Plugins ,
8586 ) : Class & {
8687 plugins : [ ...Class [ 'plugins' ] , ...Plugins ] ;
8788 } & Constructor < UnionToIntersection < ReturnTypeOf < Plugins > > > ;
@@ -135,4 +136,4 @@ export declare class Base<TOptions extends Base.Options = Base.Options> {
135136
136137 constructor ( options : TOptions ) ;
137138}
138- export { } ;
139+ export { } ;
0 commit comments