mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
fix(types): upgrade sveld and type constant props as accessors (#742)
This commit is contained in:
parent
fac78ee4aa
commit
54e1e07872
10 changed files with 63 additions and 61 deletions
16
types/ImageLoader/ImageLoader.d.ts
vendored
16
types/ImageLoader/ImageLoader.d.ts
vendored
|
@ -44,17 +44,17 @@ export interface ImageLoaderProps
|
|||
* @default false
|
||||
*/
|
||||
fadeIn?: boolean;
|
||||
|
||||
/**
|
||||
* Method invoked to load the image provided a `src` value
|
||||
* @constant
|
||||
* @default (url) => { if (image != null) image = null; loaded = false; error = false; image = new Image(); image.src = url || src; image.onload = () => (loaded = true); image.onerror = () => (error = true); }
|
||||
*/
|
||||
loadImage?: (url?: string) => void;
|
||||
}
|
||||
|
||||
export default class ImageLoader extends SvelteComponentTyped<
|
||||
ImageLoaderProps,
|
||||
{ load: CustomEvent<any>; error: CustomEvent<any> },
|
||||
{ error: {}; loading: {} }
|
||||
> {}
|
||||
> {
|
||||
/**
|
||||
* Method invoked to load the image provided a `src` value
|
||||
* @constant
|
||||
* @default (url) => { if (image != null) image = null; loaded = false; error = false; image = new Image(); image.src = url || src; image.onload = () => (loaded = true); image.onerror = () => (error = true); }
|
||||
*/
|
||||
loadImage: (url?: string) => void;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue