import { PlatformServiceName, } from "@limetech/lime-web-components";
import { HighlightFeedItemHandler } from "../feed/highlight-item/highlight-item.handler";
import { HighlightFeedItemCommand } from "../feed/highlight-item/highlight-item.command";
export class CrmComponentsLoader {
    connectedCallback() { }
    async componentWillLoad() {
        const highlightFeedItemHandler = new HighlightFeedItemHandler();
        this.platform.register(HighlightFeedItemHandler.SERVICE_NAME, highlightFeedItemHandler);
        this.commandBus.register(HighlightFeedItemCommand, highlightFeedItemHandler);
        this.loaded.emit();
    }
    componentWillUpdate() { }
    disconnectedCallback() { }
    get commandBus() {
        return this.platform.get(PlatformServiceName.CommandBus);
    }
    static get is() { return "limebb-loader"; }
    static get encapsulation() { return "shadow"; }
    static get properties() {
        return {
            "platform": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "LimeWebComponentPlatform",
                    "resolved": "LimeWebComponentPlatform",
                    "references": {
                        "LimeWebComponentPlatform": {
                            "location": "import",
                            "path": "@limetech/lime-web-components",
                            "id": "node_modules::LimeWebComponentPlatform",
                            "referenceLocation": "LimeWebComponentPlatform"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "inheritdoc",
                            "text": undefined
                        }],
                    "text": "Reference to the platform service container.\n\nUse this to access all platform services like repositories, HTTP client,\ncommand bus, navigator, and more. The platform instance is shared across\nall components in the same application context."
                },
                "getter": false,
                "setter": false
            },
            "context": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "LimeWebComponentContext",
                    "resolved": "LimeWebComponentContext",
                    "references": {
                        "LimeWebComponentContext": {
                            "location": "import",
                            "path": "@limetech/lime-web-components",
                            "id": "node_modules::LimeWebComponentContext",
                            "referenceLocation": "LimeWebComponentContext"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "inheritdoc",
                            "text": undefined
                        }],
                    "text": "The context describing where this component is running.\n\nThe context provides information about the current limetype and record ID\n(if viewing/editing a specific record). Components can use this to load\nrelevant data and understand their operating environment."
                },
                "getter": false,
                "setter": false
            }
        };
    }
    static get events() {
        return [{
                "method": "loaded",
                "name": "loaded",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the component has loaded and is fully initialized"
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }];
    }
}
