import { NodePath } from '@babel/traverse'; import * as t from '@babel/types'; import { PrimingDiagnostic } from '../types'; import { AstContext, ClassPropertyContexts, ImportMetadata } from '@komaci/common-shared'; /** * Invariant function for checking if a member expression references a non decorated member var. * @param path the babel path object for the current member expressoin * @param memberVars a set of approved member variable names. * @returns undefined if the member expression does NOT reference an unsupported member var, PrimingDiagnostic object if an unsuppported * member variable is referenced */ export declare function checkForNonSupportedMemberRefs(path: NodePath, memberVars: ClassPropertyContexts): PrimingDiagnostic | undefined; /** * Invariant function for checking if a member expression references a non-existent member property variable * @param {NodePath} path babel/types path object representing the current member expression * @param {string[]} memberVars an string[] of member variable names * @param {Set} thisAliases a Set of the aliases of `this` used. ex: in `let that = this;`, `that` would be an alias. * @returns {(PrimingDiagnostic | undefined)} undefined if the member expression does NOT reference a non-existent member property variable. Returns a * PrimingDiagnostic object if a non-existent member property variable is referenced */ export declare function checkForNonExistentMemberRefs(path: NodePath, memberVars: ClassPropertyContexts, thisAliases: Set): PrimingDiagnostic | undefined; /** * Invariant function to check if a member expression references an unsupported import. * @param path the babel path object for the current member expression * @param supportedImportRefs a set of supported import references. * @returns undefined if a member expression does NOT reference an unsuppoerted import, PrimingDiagnostic object * if an unsupported import is reference. */ export declare function checkMemberExpressionForNonSupportedNamespaceRefs(path: NodePath, importReferences: Map): PrimingDiagnostic | undefined; /** * Validates whether a MemberExpression Node on the AST adheres to a portability invariant (whether it doesn't * contain 'document', 'window' indentifiers within an expression). * @param path NodePath containing a MemberExpression to analyze for invariants * @returns PrimingDiagnostic of the MemberExpression if an invariant is detected, or undefined if none was found */ export declare function checkNoUsageOfDocumentOrWindow(path: NodePath): PrimingDiagnostic | undefined; /** * Invariant function to check weather a member expression contains a call to super. * @param path the babel path object for the current member expressoin * @returns undefined if the member expressoin does NOT contain a reference to a super var or function. Location object if there is a super reference. */ export declare function checkForNoUseOfSuper(path: NodePath): PrimingDiagnostic | undefined; /** * Function to check if there is an reference to an unsupported global reference. * @param path the member expression path node * @param astContext the ast context that holds meta data about the scr code. * @returns a Priming Diagnostic if there is a global reference undefined if none */ export declare function checkForUnsupportedGlobalRef(path: NodePath, astContext: AstContext, imports: Map, properties: ClassPropertyContexts, declaredGetterVars: string[]): PrimingDiagnostic | undefined; //# sourceMappingURL=memberExpressionInvariantFunctions.d.ts.map