Skip to content

Commit 6890743

Browse files
committed
improve types
1 parent a09d68d commit 6890743

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

packages/svelte/src/compiler/phases/1-parse/read/options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default function read_options(node) {
1212
const component_options = {
1313
start: node.start,
1414
end: node.end,
15+
// @ts-ignore
1516
attributes: node.attributes
1617
};
1718

packages/svelte/src/compiler/phases/1-parse/read/script.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export function read_script(parser, start, attributes) {
6464
context: get_context(attributes),
6565
content: ast,
6666
parent: null,
67+
// @ts-ignore
6768
attributes: attributes
6869
};
6970
}

packages/svelte/src/compiler/types/template.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export interface SvelteOptions {
9393
*/
9494
extend?: ArrowFunctionExpression | Identifier;
9595
};
96-
attributes: Array<Attribute | SpreadAttribute | Directive>;
96+
attributes: Attribute[];
9797
}
9898

9999
/** Static text */
@@ -468,7 +468,7 @@ export interface Script extends BaseNode {
468468
type: 'Script';
469469
context: string;
470470
content: Program;
471-
attributes: Array<Attribute | SpreadAttribute | Directive>;
471+
attributes: Attribute[];
472472
}
473473

474474
declare module 'estree' {

packages/svelte/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ declare module 'svelte/compiler' {
13161316
*/
13171317
extend?: ArrowFunctionExpression | Identifier;
13181318
};
1319-
attributes: Array<Attribute | SpreadAttribute | Directive>;
1319+
attributes: Attribute[];
13201320
}
13211321

13221322
/** Static text */
@@ -1691,7 +1691,7 @@ declare module 'svelte/compiler' {
16911691
type: 'Script';
16921692
context: string;
16931693
content: Program;
1694-
attributes: Array<Attribute | SpreadAttribute | Directive>;
1694+
attributes: Attribute[];
16951695
}
16961696
/**
16971697
* The result of a preprocessor run. If the preprocessor does not return a result, it is assumed that the code is unchanged.

0 commit comments

Comments
 (0)