2017-12-05 01:47:27 +00:00
|
|
|
import {Component} from 'vue';
|
|
|
|
import {SharedStore, StoreMethods} from './interfaces';
|
|
|
|
|
|
|
|
export let Store: SharedStore = {
|
2019-09-17 17:14:14 +00:00
|
|
|
shared: undefined!,
|
2017-12-05 01:47:27 +00:00
|
|
|
authenticated: false
|
|
|
|
};
|
|
|
|
|
|
|
|
export const registeredComponents: {[key: string]: Component | undefined} = {};
|
|
|
|
|
|
|
|
export function registerComponent(name: string, component: Component): void {
|
|
|
|
registeredComponents[name] = component;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function registerMethod<K extends keyof StoreMethods>(name: K, func: StoreMethods[K]): void {
|
|
|
|
methods[name] = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const methods: StoreMethods = <StoreMethods>{}; //tslint:disable-line:no-object-literal-type-assertion
|