import Vue from 'vue' ; import { PluginFunction } from 'vue/types/plugin' ; import { install } from './module/install' ; import { VueConstructor } from 'vue/types/vue' ; import { CookieHandler , UniversalCookies } from './interfaces' ; export * from './browser/index' ; export * from './express/index' ; export * from './nodeHttp/index' ; class VueUniversalCookies implements UniversalCookies { static install : PluginFunction < never > ; private handler : CookieHandler ; constructor ( options ) { this . handler = options . handler ; } get ( key ) { return this . handler . get ( key ) ; } set ( key , value , options ) { return this . handler . set ( key , value , options ) ; } remove ( key , options ) { return this . handler . remove ( key , options ) ; } } namespace VueUniversalCookies { export interface Options { handler : CookieHandler ; } } VueUniversalCookies . install = install ; if ( typeof window !== 'undefined' && typeof ( window as any ) . Vue !== 'undefined' ) { const instanceOfVue = ( window as any ) . Vue ; instanceOfVue . use ( VueUniversalCookies ) ; } export default VueUniversalCookies ;