Fix TypeScript definitions; function declarations should be typed as accessors, not props (#740)

* chore(deps-dev): upgrade svelte to v0.8.1

* chore: regenerate types to correctly type function declarations

* test: fix svelte-check warnings
This commit is contained in:
Eric Liu 2021-07-10 09:00:57 -07:00 committed by GitHub
commit 18c6f03224
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 951 additions and 22 deletions

View file

@ -1,7 +1,8 @@
<script lang="ts">
import { Breakpoint } from "../types";
import { BreakpointSize } from "../types/Breakpoint/Breakpoint";
let size;
let size: BreakpointSize;
</script>
<Breakpoint

View file

@ -35,7 +35,7 @@ export function subtract(a: number, b: number) {
hideCloseButton
/>
<CodeSnippet copy="{(text) => {}}"
<CodeSnippet copy="{(text) => text}"
>yarn add -D carbon-components-svelte</CodeSnippet
>

View file

@ -6,6 +6,6 @@
text="text"
on:click
on:copy
copy="{(text) => {}}"
copy="{(text) => text}"
feedback="Copied to clipboard"
/>

View file

@ -4,6 +4,9 @@
let storage: LocalStorage;
let toggled = false;
let events = [];
$: if (storage) storage.clearItem();
$: if (storage) storage.clearAll();
</script>
<LocalStorage

View file

@ -12,7 +12,10 @@
primaryButtonText="Confirm"
secondaryButtons="{[{ text: 'Cancel' }, { text: 'Duplicate' }]}"
secondaryButtonText="Cancel"
on:click:button--secondary="{({ detail }) => (open = false)}"
on:click:button--secondary="{({ detail }) => {
console.log(detail);
open = false;
}}"
on:open
on:close
on:submit