Skip to content

Commit a060f19

Browse files
refactor: ♻️ exported TS types back (#632)
1 parent 025483f commit a060f19

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/hooks/use-multi-select.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useState } from "react";
22

3-
import { ISelectProps, Option } from "../lib/interfaces";
3+
import { Option, SelectProps } from "../lib/interfaces";
44

55
const defaultStrings = {
66
allItemsAreSelected: "All items are selected.",
@@ -14,21 +14,21 @@ const defaultStrings = {
1414
create: "Create",
1515
};
1616

17-
const defaultProps: Partial<ISelectProps> = {
17+
const defaultProps: Partial<SelectProps> = {
1818
value: [],
1919
hasSelectAll: true,
2020
className: "multi-select",
2121
debounceDuration: 200,
2222
options: [] as Option[],
2323
};
2424

25-
interface MultiSelectContextProps extends ISelectProps {
25+
interface MultiSelectContextProps extends SelectProps {
2626
t: (key: string) => string;
2727
setOptions?;
2828
}
2929

3030
interface MultiSelectProviderProps {
31-
props: ISelectProps;
31+
props: SelectProps;
3232
children;
3333
}
3434

src/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import { Option, SelectProps } from "./lib/interfaces";
12
import MultiSelect from "./multi-select";
23
import Dropdown from "./multi-select/dropdown";
34
import SelectPanel from "./select-panel";
45
import SelectItem from "./select-panel/select-item";
56

67
export { Dropdown, MultiSelect, SelectItem, SelectPanel };
8+
9+
export type { Option, SelectProps };

src/lib/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface Option {
77
disabled?: boolean;
88
}
99

10-
export interface ISelectProps {
10+
export interface SelectProps {
1111
options: Option[];
1212
value: Option[];
1313
onChange?;

src/multi-select/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import "../style.css";
33
import React from "react";
44

55
import { MultiSelectProvider } from "../hooks/use-multi-select";
6-
import { ISelectProps } from "../lib/interfaces";
6+
import { SelectProps } from "../lib/interfaces";
77
import Dropdown from "./dropdown";
88

9-
const MultiSelect = (props: ISelectProps) => (
9+
const MultiSelect = (props: SelectProps) => (
1010
<MultiSelectProvider props={props}>
1111
<div className={`rmsc ${props.className || "multi-select"}`}>
1212
<Dropdown />

0 commit comments

Comments
 (0)