22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5+ import type * as Platform from '../core/platform/platform.js' ;
56import type * as UI from '../ui/legacy/legacy.js' ;
67
7- type WidgetConstructor = abstract new ( ... args : any [ ] ) => UI . Widget . Widget | HTMLElement ;
8+ type WidgetConstructor = Platform . Constructor . AbstractConstructor < UI . Widget . Widget | HTMLElement > ;
89// eslint-disable-next-line @typescript-eslint/no-explicit-any
9- type ViewFunctionLike = ( ( input : any , output : any , target : HTMLElement ) => void ) ;
10+ type ViewFunctionLike = ( input : any , output : any , target : HTMLElement ) => void ;
1011
1112type FindViewFunction < ParametersT extends readonly unknown [ ] > = ParametersT extends [ infer Head , ...infer Tail ] ?
1213 Head extends ViewFunctionLike ? Head : FindViewFunction < Tail > :
@@ -18,13 +19,9 @@ type ViewFunction<WidgetConstructorT extends WidgetConstructor> =
1819type ViewFunctionParameters < WidgetConstructorT extends WidgetConstructor > =
1920 Parameters < ViewFunction < WidgetConstructorT > > ;
2021
21- export type ViewInput < WidgetConstructorT extends WidgetConstructor > =
22- ViewFunctionParameters < WidgetConstructorT > [ 0 ] ;
22+ type ViewInput < WidgetConstructorT extends WidgetConstructor > = ViewFunctionParameters < WidgetConstructorT > [ 0 ] ;
2323
24- export type ViewOutput < WidgetConstructorT extends WidgetConstructor > =
25- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
26- { } extends ViewFunctionParameters < WidgetConstructorT > [ 1 ] ? never :
27- ViewFunctionParameters < WidgetConstructorT > [ 1 ] ;
24+ type ViewOutput < WidgetConstructorT extends WidgetConstructor > = ViewFunctionParameters < WidgetConstructorT > [ 1 ] ;
2825
2926interface ViewStubExtensions < WidgetConstructorT extends WidgetConstructor > {
3027 input : ViewInput < WidgetConstructorT > ;
@@ -41,8 +38,9 @@ export type ViewFunctionStub<WidgetConstructorT extends WidgetConstructor> =
4138 ViewFunction < WidgetConstructorT > & ViewStubExtensions < WidgetConstructorT > ;
4239
4340export function createViewFunctionStub < WidgetConstructorT extends WidgetConstructor > (
44- constructor : WidgetConstructorT ,
45- outputValues ?: ViewOutput < WidgetConstructorT > ) : ViewFunctionStub < WidgetConstructorT > {
41+ _constructor : WidgetConstructorT ,
42+ outputValues ?: ViewOutput < WidgetConstructorT > ,
43+ ) : ViewFunctionStub < WidgetConstructorT > {
4644 const result : InternalViewStubExtensions < WidgetConstructorT > =
4745 ( ( input : ViewInput < WidgetConstructorT > , output : ViewOutput < WidgetConstructorT > , _target : HTMLElement ) => {
4846 ++ result . callCount ;
0 commit comments