-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d213200
commit 25a531f
Showing
6 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/svelte2tsx/test/emitDts/samples/typescript-deduplicate/expected/Test.svelte.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { type TestProps } from './foo'; | ||
declare const __propDef: { | ||
props: { | ||
p: TestProps; | ||
x?: { | ||
x: { | ||
b: string; | ||
}; | ||
}; | ||
}; | ||
events: { | ||
[evt: string]: CustomEvent<any>; | ||
}; | ||
slots: {}; | ||
}; | ||
type TestProps_ = typeof __propDef.props; | ||
export { TestProps_ as TestProps }; | ||
export type TestEvents = typeof __propDef.events; | ||
export type TestSlots = typeof __propDef.slots; | ||
export default class Test extends SvelteComponentTyped<TestProps, TestEvents, TestSlots> { | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/svelte2tsx/test/emitDts/samples/typescript-deduplicate/expected/foo.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export type TestProps = { | ||
a: true; | ||
}; | ||
type EventProps = { | ||
b: string; | ||
}; | ||
export declare function eventProps(): { | ||
x: EventProps; | ||
}; | ||
export {}; |
9 changes: 9 additions & 0 deletions
9
packages/svelte2tsx/test/emitDts/samples/typescript-deduplicate/src/Test.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script lang="ts"> | ||
import { eventProps, type TestProps } from './foo'; | ||
export let p: TestProps; | ||
export let x = eventProps(); | ||
</script> | ||
|
||
{p} | ||
{x} |
7 changes: 7 additions & 0 deletions
7
packages/svelte2tsx/test/emitDts/samples/typescript-deduplicate/src/foo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export type TestProps = { a: true }; | ||
|
||
type EventProps = { b: string }; | ||
|
||
export function eventProps(): { x: EventProps } { | ||
return { x: { b: 'b' } }; | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/svelte2tsx/test/emitDts/samples/typescript-deduplicate/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"module": "es2020", | ||
"lib": ["es2020", "DOM"], | ||
"target": "es2019", | ||
"isolatedModules": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true, | ||
"allowJs": true, | ||
"checkJs": true | ||
}, | ||
"include": ["./src/**/*.d.ts", "./src/**/*.js", "./src/**/*.ts", "./src/**/*.svelte"] | ||
} |