Skip to content

Commit

Permalink
feat(split-button): add ts type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
grabkowski committed May 11, 2021
1 parent 2b4aacd commit 0598f16
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/split-button/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./split-button";
29 changes: 29 additions & 0 deletions src/components/split-button/split-button.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as React from "react";
import * as OptionsHelper from "../../utils/helpers/options-helper/options-helper";

export interface SplitButtonProps {
/** Set align of the rendered content */
align?: OptionsHelper.AlignBinaryType;
/** Button type: "primary" | "secondary" for legacy theme */
as?: OptionsHelper.ThemesBinary;
/** Button type: "primary" | "secondary" */
buttonType?: OptionsHelper.ThemesBinary;
/** The additional button to display. */
children: React.ReactNode;
/** A custom value for the data-element attribute */
"data-element"?: string;
/** A custom value for the data-role attribute */
"data-role"?: string;
/** Gives the button a disabled state. */
disabled?: boolean;
/** Defines an Icon position within the button: "before" | "after" */
iconPosition?: "before" | "after";
/** The size of the buttons in the SplitButton. */
size?: OptionsHelper.SizesRestricted;
/** The text to be displayed in the SplitButton. */
text: string;
}

declare class SplitButton extends React.Component<SplitButtonProps> {}

export default SplitButton;

0 comments on commit 0598f16

Please sign in to comment.