Skip to content

Commit f69f073

Browse files
committed
feat(types): add type definitions for svelte-virtual-list module
- Declare module "@sveltejs/svelte-virtual-list" with types - Define VirtualListProps interface with items, height, itemHeight, start, and end - Export VirtualList class extending SvelteComponent with typed props - Define default slot with item parameter typed as any - Provide type safety for usage of svelte-virtual-list in projects
1 parent 5871ab1 commit f69f073

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/types/svelte-virtual-list.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
declare module "@sveltejs/svelte-virtual-list" {
2+
import { SvelteComponent } from "svelte";
3+
4+
interface VirtualListProps {
5+
items: any[];
6+
height?: string | number;
7+
itemHeight?: number;
8+
start?: number;
9+
end?: number;
10+
}
11+
12+
export default class VirtualList extends SvelteComponent<VirtualListProps> {
13+
$$slots: {
14+
default: {
15+
item: any;
16+
};
17+
};
18+
}
19+
}

0 commit comments

Comments
 (0)