-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(component-parser): function declarations should be typed as acces…
…sors, not props (#34) * fix(component-parser): function declarations should be typed as accessors, not props * test(writer): update writer-ts-definitions unit test
- Loading branch information
Showing
23 changed files
with
975 additions
and
13 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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,19 @@ | ||
<script> | ||
export let fnA = () => {}; | ||
export const fnB = () => {}; | ||
export function add(a, b) { | ||
return a + b; | ||
} | ||
/** | ||
* Multiplies two numbers | ||
* @type {(a: number, b: number) => number} | ||
*/ | ||
export function multiply(a, b) { | ||
return a * b; | ||
} | ||
</script> | ||
|
||
<h1 on:click={fnA}>Heading</h1> |
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,24 @@ | ||
/// <reference types="svelte" /> | ||
import { SvelteComponentTyped } from "svelte"; | ||
|
||
export interface InputProps { | ||
/** | ||
* @default () => {} | ||
*/ | ||
fnA?: () => {}; | ||
|
||
/** | ||
* @constant | ||
* @default () => {} | ||
*/ | ||
fnB?: () => {}; | ||
} | ||
|
||
export default class Input extends SvelteComponentTyped<InputProps, {}, {}> { | ||
add?: () => any; | ||
|
||
/** | ||
* Multiplies two numbers | ||
*/ | ||
multiply?: (a: number, b: number) => number; | ||
} |
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,48 @@ | ||
{ | ||
"props": [ | ||
{ | ||
"name": "fnA", | ||
"kind": "let", | ||
"type": "() => {}", | ||
"value": "() => {}", | ||
"isFunction": true, | ||
"isFunctionDeclaration": false, | ||
"constant": false, | ||
"reactive": false | ||
}, | ||
{ | ||
"name": "fnB", | ||
"kind": "const", | ||
"type": "() => {}", | ||
"value": "() => {}", | ||
"isFunction": true, | ||
"isFunctionDeclaration": false, | ||
"constant": true, | ||
"reactive": false | ||
}, | ||
{ | ||
"name": "add", | ||
"kind": "function", | ||
"type": "() => any", | ||
"value": "() => { return a + b; }", | ||
"isFunction": true, | ||
"isFunctionDeclaration": true, | ||
"constant": false, | ||
"reactive": false | ||
}, | ||
{ | ||
"name": "multiply", | ||
"kind": "function", | ||
"description": "Multiplies two numbers", | ||
"type": "(a: number, b: number) => number", | ||
"value": "() => { return a * b; }", | ||
"isFunction": true, | ||
"isFunctionDeclaration": true, | ||
"constant": false, | ||
"reactive": false | ||
} | ||
], | ||
"slots": [], | ||
"events": [], | ||
"typedefs": [] | ||
} |
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
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
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
Oops, something went wrong.