index.d.ts 692 B

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