bootstrap-vue
Version:
With more than 85 components, over 45 available plugins, several directives, and 1000+ icons, BootstrapVue provides one of the most comprehensive implementations of the Bootstrap v4 component and grid system available for Vue.js v2.6, complete with extens
68 lines (57 loc) • 1.6 kB
TypeScript
import Vue, { Component, PluginFunction, PluginObject } from 'vue'
// Plugin Config Options
export type BvConfigComponentOptionValue =
| string
| string[]
| number
| number[]
| boolean
| object
| null
export type BvConfigBreakpointsValue = string[]
export interface BvConfigComponentOptions {
[key: string]: BvConfigComponentOptionValue | any
}
export interface BvConfigOptions {
breakpoints?: BvConfigBreakpointsValue
[key: string]: BvConfigComponentOptions | any
}
// Plugin definition
export interface BvPlugin extends PluginObject<BvConfigOptions> {
install: PluginFunction<BvConfigOptions>
}
// Component base definition
export class BvComponent extends Vue {
// Simple catch-all to allow any prop/type
[key: string]: any
}
// Generic BvEvent Object
export interface BvEvent {
readonly type: string
readonly cancelable: boolean
readonly nativeEvent: any
readonly target: any
readonly relatedTarget: any
readonly defaultPrevented: boolean
readonly vueTarget: Vue | Component | null
readonly componentId: string | null
preventDefault: () => void
// Catch all
[key: string]: any
}
// Vue prototype augments
import './vue-injections'
// BvConfig Plugin
export * from './bv-config'
// Components & Plugins
export * from './components'
// Icons & Plugin
export * from './icons'
// Directives & Plugins
export * from './directives'
// BootstrapVue plugin
export interface BootstrapVuePlugin extends BvPlugin {
setConfig: (config: BvConfigOptions) => void
}
export declare const BootstrapVue: BootstrapVuePlugin
export default BootstrapVue