@linaria/utils
Version:
Blazing fast zero-runtime CSS in JS library
510 lines (509 loc) • 23.2 kB
TypeScript
import type { NodePath } from '@babel/traverse';
declare const isTypedNode: <T extends "Identifier" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayExpression" | "ArrayPattern" | "ArrayTypeAnnotation" | "ArrowFunctionExpression" | "AssignmentExpression" | "AssignmentPattern" | "AwaitExpression" | "BigIntLiteral" | "BinaryExpression" | "BindExpression" | "BlockStatement" | "BooleanLiteral" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "BreakStatement" | "CallExpression" | "CatchClause" | "ClassAccessorProperty" | "ClassBody" | "ClassDeclaration" | "ClassExpression" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "ConditionalExpression" | "ContinueStatement" | "DebuggerStatement" | "DecimalLiteral" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoExpression" | "DoWhileStatement" | "EmptyStatement" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportAllDeclaration" | "ExportDefaultDeclaration" | "ExportDefaultSpecifier" | "ExportNamedDeclaration" | "ExportNamespaceSpecifier" | "ExportSpecifier" | "ExpressionStatement" | "File" | "ForInStatement" | "ForOfStatement" | "ForStatement" | "FunctionDeclaration" | "FunctionExpression" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "IfStatement" | "Import" | "ImportAttribute" | "ImportDeclaration" | "ImportDefaultSpecifier" | "ImportNamespaceSpecifier" | "ImportSpecifier" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXAttribute" | "JSXClosingElement" | "JSXClosingFragment" | "JSXElement" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXFragment" | "JSXIdentifier" | "JSXMemberExpression" | "JSXNamespacedName" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXSpreadAttribute" | "JSXSpreadChild" | "JSXText" | "LabeledStatement" | "LogicalExpression" | "MemberExpression" | "MetaProperty" | "MixedTypeAnnotation" | "ModuleExpression" | "NewExpression" | "Noop" | "NullLiteral" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "NumericLiteral" | "ObjectExpression" | "ObjectMethod" | "ObjectPattern" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalCallExpression" | "OptionalIndexedAccessType" | "OptionalMemberExpression" | "ParenthesizedExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "PipelineTopicExpression" | "Placeholder" | "PrivateName" | "Program" | "QualifiedTypeIdentifier" | "RecordExpression" | "RegExpLiteral" | "RegexLiteral" | "RestElement" | "RestProperty" | "ReturnStatement" | "SequenceExpression" | "SpreadElement" | "SpreadProperty" | "StaticBlock" | "StringLiteral" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "Super" | "SwitchCase" | "SwitchStatement" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSAsExpression" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInstantiationExpression" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNonNullExpression" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSSatisfiesExpression" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeAssertion" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "TaggedTemplateExpression" | "TemplateElement" | "TemplateLiteral" | "ThisExpression" | "ThisTypeAnnotation" | "ThrowStatement" | "TopicReference" | "TryStatement" | "TupleExpression" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeCastExpression" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnaryExpression" | "UnionTypeAnnotation" | "UpdateExpression" | "V8IntrinsicIdentifier" | "VariableDeclaration" | "VariableDeclarator" | "Variance" | "VoidTypeAnnotation" | "WhileStatement" | "WithStatement" | "YieldExpression">(type: T) => (p: NodePath) => p is NodePath<Extract<import("/types").Identifier, {
type: T;
}> | Extract<import("/types").AnyTypeAnnotation, {
type: T;
}> | Extract<import("/types").ArgumentPlaceholder, {
type: T;
}> | Extract<import("/types").ArrayExpression, {
type: T;
}> | Extract<import("/types").ArrayPattern, {
type: T;
}> | Extract<import("/types").ArrayTypeAnnotation, {
type: T;
}> | Extract<import("/types").ArrowFunctionExpression, {
type: T;
}> | Extract<import("/types").AssignmentExpression, {
type: T;
}> | Extract<import("/types").AssignmentPattern, {
type: T;
}> | Extract<import("/types").AwaitExpression, {
type: T;
}> | Extract<import("/types").BigIntLiteral, {
type: T;
}> | Extract<import("/types").BinaryExpression, {
type: T;
}> | Extract<import("/types").BindExpression, {
type: T;
}> | Extract<import("/types").BlockStatement, {
type: T;
}> | Extract<import("/types").BooleanLiteral, {
type: T;
}> | Extract<import("/types").BooleanLiteralTypeAnnotation, {
type: T;
}> | Extract<import("/types").BooleanTypeAnnotation, {
type: T;
}> | Extract<import("/types").BreakStatement, {
type: T;
}> | Extract<import("/types").CallExpression, {
type: T;
}> | Extract<import("/types").CatchClause, {
type: T;
}> | Extract<import("/types").ClassAccessorProperty, {
type: T;
}> | Extract<import("/types").ClassBody, {
type: T;
}> | Extract<import("/types").ClassDeclaration, {
type: T;
}> | Extract<import("/types").ClassExpression, {
type: T;
}> | Extract<import("/types").ClassImplements, {
type: T;
}> | Extract<import("/types").ClassMethod, {
type: T;
}> | Extract<import("/types").ClassPrivateMethod, {
type: T;
}> | Extract<import("/types").ClassPrivateProperty, {
type: T;
}> | Extract<import("/types").ClassProperty, {
type: T;
}> | Extract<import("/types").ConditionalExpression, {
type: T;
}> | Extract<import("/types").ContinueStatement, {
type: T;
}> | Extract<import("/types").DebuggerStatement, {
type: T;
}> | Extract<import("/types").DecimalLiteral, {
type: T;
}> | Extract<import("/types").DeclareClass, {
type: T;
}> | Extract<import("/types").DeclareExportAllDeclaration, {
type: T;
}> | Extract<import("/types").DeclareExportDeclaration, {
type: T;
}> | Extract<import("/types").DeclareFunction, {
type: T;
}> | Extract<import("/types").DeclareInterface, {
type: T;
}> | Extract<import("/types").DeclareModule, {
type: T;
}> | Extract<import("/types").DeclareModuleExports, {
type: T;
}> | Extract<import("/types").DeclareOpaqueType, {
type: T;
}> | Extract<import("/types").DeclareTypeAlias, {
type: T;
}> | Extract<import("/types").DeclareVariable, {
type: T;
}> | Extract<import("/types").DeclaredPredicate, {
type: T;
}> | Extract<import("/types").Decorator, {
type: T;
}> | Extract<import("/types").Directive, {
type: T;
}> | Extract<import("/types").DirectiveLiteral, {
type: T;
}> | Extract<import("/types").DoExpression, {
type: T;
}> | Extract<import("/types").DoWhileStatement, {
type: T;
}> | Extract<import("/types").EmptyStatement, {
type: T;
}> | Extract<import("/types").EmptyTypeAnnotation, {
type: T;
}> | Extract<import("/types").EnumBooleanBody, {
type: T;
}> | Extract<import("/types").EnumBooleanMember, {
type: T;
}> | Extract<import("/types").EnumDeclaration, {
type: T;
}> | Extract<import("/types").EnumDefaultedMember, {
type: T;
}> | Extract<import("/types").EnumNumberBody, {
type: T;
}> | Extract<import("/types").EnumNumberMember, {
type: T;
}> | Extract<import("/types").EnumStringBody, {
type: T;
}> | Extract<import("/types").EnumStringMember, {
type: T;
}> | Extract<import("/types").EnumSymbolBody, {
type: T;
}> | Extract<import("/types").ExistsTypeAnnotation, {
type: T;
}> | Extract<import("/types").ExportAllDeclaration, {
type: T;
}> | Extract<import("/types").ExportDefaultDeclaration, {
type: T;
}> | Extract<import("/types").ExportDefaultSpecifier, {
type: T;
}> | Extract<import("/types").ExportNamedDeclaration, {
type: T;
}> | Extract<import("/types").ExportNamespaceSpecifier, {
type: T;
}> | Extract<import("/types").ExportSpecifier, {
type: T;
}> | Extract<import("/types").ExpressionStatement, {
type: T;
}> | Extract<import("/types").File, {
type: T;
}> | Extract<import("/types").ForInStatement, {
type: T;
}> | Extract<import("/types").ForOfStatement, {
type: T;
}> | Extract<import("/types").ForStatement, {
type: T;
}> | Extract<import("/types").FunctionDeclaration, {
type: T;
}> | Extract<import("/types").FunctionExpression, {
type: T;
}> | Extract<import("/types").FunctionTypeAnnotation, {
type: T;
}> | Extract<import("/types").FunctionTypeParam, {
type: T;
}> | Extract<import("/types").GenericTypeAnnotation, {
type: T;
}> | Extract<import("/types").IfStatement, {
type: T;
}> | Extract<import("/types").Import, {
type: T;
}> | Extract<import("/types").ImportAttribute, {
type: T;
}> | Extract<import("/types").ImportDeclaration, {
type: T;
}> | Extract<import("/types").ImportDefaultSpecifier, {
type: T;
}> | Extract<import("/types").ImportNamespaceSpecifier, {
type: T;
}> | Extract<import("/types").ImportSpecifier, {
type: T;
}> | Extract<import("/types").IndexedAccessType, {
type: T;
}> | Extract<import("/types").InferredPredicate, {
type: T;
}> | Extract<import("/types").InterfaceDeclaration, {
type: T;
}> | Extract<import("/types").InterfaceExtends, {
type: T;
}> | Extract<import("/types").InterfaceTypeAnnotation, {
type: T;
}> | Extract<import("/types").InterpreterDirective, {
type: T;
}> | Extract<import("/types").IntersectionTypeAnnotation, {
type: T;
}> | Extract<import("/types").JSXAttribute, {
type: T;
}> | Extract<import("/types").JSXClosingElement, {
type: T;
}> | Extract<import("/types").JSXClosingFragment, {
type: T;
}> | Extract<import("/types").JSXElement, {
type: T;
}> | Extract<import("/types").JSXEmptyExpression, {
type: T;
}> | Extract<import("/types").JSXExpressionContainer, {
type: T;
}> | Extract<import("/types").JSXFragment, {
type: T;
}> | Extract<import("/types").JSXIdentifier, {
type: T;
}> | Extract<import("/types").JSXMemberExpression, {
type: T;
}> | Extract<import("/types").JSXNamespacedName, {
type: T;
}> | Extract<import("/types").JSXOpeningElement, {
type: T;
}> | Extract<import("/types").JSXOpeningFragment, {
type: T;
}> | Extract<import("/types").JSXSpreadAttribute, {
type: T;
}> | Extract<import("/types").JSXSpreadChild, {
type: T;
}> | Extract<import("/types").JSXText, {
type: T;
}> | Extract<import("/types").LabeledStatement, {
type: T;
}> | Extract<import("/types").LogicalExpression, {
type: T;
}> | Extract<import("/types").MemberExpression, {
type: T;
}> | Extract<import("/types").MetaProperty, {
type: T;
}> | Extract<import("/types").MixedTypeAnnotation, {
type: T;
}> | Extract<import("/types").ModuleExpression, {
type: T;
}> | Extract<import("/types").NewExpression, {
type: T;
}> | Extract<import("/types").Noop, {
type: T;
}> | Extract<import("/types").NullLiteral, {
type: T;
}> | Extract<import("/types").NullLiteralTypeAnnotation, {
type: T;
}> | Extract<import("/types").NullableTypeAnnotation, {
type: T;
}> | Extract<import("/types").NumberLiteral, {
type: T;
}> | Extract<import("/types").NumberLiteralTypeAnnotation, {
type: T;
}> | Extract<import("/types").NumberTypeAnnotation, {
type: T;
}> | Extract<import("/types").NumericLiteral, {
type: T;
}> | Extract<import("/types").ObjectExpression, {
type: T;
}> | Extract<import("/types").ObjectMethod, {
type: T;
}> | Extract<import("/types").ObjectPattern, {
type: T;
}> | Extract<import("/types").ObjectProperty, {
type: T;
}> | Extract<import("/types").ObjectTypeAnnotation, {
type: T;
}> | Extract<import("/types").ObjectTypeCallProperty, {
type: T;
}> | Extract<import("/types").ObjectTypeIndexer, {
type: T;
}> | Extract<import("/types").ObjectTypeInternalSlot, {
type: T;
}> | Extract<import("/types").ObjectTypeProperty, {
type: T;
}> | Extract<import("/types").ObjectTypeSpreadProperty, {
type: T;
}> | Extract<import("/types").OpaqueType, {
type: T;
}> | Extract<import("/types").OptionalCallExpression, {
type: T;
}> | Extract<import("/types").OptionalIndexedAccessType, {
type: T;
}> | Extract<import("/types").OptionalMemberExpression, {
type: T;
}> | Extract<import("/types").ParenthesizedExpression, {
type: T;
}> | Extract<import("/types").PipelineBareFunction, {
type: T;
}> | Extract<import("/types").PipelinePrimaryTopicReference, {
type: T;
}> | Extract<import("/types").PipelineTopicExpression, {
type: T;
}> | Extract<import("/types").Placeholder, {
type: T;
}> | Extract<import("/types").PrivateName, {
type: T;
}> | Extract<import("/types").Program, {
type: T;
}> | Extract<import("/types").QualifiedTypeIdentifier, {
type: T;
}> | Extract<import("/types").RecordExpression, {
type: T;
}> | Extract<import("/types").RegExpLiteral, {
type: T;
}> | Extract<import("/types").RegexLiteral, {
type: T;
}> | Extract<import("/types").RestElement, {
type: T;
}> | Extract<import("/types").RestProperty, {
type: T;
}> | Extract<import("/types").ReturnStatement, {
type: T;
}> | Extract<import("/types").SequenceExpression, {
type: T;
}> | Extract<import("/types").SpreadElement, {
type: T;
}> | Extract<import("/types").SpreadProperty, {
type: T;
}> | Extract<import("/types").StaticBlock, {
type: T;
}> | Extract<import("/types").StringLiteral, {
type: T;
}> | Extract<import("/types").StringLiteralTypeAnnotation, {
type: T;
}> | Extract<import("/types").StringTypeAnnotation, {
type: T;
}> | Extract<import("/types").Super, {
type: T;
}> | Extract<import("/types").SwitchCase, {
type: T;
}> | Extract<import("/types").SwitchStatement, {
type: T;
}> | Extract<import("/types").SymbolTypeAnnotation, {
type: T;
}> | Extract<import("/types").TSAnyKeyword, {
type: T;
}> | Extract<import("/types").TSArrayType, {
type: T;
}> | Extract<import("/types").TSAsExpression, {
type: T;
}> | Extract<import("/types").TSBigIntKeyword, {
type: T;
}> | Extract<import("/types").TSBooleanKeyword, {
type: T;
}> | Extract<import("/types").TSCallSignatureDeclaration, {
type: T;
}> | Extract<import("/types").TSConditionalType, {
type: T;
}> | Extract<import("/types").TSConstructSignatureDeclaration, {
type: T;
}> | Extract<import("/types").TSConstructorType, {
type: T;
}> | Extract<import("/types").TSDeclareFunction, {
type: T;
}> | Extract<import("/types").TSDeclareMethod, {
type: T;
}> | Extract<import("/types").TSEnumDeclaration, {
type: T;
}> | Extract<import("/types").TSEnumMember, {
type: T;
}> | Extract<import("/types").TSExportAssignment, {
type: T;
}> | Extract<import("/types").TSExpressionWithTypeArguments, {
type: T;
}> | Extract<import("/types").TSExternalModuleReference, {
type: T;
}> | Extract<import("/types").TSFunctionType, {
type: T;
}> | Extract<import("/types").TSImportEqualsDeclaration, {
type: T;
}> | Extract<import("/types").TSImportType, {
type: T;
}> | Extract<import("/types").TSIndexSignature, {
type: T;
}> | Extract<import("/types").TSIndexedAccessType, {
type: T;
}> | Extract<import("/types").TSInferType, {
type: T;
}> | Extract<import("/types").TSInstantiationExpression, {
type: T;
}> | Extract<import("/types").TSInterfaceBody, {
type: T;
}> | Extract<import("/types").TSInterfaceDeclaration, {
type: T;
}> | Extract<import("/types").TSIntersectionType, {
type: T;
}> | Extract<import("/types").TSIntrinsicKeyword, {
type: T;
}> | Extract<import("/types").TSLiteralType, {
type: T;
}> | Extract<import("/types").TSMappedType, {
type: T;
}> | Extract<import("/types").TSMethodSignature, {
type: T;
}> | Extract<import("/types").TSModuleBlock, {
type: T;
}> | Extract<import("/types").TSModuleDeclaration, {
type: T;
}> | Extract<import("/types").TSNamedTupleMember, {
type: T;
}> | Extract<import("/types").TSNamespaceExportDeclaration, {
type: T;
}> | Extract<import("/types").TSNeverKeyword, {
type: T;
}> | Extract<import("/types").TSNonNullExpression, {
type: T;
}> | Extract<import("/types").TSNullKeyword, {
type: T;
}> | Extract<import("/types").TSNumberKeyword, {
type: T;
}> | Extract<import("/types").TSObjectKeyword, {
type: T;
}> | Extract<import("/types").TSOptionalType, {
type: T;
}> | Extract<import("/types").TSParameterProperty, {
type: T;
}> | Extract<import("/types").TSParenthesizedType, {
type: T;
}> | Extract<import("/types").TSPropertySignature, {
type: T;
}> | Extract<import("/types").TSQualifiedName, {
type: T;
}> | Extract<import("/types").TSRestType, {
type: T;
}> | Extract<import("/types").TSSatisfiesExpression, {
type: T;
}> | Extract<import("/types").TSStringKeyword, {
type: T;
}> | Extract<import("/types").TSSymbolKeyword, {
type: T;
}> | Extract<import("/types").TSThisType, {
type: T;
}> | Extract<import("/types").TSTupleType, {
type: T;
}> | Extract<import("/types").TSTypeAliasDeclaration, {
type: T;
}> | Extract<import("/types").TSTypeAnnotation, {
type: T;
}> | Extract<import("/types").TSTypeAssertion, {
type: T;
}> | Extract<import("/types").TSTypeLiteral, {
type: T;
}> | Extract<import("/types").TSTypeOperator, {
type: T;
}> | Extract<import("/types").TSTypeParameter, {
type: T;
}> | Extract<import("/types").TSTypeParameterDeclaration, {
type: T;
}> | Extract<import("/types").TSTypeParameterInstantiation, {
type: T;
}> | Extract<import("/types").TSTypePredicate, {
type: T;
}> | Extract<import("/types").TSTypeQuery, {
type: T;
}> | Extract<import("/types").TSTypeReference, {
type: T;
}> | Extract<import("/types").TSUndefinedKeyword, {
type: T;
}> | Extract<import("/types").TSUnionType, {
type: T;
}> | Extract<import("/types").TSUnknownKeyword, {
type: T;
}> | Extract<import("/types").TSVoidKeyword, {
type: T;
}> | Extract<import("/types").TaggedTemplateExpression, {
type: T;
}> | Extract<import("/types").TemplateElement, {
type: T;
}> | Extract<import("/types").TemplateLiteral, {
type: T;
}> | Extract<import("/types").ThisExpression, {
type: T;
}> | Extract<import("/types").ThisTypeAnnotation, {
type: T;
}> | Extract<import("/types").ThrowStatement, {
type: T;
}> | Extract<import("/types").TopicReference, {
type: T;
}> | Extract<import("/types").TryStatement, {
type: T;
}> | Extract<import("/types").TupleExpression, {
type: T;
}> | Extract<import("/types").TupleTypeAnnotation, {
type: T;
}> | Extract<import("/types").TypeAlias, {
type: T;
}> | Extract<import("/types").TypeAnnotation, {
type: T;
}> | Extract<import("/types").TypeCastExpression, {
type: T;
}> | Extract<import("/types").TypeParameter, {
type: T;
}> | Extract<import("/types").TypeParameterDeclaration, {
type: T;
}> | Extract<import("/types").TypeParameterInstantiation, {
type: T;
}> | Extract<import("/types").TypeofTypeAnnotation, {
type: T;
}> | Extract<import("/types").UnaryExpression, {
type: T;
}> | Extract<import("/types").UnionTypeAnnotation, {
type: T;
}> | Extract<import("/types").UpdateExpression, {
type: T;
}> | Extract<import("/types").V8IntrinsicIdentifier, {
type: T;
}> | Extract<import("/types").VariableDeclaration, {
type: T;
}> | Extract<import("/types").VariableDeclarator, {
type: T;
}> | Extract<import("/types").Variance, {
type: T;
}> | Extract<import("/types").VoidTypeAnnotation, {
type: T;
}> | Extract<import("/types").WhileStatement, {
type: T;
}> | Extract<import("/types").WithStatement, {
type: T;
}> | Extract<import("/types").YieldExpression, {
type: T;
}>>;
export default isTypedNode;