712 BTypeScriptView Raw
1import { ParserOptions } from '@babel/parser';
2import * as b from '@babel/types';
3export { ParserOptions as BabylonOptions };
4export interface ExpressionToConstantOptions {
5 constants?: any;
6}
7export interface Options extends ExpressionToConstantOptions {
8 babylon?: ParserOptions;
9}
10export declare function expressionToConstant(expression: b.Expression, options?: ExpressionToConstantOptions): {
11 constant: true;
12 result: any;
13} | {
14 constant: false;
15 result?: void;
16};
17export declare function isConstant(src: string, constants?: any, options?: ParserOptions): boolean;
18export declare function toConstant(src: string, constants?: any, options?: ParserOptions): any;
19export default isConstant;