diff --git a/.gitignore b/.gitignore index 765a30aa..aa370285 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ node_modules /.sass-cache /connect.lock /coverage +**/coverage /libpeerconnection.log npm-debug.log yarn-error.log diff --git a/languages/ts/ts-codegen/references/wsExample.ts b/languages/ts/ts-codegen/references/wsExample.ts deleted file mode 100644 index 04dd1515..00000000 --- a/languages/ts/ts-codegen/references/wsExample.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -/* eslint-disable @typescript-eslint/unbound-method */ -import { arriWsRequest, type WsOptions } from "@arrirpc/client"; - -export class UserService { - private readonly baseUrl: string; - private readonly headers: Record; - - constructor(opts: { baseUrl?: string; headers?: Record }) { - this.baseUrl = opts.baseUrl ?? ""; - this.headers = opts.headers ?? {}; - } - - createConnection(opts: WsOptions) { - return arriWsRequest({ - url: `${this.baseUrl}/users/create-connection`, - headers: this.headers, - parser: $$ClientMessage.parse, - serializer: $$ClientMessage.serialize, - onOpen: opts.onOpen, - onClose: opts.onClose, - onError: opts.onError, - onConnectionError: opts.onConnectionError, - onMessage: opts.onMessage, - clientVersion: "1", - }); - } -} - -export interface ServerMessage { - id: string; - content: string; -} -export const $$ServerMessage = { - parse(input: unknown): ServerMessage { - return { - id: "", - content: "", - }; - }, - serialize(input: ServerMessage): string { - return ""; - }, -}; - -export interface ClientMessage { - id: string; - content: string; -} - -export const $$ClientMessage = { - parse(input: unknown): ClientMessage { - return { - id: "", - content: "", - }; - }, - serialize(input: ClientMessage): string { - return ""; - }, -};