@readable-js/core
Version:
ReadableJS is a toolkit for teachers to craft small demos that can be explored interactively.
30 lines (29 loc) • 919 B
TypeScript
import { SourceLocation } from 'estree';
import { EsprimaNode } from '../../../estree-helper';
import { MessageWithLines } from './create-spy-string/generate-readable/generate-readable';
/**
* This object is created for each call of the spy function.
*/
export interface DefaultSpyParams {
evaluateVar?: boolean;
ifConditionTest?: boolean;
nodeCode: string;
range: [start: number, end: number];
loc: SourceLocation;
messages: MessageWithLines[];
}
export interface Options {
spyFcName?: string;
spyParamHook?: (e: EsprimaNode) => string;
range?: boolean;
/**
* Will just remove loc in return SpyParams. Not in the message itself.
*/
loc?: boolean;
classNames?: {
value?: string;
variable?: string;
expression?: string;
};
}
export declare function insertSpies(code: string, options?: Options): string;