Skip to content

Commit 4db2db6

Browse files
committed
Export types
1 parent 6f67608 commit 4db2db6

File tree

10 files changed

+28
-21
lines changed

10 files changed

+28
-21
lines changed

src/angular-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
type TemplateBindingParseResult,
99
} from '@angular/compiler';
1010

11-
import { type CommentLine } from './types.js';
12-
import { sourceSpanToLocationInformation } from './utils.js';
11+
import { type CommentLine } from './types.ts';
12+
import { sourceSpanToLocationInformation } from './utils.ts';
1313

1414
// https://github.com/angular/angular/blob/5e9707dc84e6590ec8c9d41e7d3be7deb2fa7c53/packages/compiler/test/expression_parser/utils/span.ts
1515
function getFakeSpan(fileName = 'test.html') {

src/estree-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as angularParser from './angular-parser.js';
2-
import { transformAstResult, transformMicrosyntaxResult } from './transform.js';
1+
import * as angularParser from './angular-parser.ts';
2+
import { transformAstResult, transformMicrosyntaxResult } from './transform.ts';
33

44
export const parseBinding = (text: string) =>
55
transformAstResult(angularParser.parseBinding(text));

src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
export * from './estree-parser.js';
2-
export type { NGMicrosyntax, NGNode } from './types.ts';
3-
export { visitorKeys } from './visitor-keys.js';
1+
export {
2+
parseAction,
3+
parseBinding,
4+
parseInterpolationExpression,
5+
parseSimpleBinding,
6+
parseTemplateBindings,
7+
} from './estree-parser.ts';
8+
export type * as NGTree from './types.ts';
9+
export { visitorKeys } from './visitor-keys.ts';

src/source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type * as babel from '@babel/types';
22

3-
import type { LocationInformation, NGNode, RawNGSpan } from './types.js';
3+
import type { LocationInformation, NGNode, RawNGSpan } from './types.ts';
44
import {
55
fitSpans,
66
getCharacterIndex,
77
getCharacterLastIndex,
88
sourceSpanToLocationInformation,
9-
} from './utils.js';
9+
} from './utils.ts';
1010

1111
export class Source {
1212
text;

src/transform-node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import * as angular from '@angular/compiler';
22
import type * as babel from '@babel/types';
33

4-
import { Source } from './source.js';
4+
import { Source } from './source.ts';
55
import type {
66
LocationInformation,
77
NGChainedExpression,
88
NGEmptyExpression,
99
NGNode,
1010
NGPipeExpression,
1111
RawNGSpan,
12-
} from './types.js';
12+
} from './types.ts';
1313

1414
function isParenthesized(node: NGNode) {
1515
return Boolean(node.extra?.parenthesized);

src/transform-template-binding.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
VariableBinding as NGVariableBinding,
55
} from '@angular/compiler';
66

7-
import { Transformer as NodeTransformer } from './transform-node.js';
7+
import { Transformer as NodeTransformer } from './transform-node.ts';
88
import type {
99
NGMicrosyntax,
1010
NGMicrosyntaxAs,
@@ -15,8 +15,8 @@ import type {
1515
NGMicrosyntaxNode,
1616
NGNode,
1717
RawNGSpan,
18-
} from './types.js';
19-
import { lowercaseFirst } from './utils.js';
18+
} from './types.ts';
19+
import { lowercaseFirst } from './utils.ts';
2020

2121
function isExpressionBinding(
2222
templateBinding: angular.TemplateBinding,

src/transform.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type {
22
AstParseResult,
33
MicroSyntaxParseResult,
4-
} from './angular-parser.js';
5-
import { transform as transformNode } from './transform-node.js';
6-
import { transform as transformTemplateBindings } from './transform-template-binding.js';
4+
} from './angular-parser.ts';
5+
import { transform as transformNode } from './transform-node.ts';
6+
import { transform as transformTemplateBindings } from './transform-template-binding.ts';
77

88
function transformAstResult({
99
result: { ast },

src/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { codeFrameColumns } from '@babel/code-frame';
22
import { wrap } from 'jest-snapshot-serializer-raw';
33

4-
import type { RawNGSpan } from './types.js';
5-
import { fitSpans, getCharacterIndex, getCharacterLastIndex } from './utils.js';
4+
import type { RawNGSpan } from './types.ts';
5+
import { fitSpans, getCharacterIndex, getCharacterLastIndex } from './utils.ts';
66

77
const text = ` ( ( ( 1 ) ) ) `;
88
const length = Math.floor(text.length / 2);

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { LocationInformation, RawNGSpan } from './types.js';
1+
import type { LocationInformation, RawNGSpan } from './types.ts';
22

33
function stripSurroundingSpaces(
44
{ start: startIndex, end: endIndex }: RawNGSpan,

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"esModuleInterop": true,
99
"skipLibCheck": true,
1010
"types": ["vitest/globals"],
11-
"noEmit": true
11+
"noEmit": true,
12+
"allowImportingTsExtensions": true
1213
},
1314
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"]
1415
}

0 commit comments

Comments
 (0)