From 1ec4701e2aed6005a2d14b7442f5b47ecacae4bb Mon Sep 17 00:00:00 2001 From: penpenpng Date: Mon, 10 Jul 2023 22:30:44 +0900 Subject: [PATCH] Add message types --- index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.d.ts b/index.d.ts index 4e6b558..5f54e7a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -90,6 +90,7 @@ interface CountResponse { export namespace ToRelayMessage { export type Any = AUTH | CLOSE | COUNT | EVENT | REQ; + export type Type = Any[0]; export type AUTH = [type: "AUTH", event: Event]; export type CLOSE = [type: "CLOSE", subId: string]; export type COUNT = [type: "COUNT", subId: string, ...filters: Filter[]]; @@ -99,6 +100,7 @@ export namespace ToRelayMessage { export namespace ToClientMessage { export type Any = AUTH | COUNT | EOSE | EVENT | NOTICE | OK; + export type Type = Any[0]; export type Sub = EVENT | EOSE; export type AUTH = [type: "AUTH", challengeMessage: string]; export type COUNT = [type: "COUNT", subId: string, count: CountResponse];