11export declare namespace Base {
2- interface Options { }
2+ interface Options { }
33}
44
55declare type ApiExtension = {
@@ -23,33 +23,43 @@ 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 > = {
4141 [ K in keyof Obj ] : { } extends Pick < Obj , K > ? undefined : K ;
4242} [ keyof Obj ] ;
4343
44- type RequiredIfRemaining < PredefinedOptions , NowProvided > =
45- NonOptionalKeys < RemainingRequirements < PredefinedOptions > > extends undefined
44+ type RequiredIfRemaining < PredefinedOptions , NowProvided > = NonOptionalKeys <
45+ RemainingRequirements < PredefinedOptions >
46+ > extends undefined
4647 ? [ ( Partial < Base . Options > & NowProvided ) ?]
47- : [ Partial < Base . Options > & RemainingRequirements < PredefinedOptions > & NowProvided ] ;
48+ : [
49+ Partial < Base . Options > &
50+ RemainingRequirements < PredefinedOptions > &
51+ NowProvided
52+ ] ;
4853
49- type ConstructorRequiringVersion < Class extends ClassWithPlugins , PredefinedOptions > = {
54+ type ConstructorRequiringVersion <
55+ Class extends ClassWithPlugins ,
56+ PredefinedOptions
57+ > = {
5058 defaultOptions : PredefinedOptions ;
5159} & {
52- new < NowProvided > ( ...options : RequiredIfRemaining < PredefinedOptions , NowProvided > ) : Class & {
60+ new < NowProvided > (
61+ ...options : RequiredIfRemaining < PredefinedOptions , NowProvided >
62+ ) : Class & {
5363 options : NowProvided & PredefinedOptions ;
5464 } ;
5565} ;
@@ -78,12 +88,12 @@ export declare class Base<TOptions extends Base.Options = Base.Options> {
7888 */
7989 static plugin <
8090 Class extends ClassWithPlugins ,
81- Plugins extends [ Plugin , ...Plugin [ ] ] ,
82- > (
83- this : Class ,
84- ...plugins : Plugins ,
91+ Plugins extends [ Plugin , ...Plugin [ ] ]
92+ > (
93+ this : Class ,
94+ ...plugins : Plugins
8595 ) : Class & {
86- plugins : [ ...Class [ ' plugins' ] , ...Plugins ] ;
96+ plugins : [ ...Class [ " plugins" ] , ...Plugins ] ;
8797 } & Constructor < UnionToIntersection < ReturnTypeOf < Plugins > > > ;
8898
8999 /**
@@ -104,7 +114,8 @@ export declare class Base<TOptions extends Base.Options = Base.Options> {
104114 */
105115 static defaults <
106116 PredefinedOptionsOne ,
107- ClassOne extends Constructor < Base < Base . Options & PredefinedOptionsOne > > & ClassWithPlugins
117+ ClassOne extends Constructor < Base < Base . Options & PredefinedOptionsOne > > &
118+ ClassWithPlugins
108119 > (
109120 this : ClassOne ,
110121 defaults : PredefinedOptionsOne
@@ -122,8 +133,12 @@ export declare class Base<TOptions extends Base.Options = Base.Options> {
122133 ) : ConstructorRequiringVersion <
123134 ClassOne & ClassTwo & ClassThree ,
124135 PredefinedOptionsOne & PredefinedOptionsTwo & PredefinedOptionsThree
125- > & ClassOne & ClassTwo & ClassThree ;
126- } & ClassOne & ClassTwo ;
136+ > &
137+ ClassOne &
138+ ClassTwo &
139+ ClassThree ;
140+ } & ClassOne &
141+ ClassTwo ;
127142 } & ClassOne ;
128143
129144 static defaultOptions : { } ;
@@ -135,4 +150,4 @@ export declare class Base<TOptions extends Base.Options = Base.Options> {
135150
136151 constructor ( options : TOptions ) ;
137152}
138- export { } ;
153+ export { } ;
0 commit comments