Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript definition file #203

Open
ArthurBorsboom opened this issue Oct 14, 2018 · 0 comments
Open

Typescript definition file #203

ArthurBorsboom opened this issue Oct 14, 2018 · 0 comments

Comments

@ArthurBorsboom
Copy link

While searching for a Typescript definition file for bootstrap toggle, I have found a beginning on stackoverflow, which I have extended for my use cases. The defintion file is far from complete, however it is a nice start.

I would like to share it here, so hopefully someone can pick it up and extend it, to make it publicly available.

Filename: index.d.ts

interface BootstrapToggleOptions {
    on?: string;
    off?: string;
    onstyle?: OnOffStyle;
    offstyle?: OnOffStyle;
    size?: Size;
    width?: number;
    height?: number;
}

type BootstrapToggleMethods = "destroy" | "on" | "off" | "toggle" | "enable" | "disable";
type OnOffStyle = "default" | "primary" | "success" | "info" | "warning" | "danger";
type Size = "large" | "normal" | "small" | "mini";

interface JQuery {
    bootstrapToggle(): JQuery;
    bootstrapToggle( options?: BootstrapToggleOptions ): JQuery;
    bootstrapToggle( method?: BootstrapToggleMethods ): JQuery;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant