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

@ -13,18 +13,6 @@ export interface LocalStorageProps {
* @default ""
*/
value?: any;
/**
* Remove the persisted key value from the browser's local storage
* @default () => { localStorage.removeItem(key); }
*/
clearItem?: () => void;
/**
* Clear all key values from the browser's local storage
* @default () => { localStorage.clear(); }
*/
clearAll?: () => void;
}
export default class LocalStorage extends SvelteComponentTyped<
@ -34,4 +22,14 @@ export default class LocalStorage extends SvelteComponentTyped<
update: CustomEvent<{ prevValue: any; value: any }>;
},
{}
> {}
> {
/**
* Remove the persisted key value from the browser's local storage
*/
clearItem: () => void;
/**
* Clear all key values from the browser's local storage
*/
clearAll: () => void;
}