@@ -6,9 +6,9 @@ This is alpha software and may yield incorrect results, feel free to [submit a b
6
6
7
7
``` javascript
8
8
import assert from ' assert' ;
9
- import oxc from ' oxc-transform' ;
9
+ import { transform } from ' oxc-transform' ;
10
10
11
- const { code , declaration , errors } = oxc . transform (
11
+ const { code , declaration , errors } = transform (
12
12
' test.ts' ,
13
13
' class A<T> {}' ,
14
14
{
@@ -17,6 +17,7 @@ const { code, declaration, errors } = oxc.transform(
17
17
},
18
18
},
19
19
);
20
+ // or `await transformAsync(filename, code, options)`
20
21
21
22
assert .equal (code, ' class A {}\n ' );
22
23
assert .equal (declaration, ' declare class A<T> {}\n ' );
@@ -31,9 +32,9 @@ Conforms to TypeScript compiler's `--isolatedDeclarations` `.d.ts` emit.
31
32
32
33
``` javascript
33
34
import assert from ' assert' ;
34
- import oxc from ' oxc-transform' ;
35
+ import { isolatedDeclaration } from ' oxc-transform' ;
35
36
36
- const { map , code , errors } = oxc . isolatedDeclaration (' test.ts' , ' class A {}' );
37
+ const { map , code , errors } = isolatedDeclaration (' test.ts' , ' class A {}' );
37
38
38
39
assert .equal (code, ' declare class A {}\n ' );
39
40
assert (errors .length == 0 );
0 commit comments