@@ -2,8 +2,10 @@ import { Node, NodePath, Debugger } from '../types'
22import __debug from 'debug'
33import compileGenericNodeReplacement from './GenericNodeReplacement'
44import compileGenericArrayReplacement from './GenericArrayReplacement'
5+ import CallExpression from './CallExpression'
56import ClassImplements from './ClassImplements'
67import ClassProperty from './ClassProperty'
8+ import ExportAllDeclaration from './ExportAllDeclaration'
79import ExportNamedDeclaration from './ExportNamedDeclaration'
810import ExportDefaultSpecifier from './ExportDefaultSpecifier'
911import ExportSpecifier from './ExportSpecifier'
@@ -39,18 +41,27 @@ export interface ReplaceableMatch {
3941 stringCaptures ?: Record < string , string >
4042}
4143
44+ export type GenerateReplacementOptions = {
45+ filename ?: string
46+ }
47+
4248export interface CompiledReplacement {
43- generate : ( match : ReplaceableMatch ) => Node | Node [ ]
49+ generate : (
50+ match : ReplaceableMatch ,
51+ options : GenerateReplacementOptions
52+ ) => Node | Node [ ]
4453}
4554
4655export type RootCompileReplacementOptions = {
4756 debug ?: Debugger
4857 backend : Backend
58+ getResolveAgainstDir ?: ( ) => string
4959}
5060
5161export type CompileReplacementOptions = {
5262 debug : Debugger
5363 backend : Backend
64+ getResolveAgainstDir ?: ( ) => string
5465}
5566
5667const nodeCompilers : Record <
@@ -60,8 +71,10 @@ const nodeCompilers: Record<
6071 options : CompileReplacementOptions
6172 ) => CompiledReplacement | undefined | void
6273> = {
74+ CallExpression,
6375 ClassImplements,
6476 ClassProperty,
77+ ExportAllDeclaration,
6578 ExportNamedDeclaration,
6679 ExportDefaultSpecifier,
6780 ExportSpecifier,
0 commit comments