File tree 3 files changed +20
-0
lines changed
crates/oxc_isolated_declarations
3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,16 @@ impl<'a> Visit<'a> for ScopeTree<'a> {
110
110
}
111
111
}
112
112
113
+ // `typeof Value` or `typeof Value<Parameters>`
113
114
fn visit_ts_type_query ( & mut self , ty : & TSTypeQuery < ' a > ) {
114
115
if let Some ( type_name) = ty. expr_name . as_ts_type_name ( ) {
115
116
let ident = TSTypeName :: get_identifier_reference ( type_name) ;
116
117
self . add_reference ( ident. name . clone ( ) , KindFlags :: Value ) ;
118
+ // `typeof Type<Parameters>`
119
+ // ^^^^^^^^^^^
120
+ if let Some ( type_parameters) = & ty. type_parameters {
121
+ self . visit_ts_type_parameter_instantiation ( type_parameters) ;
122
+ }
117
123
} else {
118
124
walk_ts_type_query ( self , ty) ;
119
125
}
Original file line number Diff line number Diff line change
1
+ import { ModA } from 'mod' ;
2
+ import { Variable } from 'constant' ;
3
+
4
+ export const Export : typeof ModA < typeof Variable > = 0 ;
Original file line number Diff line number Diff line change
1
+ -- -
2
+ source : crates / oxc_isolated_declarations / tests / mod .rs
3
+ input_file : crates / oxc_isolated_declarations / tests / fixtures / typeof .ts
4
+ -- -
5
+ ` ` `
6
+ ==================== .D.TS ====================
7
+
8
+ import { ModA } from "mod";
9
+ import { Variable } from "constant";
10
+ export declare const Export: typeof ModA<typeof Variable >;
You can’t perform that action at this time.
0 commit comments