microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/common/extensionMessaging.ts
29lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | import {HostPlatform} from "./hostPlatform"; |
| 5 | |
| 6 | /** |
| 7 | * Defines the messages sent to the extension. |
| 8 | * Add new messages to this enum. |
| 9 | */ |
| 10 | export enum ExtensionMessage { |
| 11 | START_PACKAGER, |
| 12 | STOP_PACKAGER, |
| 13 | PREWARM_BUNDLE_CACHE, |
| 14 | START_MONITORING_LOGCAT, |
| 15 | STOP_MONITORING_LOGCAT |
| 16 | } |
| 17 | |
| 18 | export interface MessageWithArguments { |
| 19 | message: ExtensionMessage; |
| 20 | args: any[]; |
| 21 | } |
| 22 | |
| 23 | export let ErrorMarker = "vscodereactnative-error-marker"; |
| 24 | |
| 25 | export class MessagingChannel { |
| 26 | public getPath(): string { |
| 27 | return HostPlatform.getExtensionPipePath(); |
| 28 | } |
| 29 | } |
| 30 | |