UNPKG

369 BTypeScriptView Raw
1import type { NodePath } from '@babel/traverse';
2import type { FlowType, Node, TSType } from '@babel/types';
3/**
4 * Gets the most inner valuable TypeAnnotation from path. If no TypeAnnotation
5 * can be found null is returned
6 */
7export default function getTypeAnnotation<T extends Node = FlowType | TSType>(path: NodePath<Node | null | undefined>): NodePath<T> | null;