File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
packages/svelte/tests/runtime-runes/samples/typescript Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { test } from '../../test' ;
2
+
3
+ export default test ( {
4
+ html : '<button>clicks: 0</button>' ,
5
+
6
+ async test ( { assert, target } ) {
7
+ const btn = target . querySelector ( 'button' ) ;
8
+ await btn ?. click ( ) ;
9
+ assert . htmlEqual ( target . innerHTML , `<button>clicks: 1</button>` ) ;
10
+ }
11
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <script context =" module" lang =" ts" >
2
+ interface Hello { message: ' hello' }
3
+ type Goodbye = { message: ' goodbye' };
4
+
5
+ export type { Hello };
6
+ </script >
7
+
8
+ <script >
9
+ import type { Foo } from ' ./types' ;
10
+ import { type Bar , type Baz } from ' ./types' ;
11
+
12
+ let count = $state (0 );
13
+ const person = {
14
+ message: ' goodbye'
15
+ } satisfies Goodbye;
16
+ </script >
17
+
18
+ <button
19
+ on:click ={(e : MouseEvent ) => {
20
+ const next: number = count + 1 ;
21
+ count = next ! as number ;
22
+ }}
23
+ >clicks: {count }</button >
Original file line number Diff line number Diff line change
1
+ export interface Foo { }
2
+ export interface Bar { }
3
+ export interface Baz { }
You can’t perform that action at this time.
0 commit comments