-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use built in svelte component typing
- Loading branch information
Showing
4 changed files
with
49 additions
and
56 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,28 +1,40 @@ | ||
type LocalSvelteProps = { | ||
children?: any; | ||
class?: string; | ||
[key: string]: any; | ||
}; | ||
import { SvelteComponentTyped } from "svelte"; | ||
|
||
/** | ||
* Local svelte class for adding typescript definitions for svelte components | ||
* | ||
*/ | ||
export declare class SvelteComponent<Props = {}> { | ||
constructor(props: Props & LocalSvelteProps); | ||
$on<T = any>( | ||
event: string, | ||
callback: (event: CustomEvent<T>) => void | ||
): () => void; | ||
$$prop_def: Props & LocalSvelteProps; | ||
$$slot_def: { | ||
default?: {}; | ||
}; | ||
render: undefined; | ||
context: undefined; | ||
setState: undefined; | ||
forceUpdate: undefined; | ||
props: undefined; | ||
state: undefined; | ||
refs: undefined; | ||
declare type Weight = | ||
| "bold" | ||
| "duotone" | ||
| "fill" | ||
| "light" | ||
| "thin" | ||
| "regular"; | ||
|
||
export interface IconProps { | ||
/** | ||
* @type {string} | ||
* @default "currentColor" | ||
*/ | ||
color?: string; | ||
/** | ||
* @type {number|string} | ||
* @default "1em" | ||
*/ | ||
size?: number | string; | ||
/** | ||
* @type {string} | ||
* @default "regular" | ||
*/ | ||
weight?: Weight; | ||
/** | ||
* @type {boolean} | ||
* @default false | ||
*/ | ||
mirrored?: boolean; | ||
} | ||
|
||
export class SvelteComponent<Props = {}> extends SvelteComponentTyped< | ||
Props, | ||
any, | ||
{ | ||
default?: {}; | ||
} | ||
> {} |
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