Specta LogoSpecta
RspcTypescript apiTs rspc tauri

@rspc/tauri

TypeScript API reference for @rspc/tauri, version 0.0.0-main-9c15d2d4.

Public exports of @rspc/tauri at version 0.0.0-main-9c15d2d4.

This page documents 0.0.0-main-9c15d2d4. The documented version is 0.3.1.

Classes

TauriTransport

declare class TauriTransport implements Transport {
    private requestMap;
    private listener?;
    clientSubscriptionCallback?: (id: string, value: any) => void;
    constructor();
    doRequest(operation: OperationType, key: string, input: any): Promise<any>;
}

// Referenced local context (not public exports):
interface Transport {
    clientSubscriptionCallback?: (id: string, key: string, value: any) => void;
    doRequest(operation: OperationType, key: string, input: any): Promise<any>;
}

type OperationType = "query" | "mutation" | "subscription" | "subscriptionStop";

View source ↗

Functions

/**
 * Link for the rspc Tauri plugin
 */
declare function tauriLink(): Link;

// Referenced local context (not public exports):
/**
 * TODO
 *
 * @internal
 */
type Link = (p: LinkOperation) => LinkResult;

/**
 * The argument to a link. Contains information about the current operation and a function to call the next link.
 *
 * @internal
 */
interface LinkOperation {
    op: Operation;
    next(op: {
        op: Operation;
    }): LinkResult;
}

/**
 * TODO
 *
 * @internal
 */
type LinkResult = {
    exec: (resolve: (result: any) => void, reject: (error: Error | AlphaRSPCError) => void) => void;
    abort: () => void;
};

/**
 * TODO
 *
 * @internal
 */
interface Operation {
    id: string;
    type: "query" | "mutation" | "subscription" | "subscriptionStop";
    input: unknown;
    path: string;
    context: OperationContext;
}

declare class AlphaRSPCError extends Error {
    code: number;
    message: string;
    constructor(code: number, message: string);
}

/**
// … truncated, see the source link

Link for the rspc Tauri plugin

View source ↗

On this page