import ts from "typescript"; import { ApiMethodKind } from "./api"; /** * Various types that could be in a call argument position of a function parameter. */ export declare type TsFunctionParameter = ts.FunctionExpression | ts.ArrowFunction | ts.Identifier | ts.PropertyAccessExpression | ts.ElementAccessExpression | ts.CallExpression; export declare type RuleInterface = ts.NewExpression & { arguments: [any, any, any, TsFunctionParameter]; }; export declare type EventTransformInterface = ts.NewExpression & { arguments: [TsFunctionParameter, any]; }; export declare type EventBusWhenInterface = ts.CallExpression & { arguments: [any, TsFunctionParameter] | [any, any, TsFunctionParameter]; }; export declare type EventBusMapInterface = ts.CallExpression & { arguments: [TsFunctionParameter]; }; export declare type FunctionInterface = ts.NewExpression & { arguments: [ ts.Expression, ts.Expression, ts.Expression, TsFunctionParameter ] | [ ts.Expression, ts.Expression, TsFunctionParameter ]; }; export declare type ApiIntegrationsStaticMethodInterface = ts.CallExpression & { arguments: [ts.ObjectLiteralExpression]; }; export declare type NewStepFunctionInterface = ts.NewExpression & { arguments: [ts.Expression, ts.Expression, TsFunctionParameter] | [ts.Expression, ts.Expression, ts.Expression, TsFunctionParameter]; }; export declare type NewAppsyncResolverInterface = ts.NewExpression & { arguments: [ ts.Expression, ts.Expression, ts.Expression, TsFunctionParameter ]; }; export declare type NewAppsyncFieldInterface = ts.NewExpression & { arguments: [ ts.Expression, TsFunctionParameter ]; }; export declare type FunctionlessChecker = ReturnType; export declare function makeFunctionlessChecker(checker: ts.TypeChecker): { getApiMethodKind: (node: ts.NewExpression) => ApiMethodKind | undefined; getFunctionlessTypeKind: (type: ts.Type) => ts.Type | string | undefined; getIntegrationNodeKind: (node: ts.Node) => string | undefined; getOutOfScopeValueNode: (expression: ts.Expression, scope: ts.Node) => ts.Expression | undefined; isApiIntegration: (node: ts.Node) => node is ts.NewExpression; isAppsyncField: (node: ts.Node) => node is NewAppsyncFieldInterface; isAppsyncResolver: (node: ts.Node) => node is NewAppsyncResolverInterface; isArraySymbol: (symbol: ts.Symbol) => boolean; isCDKConstruct: (type: ts.Type) => boolean; isConstant: (node: ts.Node) => boolean; isEventBus: (node: ts.Node) => boolean; isEventBusWhenFunction: (node: ts.Node) => node is EventBusWhenInterface; isForInVariable: (node: ts.Identifier) => boolean | undefined; isFunctionlessFunction: (node: ts.Node) => boolean; isFunctionlessType: (type: ts.Type | undefined, kind: string) => boolean; isIdentifierOutOfScope: (node: ts.Identifier, scope: ts.Node) => boolean | undefined; isIdentifierVariableReference: (id: ts.Identifier) => boolean; isIntegrationNode: (node: ts.Node) => boolean; isNewEventTransform: (node: ts.Node) => node is EventTransformInterface; isNewFunctionlessFunction: (node: ts.Node) => node is FunctionInterface; isNewRule: (node: ts.Node) => node is RuleInterface; isNewStepFunction: (node: ts.Node) => node is NewStepFunctionInterface; isPromiseArray: (type: ts.Type) => boolean; isPromiseAllCall: (node: ts.Node) => boolean; isPromiseSymbol: (symbol: ts.Symbol) => boolean; isReflectFunction: (node: ts.Node) => node is ts.CallExpression & { arguments: [TsFunctionParameter, ...ts.Expression[]]; }; isRuleMapFunction: (node: ts.Node) => node is EventBusMapInterface; isStepFunction: (node: ts.Node) => boolean; isTable: (node: ts.Node) => boolean; getTypeOfSymbolAtLocation(symbol: ts.Symbol, node: ts.Node): ts.Type; getDeclaredTypeOfSymbol(symbol: ts.Symbol): ts.Type; getPropertiesOfType(type: ts.Type): ts.Symbol[]; getPropertyOfType(type: ts.Type, propertyName: string): ts.Symbol | undefined; getPrivateIdentifierPropertyOfType(leftType: ts.Type, name: string, location: ts.Node): ts.Symbol | undefined; getIndexInfoOfType(type: ts.Type, kind: ts.IndexKind): ts.IndexInfo | undefined; getIndexInfosOfType(type: ts.Type): readonly ts.IndexInfo[]; getSignaturesOfType(type: ts.Type, kind: ts.SignatureKind): readonly ts.Signature[]; getIndexTypeOfType(type: ts.Type, kind: ts.IndexKind): ts.Type | undefined; getBaseTypes(type: ts.InterfaceType): ts.BaseType[]; getBaseTypeOfLiteralType(type: ts.Type): ts.Type; getWidenedType(type: ts.Type): ts.Type; getReturnTypeOfSignature(signature: ts.Signature): ts.Type; getNullableType(type: ts.Type, flags: ts.TypeFlags): ts.Type; getNonNullableType(type: ts.Type): ts.Type; getTypeArguments(type: ts.TypeReference): readonly ts.Type[]; typeToTypeNode(type: ts.Type, enclosingDeclaration: ts.Node | undefined, flags: ts.NodeBuilderFlags | undefined): ts.TypeNode | undefined; signatureToSignatureDeclaration(signature: ts.Signature, kind: ts.SyntaxKind, enclosingDeclaration: ts.Node | undefined, flags: ts.NodeBuilderFlags | undefined): (ts.SignatureDeclaration & { typeArguments?: ts.NodeArray | undefined; }) | undefined; indexInfoToIndexSignatureDeclaration(indexInfo: ts.IndexInfo, enclosingDeclaration: ts.Node | undefined, flags: ts.NodeBuilderFlags | undefined): ts.IndexSignatureDeclaration | undefined; symbolToEntityName(symbol: ts.Symbol, meaning: ts.SymbolFlags, enclosingDeclaration: ts.Node | undefined, flags: ts.NodeBuilderFlags | undefined): ts.EntityName | undefined; symbolToExpression(symbol: ts.Symbol, meaning: ts.SymbolFlags, enclosingDeclaration: ts.Node | undefined, flags: ts.NodeBuilderFlags | undefined): ts.Expression | undefined; symbolToTypeParameterDeclarations(symbol: ts.Symbol, enclosingDeclaration: ts.Node | undefined, flags: ts.NodeBuilderFlags | undefined): ts.NodeArray | undefined; symbolToParameterDeclaration(symbol: ts.Symbol, enclosingDeclaration: ts.Node | undefined, flags: ts.NodeBuilderFlags | undefined): ts.ParameterDeclaration | undefined; typeParameterToDeclaration(parameter: ts.TypeParameter, enclosingDeclaration: ts.Node | undefined, flags: ts.NodeBuilderFlags | undefined): ts.TypeParameterDeclaration | undefined; getSymbolsInScope(location: ts.Node, meaning: ts.SymbolFlags): ts.Symbol[]; getSymbolAtLocation(node: ts.Node): ts.Symbol | undefined; getSymbolsOfParameterPropertyDeclaration(parameter: ts.ParameterDeclaration, parameterName: string): ts.Symbol[]; getShorthandAssignmentValueSymbol(location: ts.Node | undefined): ts.Symbol | undefined; getExportSpecifierLocalTargetSymbol(location: ts.Identifier | ts.ExportSpecifier): ts.Symbol | undefined; getExportSymbolOfSymbol(symbol: ts.Symbol): ts.Symbol; getPropertySymbolOfDestructuringAssignment(location: ts.Identifier): ts.Symbol | undefined; getTypeOfAssignmentPattern(pattern: ts.AssignmentPattern): ts.Type; getTypeAtLocation(node: ts.Node): ts.Type; getTypeFromTypeNode(node: ts.TypeNode): ts.Type; signatureToString(signature: ts.Signature, enclosingDeclaration?: ts.Node | undefined, flags?: ts.TypeFormatFlags | undefined, kind?: ts.SignatureKind | undefined): string; typeToString(type: ts.Type, enclosingDeclaration?: ts.Node | undefined, flags?: ts.TypeFormatFlags | undefined): string; symbolToString(symbol: ts.Symbol, enclosingDeclaration?: ts.Node | undefined, meaning?: ts.SymbolFlags | undefined, flags?: ts.SymbolFormatFlags | undefined): string; typePredicateToString(predicate: ts.TypePredicate, enclosingDeclaration?: ts.Node | undefined, flags?: ts.TypeFormatFlags | undefined): string; getFullyQualifiedName(symbol: ts.Symbol): string; getAugmentedPropertiesOfType(type: ts.Type): ts.Symbol[]; getRootSymbols(symbol: ts.Symbol): readonly ts.Symbol[]; getSymbolOfExpando(node: ts.Node, allowDeclaration: boolean): ts.Symbol | undefined; getContextualType(node: ts.Expression): ts.Type | undefined; getResolvedSignature(node: ts.CallLikeExpression, candidatesOutArray?: ts.Signature[] | undefined, argumentCount?: number | undefined): ts.Signature | undefined; getSignatureFromDeclaration(declaration: ts.SignatureDeclaration): ts.Signature | undefined; isImplementationOfOverload(node: ts.SignatureDeclaration): boolean | undefined; isUndefinedSymbol(symbol: ts.Symbol): boolean; isArgumentsSymbol(symbol: ts.Symbol): boolean; isUnknownSymbol(symbol: ts.Symbol): boolean; getConstantValue(node: ts.PropertyAccessExpression | ts.ElementAccessExpression | ts.EnumMember): string | number | undefined; isValidPropertyAccess(node: ts.PropertyAccessExpression | ts.QualifiedName | ts.ImportTypeNode, propertyName: string): boolean; getAliasedSymbol(symbol: ts.Symbol): ts.Symbol; getImmediateAliasedSymbol(symbol: ts.Symbol): ts.Symbol | undefined; getExportsOfModule(moduleSymbol: ts.Symbol): ts.Symbol[]; getJsxIntrinsicTagNamesAt(location: ts.Node): ts.Symbol[]; isOptionalParameter(node: ts.ParameterDeclaration): boolean; getAmbientModules(): ts.Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: ts.Symbol): ts.Symbol | undefined; getApparentType(type: ts.Type): ts.Type; getBaseConstraintOfType(type: ts.Type): ts.Type | undefined; getDefaultFromTypeParameter(type: ts.Type): ts.Type | undefined; getTypePredicateOfSignature(signature: ts.Signature): ts.TypePredicate | undefined; runWithCancellationToken(token: ts.CancellationToken, cb: (checker: ts.TypeChecker) => T): T; }; declare const BinaryArithmeticOperators: readonly [ts.SyntaxKind.PlusToken, ts.SyntaxKind.MinusToken, ts.SyntaxKind.AsteriskToken, ts.SyntaxKind.SlashToken, ts.SyntaxKind.PercentToken, ts.SyntaxKind.PlusEqualsToken, ts.SyntaxKind.MinusEqualsToken, ts.SyntaxKind.AsteriskEqualsToken, ts.SyntaxKind.SlashEqualsToken, ts.SyntaxKind.PercentEqualsToken]; declare const UnaryArithmeticOperators: readonly [ts.SyntaxKind.PlusToken, ts.SyntaxKind.MinusToken, ts.SyntaxKind.AsteriskAsteriskToken, ts.SyntaxKind.MinusMinusToken, ts.SyntaxKind.PlusPlusToken]; export declare type BinaryArithmeticToken = typeof BinaryArithmeticOperators[number]; export declare type UnaryArithmeticToken = typeof UnaryArithmeticOperators[number]; /** * Check if a {@link token} is an {@link BinaryArithmeticToken}: `+`, `-`, `*` or `/`. */ export declare function isBinaryArithmeticToken(token: ts.SyntaxKind): token is BinaryArithmeticToken; /** * Check if a {@link token} is an {@link UnaryArithmeticToken}: `++`, `--`, or `**`. */ export declare function isUnaryArithmeticToken(token: ts.SyntaxKind): token is UnaryArithmeticToken; /** * Invokes a predicate on the ancestors of the given node until: * * the predicate is true * * there is no parent * * or the limit parameter is hit * * @param limit - An upper bound node to stop processing at. */ export declare function findParent(node: ts.Node, predicate: (node: ts.Node) => node is T, limit?: ts.Node): T | undefined; /** * Visits all types in union or intersection types with a predicate. */ export declare function typeMatch(type: ts.Type, predicate: (type: ts.Type) => boolean): boolean; export declare const deploymentOnlyModule = true; export {}; //# sourceMappingURL=checker.d.ts.map