/**
 * Base class for all AdapTable Plugins
 */
export class AdaptablePlugin {
    constructor(options) {
        this.pluginId = '';
        this.options = options;
        this.values = {};
    }
    registerProperty(name, fn) {
        this.values[name] = fn;
    }
    getProperty(name) {
        return (...args) => {
            const fn = this.values[name];
            if (fn) {
                return fn(...args);
            }
        };
    }
    hasProperty(name) {
        return !!this.values[name];
    }
    // plugin lifecycle methods, executed in this exact order
    // wondering if this is better?
    beforeInit(adaptableOptions, 
    // adding a nested object allows plugins to modify gridOptions
    agGridOptions) { }
    afterInitOptions(adaptable, adaptableOptions) { }
    afterInitApi(adaptable, api) { }
    afterInitServices(adaptable) { }
    afterInitialStateLoaded(adaptable) { }
    afterInitModules(adaptable, strategies) { }
    afterInitStore(adaptable) { }
    afterInit(ab) { }
    // hook executed after each layout update (Adaptable.setLayout())
    afterSetLayout(adaptable, layout) { }
    onStoreEvent(eventName, data, adaptableStore) { }
    onAdaptableReady(adaptable, adaptableOptions) { }
}
