bootstrap-vue
Version:
BootstrapVue, with more than 85 custom components, over 45 plugins, several custom directives, and over 300 icons, provides one of the most comprehensive implementations of Bootstrap v4 components and grid system for Vue.js. With extensive and automated W
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