@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
38 lines (37 loc) • 1.88 kB
TypeScript
import type { RShell } from '../../r-bridge/shell';
import type { FlowrMessage, IdMessageBase, MessageDefinition } from '../../cli/repl/server/messages/all-messages';
import type { FakeServer, FakeSocket } from '../../../test/functionality/_helper/net';
export interface ServerMessageDescription {
readonly title: string;
readonly type: 'request' | 'response';
readonly mermaidSequenceDiagram: string;
readonly shortDescription: string;
readonly definitionPath: string;
readonly defRequest?: MessageDefinition<IdMessageBase>;
readonly defResponse?: MessageDefinition<IdMessageBase>;
readonly additionalDefs?: MessageDefinition<IdMessageBase>[];
readonly text: (shell: RShell) => Promise<string>;
}
export declare function documentServerMessage(description: ServerMessageDescription): void;
export declare function printServerMessages(shell: RShell): Promise<string>;
export declare function inServerContext<T>(shell: RShell, fn: (socket: FakeSocket, server: FakeServer) => Promise<T> | T): Promise<T>;
interface ResponseMessageInPingPong {
readonly type: 'response';
readonly expectedType: FlowrMessage['type'];
readonly description?: string | ((msg: IdMessageBase) => string);
readonly mark?: boolean;
}
interface RequestMessageInPingPong {
readonly type: 'request';
readonly message: FlowrMessage;
readonly description?: string | ((msg: IdMessageBase) => string);
readonly mark?: boolean;
}
export interface MessagePingPongDocumentationArguments {
readonly shell: RShell;
readonly title?: string;
readonly messageType?: FlowrMessage['type'];
readonly messages: readonly (ResponseMessageInPingPong | RequestMessageInPingPong)[];
}
export declare function documentServerMessageResponse({ shell, title, messageType, messages }: MessagePingPongDocumentationArguments): Promise<string>;
export {};