Skip to content

Commit 8dab470

Browse files
committed
Fixes to syntax typing
1 parent 1525850 commit 8dab470

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

fluent-langneg/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
*/
99

10-
export {negotiateLanguages, NegotiateLanguagesOptions} from "./negotiate_languages";
10+
export {
11+
negotiateLanguages, NegotiateLanguagesOptions
12+
} from "./negotiate_languages";
1113
export {acceptedLanguages} from "./accepted_languages";
1214
export {filterMatches} from "./matches";

fluent-syntax/src/ast.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ export abstract class SyntaxNode extends BaseNode {
8787

8888
export class Resource extends SyntaxNode {
8989
public type = "Resource" as const;
90-
public body: Array<Entry | Junk>;
91-
constructor(body: Array<Entry | Junk> = []) {
90+
public body: Array<Entry>;
91+
constructor(body: Array<Entry> = []) {
9292
super();
9393
this.body = body;
9494
}
@@ -421,7 +421,7 @@ export class Junk extends SyntaxNode {
421421
}
422422

423423
export class Span extends BaseNode {
424-
public type = "Span";
424+
public type = "Span" as const;
425425
public start: number;
426426
public end: number;
427427

@@ -433,7 +433,7 @@ export class Span extends BaseNode {
433433
}
434434

435435
export class Annotation extends SyntaxNode {
436-
public type = "Annotation";
436+
public type = "Annotation" as const;
437437
public code: string;
438438
public arguments: Array<unknown>;
439439
public message: string;

fluent-syntax/src/visitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export abstract class Transformer extends Visitor {
9393
return this.genericVisit(node);
9494
}
9595

96-
genericVisit(node: AST.BaseNode): AST.BaseNode | undefined {
96+
genericVisit(node: AST.BaseNode): AST.BaseNode {
9797
for (const key of Object.keys(node)) {
9898
let prop = node[key];
9999
if (prop instanceof AST.BaseNode) {

0 commit comments

Comments
 (0)