-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(configurable-items): add ts type definitions
- Loading branch information
1 parent
15c044e
commit 769ad47
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/components/configurable-items/configurable-item-row/configurable-item-row.d.ts
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from "react"; | ||
|
||
export interface ConfigurableItemRowProps { | ||
/** A custom class name for the component. */ | ||
className?: string; | ||
/** The checked value for the checkbox. */ | ||
enabled?: boolean; | ||
/** The disabled value for the checkbox. */ | ||
locked?: boolean; | ||
/** The label for the row. */ | ||
name?: string; | ||
/** Callback triggered when the checkbox checked value is updated. */ | ||
onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void; | ||
/** The unique index for the row. */ | ||
rowIndex: number; | ||
/** An internal prop. Helpful to detect which component should be rendered */ | ||
theme?: object; | ||
} | ||
|
||
declare function ConfigurableItemRow(props: ConfigurableItemRowProps): JSX.Element; | ||
|
||
export { ConfigurableItemRow as ConfigurableItemRowWithoutHOC }; | ||
export default ConfigurableItemRow; |
1 change: 1 addition & 0 deletions
1
src/components/configurable-items/configurable-item-row/index.d.ts
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "./configurable-item-row"; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as React from "react"; | ||
|
||
export interface ConfigurableItemsProps { | ||
/** Children elements. */ | ||
children?: React.ReactNode; | ||
/** A custom class name for the component. */ | ||
className?: string; | ||
/** Callback triggered when an item is dragged. */ | ||
onDrag: (originalIndex: number, hoverIndex: number) => void; | ||
/** Callback triggered when when the reset button is pressed. */ | ||
onReset?: () => void; | ||
/** Callback triggered when the form is saved. */ | ||
onSave: (ev: React.FormEvent<HTMLFormElement>) => void; | ||
/** An internal prop. Helpful to detect which component should be rendered */ | ||
theme?: object; | ||
|
||
} | ||
|
||
declare function ConfigurableItems(props: ConfigurableItemsProps): JSX.Element; | ||
|
||
export default ConfigurableItems; |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as ConfigurableItems } from "./configurable-items"; | ||
export { default as ConfigurableItemRow } from "./configurable-item-row/configurable-item-row"; |