/******************************************************************************** * MIT License * © Copyright 2023 Adobe. All rights reserved. * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************************/ import type { AnalyticsService } from "@adobe/ccweb-add-on-analytics"; import type { Logger } from "@adobe/ccweb-add-on-core"; import type { Server } from "https"; import "reflect-metadata"; import type { WebSocketServer } from "ws"; import type { AddOnDirectory } from "../models/AddOnDirectory.js"; import type { StartCommandOptions } from "../models/StartCommandOptions.js"; import type { AddOnManifestReader } from "../utilities/AddOnManifestReader.js"; import type { FileChangeTracker } from "../utilities/FileChangeTracker.js"; import type { ScriptManager } from "./ScriptManager.js"; /** * Socket Add-on factory. */ export type SocketAppFactory = (server: Server) => WebSocketServer; /** * WebSocket server implementation class to handle messaging on the Add-On server. */ export declare class SocketServer { private readonly _socketAppFactory; private readonly _fileChangeTracker; private readonly _scriptManager; private readonly _manifestReader; private readonly _logger; private readonly _analyticsService; private _watcher?; /** * Instantiate {@link SocketServer}. * * @param socketAppFactory - {@link SocketAppFactory} reference. * @param fileChangeTracker - {@link FileChangeTracker} reference. * @param scriptManager - {@link ScriptManager} reference. * @param logger - {@link Logger} reference. * @param analyticsService - {@link AnalyticsService} reference. * @returns Reference to a new {@link SocketServer} instance. */ constructor(socketAppFactory: SocketAppFactory, fileChangeTracker: FileChangeTracker, scriptManager: ScriptManager, manifestReader: AddOnManifestReader, logger: Logger, analyticsService: AnalyticsService); /** * Start the WebSocket server. * * @param addOnDirectory - {@link AddOnDirectory} Add-on directory information on which the script is executed. * @param server - {@link Server} Sever where the Add-on is hosted. * @param options - {@link StartCommandOptions} Options which the Add-on is started with. */ start(addOnDirectory: AddOnDirectory, server: Server, options: StartCommandOptions): Promise; private _watchForChanges; private _onValidationFailed; private _getMessage; } //# sourceMappingURL=SocketServer.d.ts.map