Datalayer Desktop - v0.0.2
    Preparing search index...

    Interface ProxyAPI

    Proxy API interface for HTTP and WebSocket communication.

    interface ProxyAPI {
        httpRequest: (
            options: {
                body?: unknown;
                headers?: Record<string, string>;
                method?: string;
                url: string;
            },
        ) => Promise<
            {
                body: unknown;
                headers: Record<string, string>;
                status: number;
                statusText: string;
            },
        >;
        onWebSocketEvent: (
            callback: (
                event: {
                    code?: number;
                    data?: unknown;
                    error?: string;
                    id: string;
                    reason?: string;
                    type: "error" | "close" | "open" | "message";
                },
            ) => void,
        ) => void;
        removeWebSocketEventListener: () => void;
        websocketClose: (
            options: { code?: number; id: string; reason?: string },
        ) => Promise<{ success: boolean }>;
        websocketCloseRuntime: (
            options: { runtimeId: string },
        ) => Promise<{ success: boolean }>;
        websocketOpen: (
            options: {
                headers?: Record<string, string>;
                protocol?: string;
                runtimeId?: string;
                url: string;
            },
        ) => Promise<{ id: string }>;
        websocketSend: (
            options: { data: unknown; id: string },
        ) => Promise<{ success: boolean }>;
    }
    Index

    Properties

    httpRequest: (
        options: {
            body?: unknown;
            headers?: Record<string, string>;
            method?: string;
            url: string;
        },
    ) => Promise<
        {
            body: unknown;
            headers: Record<string, string>;
            status: number;
            statusText: string;
        },
    >
    onWebSocketEvent: (
        callback: (
            event: {
                code?: number;
                data?: unknown;
                error?: string;
                id: string;
                reason?: string;
                type: "error" | "close" | "open" | "message";
            },
        ) => void,
    ) => void
    removeWebSocketEventListener: () => void
    websocketClose: (
        options: { code?: number; id: string; reason?: string },
    ) => Promise<{ success: boolean }>
    websocketCloseRuntime: (
        options: { runtimeId: string },
    ) => Promise<{ success: boolean }>
    websocketOpen: (
        options: {
            headers?: Record<string, string>;
            protocol?: string;
            runtimeId?: string;
            url: string;
        },
    ) => Promise<{ id: string }>
    websocketSend: (
        options: { data: unknown; id: string },
    ) => Promise<{ success: boolean }>