Skip to content

Commit

Permalink
Typescript button props definitions (buefy#2970)
Browse files Browse the repository at this point in the history
- add typescript button props definitons
  • Loading branch information
CharlieBrownCharacter authored Oct 11, 2020
1 parent e499965 commit 418c724
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
22 changes: 20 additions & 2 deletions types/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _Vue from "vue";
import { ColorModifiers, GlobalPositions } from "./helpers";
import {ColorModifiers, GlobalPositions, SizesModifiers} from "./helpers";

// Component base definition
export class BComponent extends _Vue {
Expand Down Expand Up @@ -95,7 +95,7 @@ export declare type BDialogConfig = {
/**
* Dialog\'s size, optional
*/
size?: 'is-small' | 'is-medium' | 'is-large';
size?: SizesModifiers;

/**
* Custom animation (transition name)
Expand Down Expand Up @@ -413,3 +413,21 @@ export interface TableColumn {
'header-class'?: string;
'cell-class'?: string;
}

export interface ButtonProps {
type?: ColorModifiers,
size?: SizesModifiers,
label?: string;
loading?: boolean;
rounded?: boolean;
outlined?: boolean;
focused?: boolean;
inverted?: boolean;
hovered?: boolean;
active?: boolean;
expanded?: boolean;
'icon-left'?: string;
'icon-right'?: string;
'native-type'?: string;
'tag'?: 'button' | 'a' | 'input' | 'router-link' | 'nuxt-link' | string;
}
1 change: 1 addition & 0 deletions types/helpers.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export type ColorModifiers = 'is-white' | 'is-black' | 'is-light' | 'is-dark' | 'is-primary' | 'is-info' | 'is-success' | 'is-warning' | 'is-danger' | string;
export type GlobalPositions = 'is-top-right' | 'is-top' | 'is-top-left' | 'is-bottom-right' | 'is-bottom' | 'is-bottom-left';
export type SizesModifiers = 'is-small' | 'is-medium' | 'is-large';

0 comments on commit 418c724

Please sign in to comment.