Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

Commit 595eab0

Browse files
fix(types) Select, Breadcrumbs, ExpansionPanel slot type and VirtualList type
1 parent e558afb commit 595eab0

File tree

4 files changed

+53
-5
lines changed

4 files changed

+53
-5
lines changed

packages/svelte-materialify/@types/Breadcrumbs.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ interface BreadcrumbsProps {
1919
style?: string;
2020
}
2121

22-
declare class Breadcrumbs extends SvelteComponent<BreadcrumbsProps> {}
22+
declare class Breadcrumbs extends SvelteComponent<BreadcrumbsProps> {
23+
$$slot_def: {
24+
item?: BreadcrumbItem,
25+
};
26+
}
2327

2428
export default Breadcrumbs;

packages/svelte-materialify/@types/ExpansionPanel.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ interface ExpansionPanelProps {
1818

1919
}
2020

21-
declare class ExpansionPanel extends SvelteComponent<ExpansionPanelProps> { }
21+
declare class ExpansionPanel extends SvelteComponent<ExpansionPanelProps> {
22+
$$slot_def: {
23+
active?: boolean,
24+
};
25+
}
2226

2327
export default ExpansionPanel;

packages/svelte-materialify/@types/Select.d.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import { SvelteComponent } from './shared';
22

3+
interface SelectItem { name: string | number, value: string | number }
4+
35
interface SelectProps {
46
/** Classes to add to select wrapper. */
57
class?: string;
68
/** Whether select is opened. */
79
active?: boolean;
810
/**
9-
* Value of the select.
11+
* Value of the select.
1012
* If multiple is true, this will be an array; otherwise a single value.
1113
*/
1214
value?: number[] | string[] | number | string | null;
1315
/** List of items to select from. */
14-
items?: { name: string | number, value: string | number }[];
16+
items?: SelectItem[];
1517
/** Whether select is the `filled` material design variant. */
1618
filled?: boolean;
1719
/** Whether select is the `outlined` material design variant. */
@@ -43,6 +45,10 @@ interface SelectProps {
4345
format?: (value: string | number | string[] | number[]) => string | number;
4446
}
4547

46-
declare class Select extends SvelteComponent<SelectProps> { }
48+
declare class Select extends SvelteComponent<SelectProps> {
49+
$$slot_def: {
50+
item?: SelectItem,
51+
};
52+
}
4753

4854
export default Select;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { SvelteComponent } from './shared';
2+
3+
interface VirtualListItem { text: string, subtitle?: string, items?: VirtualListItem[] }
4+
5+
interface VirtualListProps {
6+
/** Classes added to the footer. */
7+
class?: string;
8+
9+
/** Whether the list group is opened */
10+
active?: boolean;
11+
12+
/** List items */
13+
items?: VirtualListItem[];
14+
15+
/** Classes to apply to the list items */
16+
iteClasses?: string;
17+
18+
/** Depth of the list */
19+
depth?: number;
20+
21+
/** Styles to add to the footer. */
22+
style?: string;
23+
24+
/** Sets an offset on the element, takes the depth props as parameter */
25+
offsetFunction?: Function;
26+
}
27+
28+
declare class VirtualList extends SvelteComponent<VirtualListProps> {
29+
$$slot_def: {
30+
item?: VirtualListItem,
31+
};
32+
}
33+
34+
export default VirtualList;

0 commit comments

Comments
 (0)