Skip to content

Potential JavaScript API #8

@timfish

Description

@timfish

From looking at the Rust API it would be something like this?

interface InstrumentationConfig {
  // Some instrumentation config
}

function create(...configs: InstrumentationConfig[]): InstrumentationMatcher;

interface InstrumentationMatcher {
  // If this returns undefined, we know there's no transforming required for this specific file
  getTransformer(moduleName: string, moduleVersion: string, file_path: string): Transformer | undefined;
}

interface Transformer {
  transform(source: string): string;
  transformWithSourcemap(source: string, sourcemap: string): [string, string];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions