The current TSTypeOperatorBuilder interface:
export interface TSTypeOperatorBuilder {
(operator: string): namedTypes.TSTypeOperator;
from(
params: {
comments?: K.CommentKind[] | null;
loc?: K.SourceLocationKind | null;
operator: string;
typeAnnotation: K.TSTypeKind;
}
): namedTypes.TSTypeOperator;
}
Since the typeAnnotation is required, attempting to create a TSTypeOperator by calling the function isn't possible. It can only be done by using the .from() method instead.
The call signature should have a second parameter for the typeAnnotation
export interface TSTypeOperatorBuilder {
(operator: string, typeAnnotation: K.TSTypeKind): namedTypes.TSTypeOperator;
...
}
Some code to reproduce the error can be viewed here.
https://astexplorer.net/#/gist/2328ddf6e049e141a5db2293d6d67668/27d29233f044354b19d639701ceff667448b4b55
The current TSTypeOperatorBuilder interface:
Since the typeAnnotation is required, attempting to create a TSTypeOperator by calling the function isn't possible. It can only be done by using the
.from()method instead.The call signature should have a second parameter for the typeAnnotation
Some code to reproduce the error can be viewed here.
https://astexplorer.net/#/gist/2328ddf6e049e141a5db2293d6d67668/27d29233f044354b19d639701ceff667448b4b55