Skip to content

Commit e0d4c78

Browse files
committed
fix types
1 parent 696c8a4 commit e0d4c78

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

packages/svelte/types/index.d.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="esrap" />
2+
13
declare module 'svelte' {
24
/**
35
* @deprecated In Svelte 4, components are classes. In Svelte 5, they are functions.
@@ -844,6 +846,7 @@ declare module 'svelte/compiler' {
844846
import type { SourceMap } from 'magic-string';
845847
import type { ArrayExpression, ArrowFunctionExpression, VariableDeclaration, VariableDeclarator, Expression, Identifier, MemberExpression, Node, ObjectExpression, Pattern, Program, ChainExpression, SimpleCallExpression, SequenceExpression } from 'estree';
846848
import type { Location } from 'locate-character';
849+
import type { default as ts } from 'esrap/languages/ts';
847850
/**
848851
* `compile` converts your `.svelte` source code into a JavaScript module that exports a component
849852
*
@@ -1812,20 +1815,8 @@ declare module 'svelte/compiler' {
18121815
| Declaration;
18131816
}
18141817
type Options = {
1815-
getLeadingComments?:
1816-
| ((
1817-
node: any
1818-
) =>
1819-
| Array<{ type: 'Line' | 'Block'; value: string; start?: number; end?: number }>
1820-
| undefined)
1821-
| undefined;
1822-
getTrailingComments?:
1823-
| ((
1824-
node: any
1825-
) =>
1826-
| Array<{ type: 'Line' | 'Block'; value: string; start?: number; end?: number }>
1827-
| undefined)
1828-
| undefined;
1818+
getLeadingComments?: NonNullable<Parameters<typeof ts>[0]>['getLeadingComments'] | undefined;
1819+
getTrailingComments?: NonNullable<Parameters<typeof ts>[0]>['getTrailingComments'] | undefined;
18291820
};
18301821

18311822
export {};

0 commit comments

Comments
 (0)