ts-swc-transform 2.6.20 → 2.6.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ export declare const moduleRegEx: RegExp;
2
+ export declare const typeFileRegEx: RegExp;
3
+ export declare const extensions: string[];
@@ -0,0 +1,2 @@
1
+ import type { Matcher, TSConfig } from './types.js';
2
+ export default function createMatcher(tsconfig: TSConfig): Matcher;
@@ -0,0 +1,8 @@
1
+ export * as constants from './constants.js';
2
+ export { default as createMatcher } from './createMatcher.js';
3
+ export { default as resolveFileSync } from './resolveFileSync.js';
4
+ export { default as toPath } from './toPath.js';
5
+ export { default as transformDirectory } from './transformDirectory.js';
6
+ export { default as transformSync } from './transformSync.js';
7
+ export { default as transformTypes } from './transformTypes.js';
8
+ export type * from './types.js';
@@ -0,0 +1 @@
1
+ export default function importMetaResolve(specifier: string, url: URL): string;
@@ -0,0 +1,5 @@
1
+ export interface Parsed {
2
+ content: string;
3
+ isSpecifier: boolean;
4
+ }
5
+ export default function parser(code: string, regex: RegExp): Parsed[];
@@ -0,0 +1,5 @@
1
+ export declare const interop = "/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }";
2
+ import type { Output } from '@swc/core';
3
+ import type { Entry } from 'fs-iterator';
4
+ import type { ConfigOptions } from '../types.js';
5
+ export default function patchCJS(entry: Entry, output: Output, options: ConfigOptions): string;
@@ -0,0 +1,4 @@
1
+ import type { Output } from '@swc/core';
2
+ import type { Entry } from 'fs-iterator';
3
+ import type { ConfigOptions } from '../types.js';
4
+ export default function patchESM(entry: Entry, output: Output, options: ConfigOptions): string;
@@ -0,0 +1,7 @@
1
+ import type { Options } from '@swc/core';
2
+ import type { TSConfig } from '../types.js';
3
+ export interface TranspilerOptions {
4
+ tsxOptions: Options;
5
+ nonTsxOptions: Options;
6
+ }
7
+ export default function prepareSWCOptions(tsconfig: TSConfig): TranspilerOptions;
@@ -0,0 +1,9 @@
1
+ export declare const extensions: {
2
+ '.ts': string;
3
+ '.tsx': string;
4
+ '.mts': string;
5
+ '.cts': string;
6
+ };
7
+ export declare function replaceExtension(ext: string): string;
8
+ export declare function rewriteExtensions(content: string): string;
9
+ export declare function rewriteExtensionsCJS(content: string): string;
@@ -0,0 +1,3 @@
1
+ import type { Entry } from 'fs-iterator';
2
+ import type { ConfigOptions, TargetType, TransformFileCallback } from '../types.js';
3
+ export default function transformFile(entry: Entry, dest: string, type: TargetType, options: ConfigOptions, callback: TransformFileCallback): undefined;
@@ -0,0 +1,3 @@
1
+ import URL from 'core-js-pure/actual/url/index.js';
2
+ export declare function fileURLToPath(url: string | URL): string;
3
+ export declare function pathToFileURL(pathname: string): URL;
@@ -0,0 +1,2 @@
1
+ import type { Context } from './types.js';
2
+ export default function resolveFileSync(specifier: string, context?: Context): string;
@@ -0,0 +1,2 @@
1
+ import type { Context } from './types.js';
2
+ export default function toPath(specifier: string, context?: Context): string;
@@ -0,0 +1,2 @@
1
+ import type { ConfigOptions, TargetType, TransformDirectoryCallback } from './types.js';
2
+ export default function transformDirectory(src: string, dest: string, type: TargetType, options?: ConfigOptions | TransformDirectoryCallback, callback?: TransformDirectoryCallback): undefined | Promise<string[]>;
@@ -0,0 +1,3 @@
1
+ import type { TSConfig } from './types.js';
2
+ import type { Output } from '@swc/core';
3
+ export default function transformSync(contents: string, fileName: string, tsconfig?: TSConfig): Output;
@@ -0,0 +1,2 @@
1
+ import type { ConfigOptions, TransformTypesCallback } from './types.js';
2
+ export default function transformTypes(src: string, dest: string, options?: ConfigOptions | TransformTypesCallback, callback?: TransformTypesCallback): undefined | Promise<string[]>;
@@ -0,0 +1,16 @@
1
+ import type { TSConfig } from 'read-tsconfig-sync';
2
+ export interface Context {
3
+ parentURL?: string;
4
+ parentPath?: string;
5
+ }
6
+ export type { TSConfig, TSConfigSchema } from 'read-tsconfig-sync';
7
+ export interface ConfigOptions {
8
+ tsconfig?: TSConfig;
9
+ cwd?: string;
10
+ sourceMaps?: boolean;
11
+ }
12
+ export type TransformDirectoryCallback = (err?: Error, filePaths?: string[]) => void;
13
+ export type TransformFileCallback = (err?: Error, destFilePath?: string) => void;
14
+ export type TransformTypesCallback = (err?: Error, filePaths?: string[]) => void;
15
+ export type Matcher = (filePath: string) => boolean;
16
+ export type TargetType = 'cjs' | 'esm';
@@ -0,0 +1,2 @@
1
+ import type { ConfigOptions, TargetType, TransformDirectoryCallback } from '../types.js';
2
+ export default function transformDirectoryWorker(src: string, dest: string, type: TargetType, options: ConfigOptions, callback: TransformDirectoryCallback): undefined;
@@ -0,0 +1,3 @@
1
+ import type { Output } from '@swc/core';
2
+ import type { TSConfig } from '../types.js';
3
+ export default function transformSyncWorker(contents: string, fileName: string, tsconfig: TSConfig): Output;
@@ -0,0 +1,2 @@
1
+ import type { ConfigOptions, TransformTypesCallback } from '../types.js';
2
+ export default function transformTypesWorker(src: string, dest: string, options: ConfigOptions, callback: TransformTypesCallback): undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-swc-transform",
3
- "version": "2.6.20",
3
+ "version": "2.6.22",
4
4
  "description": "Typescript transformers for swc. Supports Node >= 0.8",
5
5
  "keywords": [
6
6
  "matcher",
@@ -42,7 +42,7 @@
42
42
  "version": "tsds version"
43
43
  },
44
44
  "dependencies": {
45
- "@swc/core": "*",
45
+ "@swc/core": "1.15.0",
46
46
  "core-js-pure": "*",
47
47
  "exit": "*",
48
48
  "fs-iterator": "*",