UNPKG

@syntest/analysis-javascript

Version:

SynTest CFG JavaScript is a library for generating control flow graphs for the JavaScript language

45 lines 2.75 kB
import { ObjectType } from "./Type"; import { TypeEnum } from "./TypeEnum"; export declare class TypeModel { private _elements; private _relationScoreMap; private _elementTypeScoreMap; private _typeExecutionScoreMap; private _elementTypeProbabilityMap; private _scoreHasChangedMap; private _objectTypeDescription; constructor(); get relationScoreMap(): Map<string, Map<string, number>>; get elementTypeScoreMap(): Map<string, Map<string, number>>; get typeExecutionScoreMap(): Map<string, Map<string, number>>; getObjectDescription(element: string): ObjectType; addId(id: string): void; setEqual(id1: string, id2: string): void; private _addRelationScore; addWeakRelation(id1: string, id2: string): void; addStrongRelation(id1: string, id2: string): void; addRelationScore(id1: string, id2: string, score: number): void; addStrongTypeScore(id: string, type: TypeEnum): void; addTypeScore(id: string, type: TypeEnum, score?: number): void; addPropertyType(element: string, property: string, id: string): void; addParameterType(element: string, index: number, id: string, name: string): void; addReturnType(element: string, returnId: string): void; addElementType(element: string, id: string): void; addExecutionScore(id: string, typeId: string, typeEnum: TypeEnum, score?: number): void; private _sum; /** * * @param incorporateExecutionScore wether the execution score should be weighted in * @param id the id we want to get a random type for * @param matchType (optional) the type enum you want to get (there can be multiple object/function/array types) * @returns a string describing the type */ getRandomType(incorporateExecutionScore: boolean, randomTypeProbability: number, id: string): string; getHighestProbabilityType(incorporateExecutionScore: boolean, randomTypeProbability: number, id: string): string; calculateProbabilitiesForFile(incorporateExecutionScore: boolean, filepath: string): Map<string, Map<string, number>>; calculateProbabilitiesForElement(incorporateExecutionScore: boolean, id: string, relationPairsVisited?: Map<string, Set<string>>): Map<string, number>; incorporateRelation(id: string, probabilityMap: Map<string, number>, relation: string, relationMap: Map<string, number>, relationPairsVisited: Map<string, Set<string>>, totalScore: number, incorporateExecutionScore: boolean): Map<string, number>; incorporateExecutionScores(id: string, probabilityMap: Map<string, number>, incorporateExecutionScore: boolean): Map<string, number>; normalizeProbabilities(probabilityMap: Map<string, number>): Map<string, number>; } //# sourceMappingURL=TypeModel.d.ts.map