Add definitions for bootstrap-select (#12113)

This commit is contained in:
Karol Janyst
2016-10-25 19:37:44 +09:00
committed by Masahiro Wakame
parent 57a716701e
commit bf5d81c29f
2 changed files with 87 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
// Bootstrap Select Test
// ================================================================================
/// <reference path="bootstrap-select.d.ts" />
/// <reference path="../jquery/jquery.d.ts"/>
$(".selectpicker").selectpicker({
actionsBox: true,
container: "body",
countSelectedText: "counts > #",
deselectAllText: "test",
dropdownAlignRight: true,
dropupAuto: true,
header: "test",
hideDisabled: true,
iconBase: "fa",
liveSearch: true,
liveSearchNormalize: true,
liveSearchPlaceholder: "test",
liveSearchStyle: "contains",
maxOptions: 10,
maxOptionsText: "test",
mobile: true,
multipleSeparator: ", ",
noneSelectedText: "test",
selectAllText: "test",
selectedTextFormat: "values",
selectOnTab: true,
showContent: true,
showIcon: true,
showSubtext: true,
showTick: true,
size: "auto",
style: "test",
tickIcon: "test",
title: "test",
width: "auto"
})
$(".selectpicker").selectpicker("val", "foo")
$(".selectpicker").selectpicker("val", ["foo", "bar"])
$(".selectpicker").selectpicker("selectAll")
$(".selectpicker").selectpicker("setStyle", "btn-large", "add")

44
bootstrap-select/bootstrap-select.d.ts vendored Normal file
View File

@@ -0,0 +1,44 @@
// Type definitions for bootstrap-select v1.11.2
// Project: https://silviomoreto.github.io/bootstrap-select/
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface BootstrapSelectOptions {
actionsBox?: boolean
container?: string | boolean
countSelectedText?: string | Function
deselectAllText?: string
dropdownAlignRight?: string | boolean
dropupAuto?: boolean
header?: string
hideDisabled?: boolean
iconBase?: string
liveSearch?: boolean
liveSearchNormalize?: boolean
liveSearchPlaceholder?: string
liveSearchStyle?: string
maxOptions?: number | boolean
maxOptionsText?: string | Array<any> | Function
mobile?: boolean
multipleSeparator?: string
noneSelectedText?: string
selectAllText?: string
selectedTextFormat?: string
selectOnTab?: boolean
showContent?: boolean
showIcon?: boolean
showSubtext?: boolean
showTick?: boolean
size?: string | number | boolean
style?: string
tickIcon?: string
title?: string
width?: string | boolean
}
interface JQuery {
selectpicker(opts?: BootstrapSelectOptions): void
selectpicker(method: string, ...args: Array<string | Array<string>>): void
}