Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-protocols-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"partysocket": patch
---

Fix `protocols` type in `PartySocketOptions` to accept `ProtocolsProvider` instead of `string[]`, matching the full range of types already supported by the underlying `ReconnectingWebSocket`.
45 changes: 10 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/partysocket/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ReconnectingWebSocket from "./ws";

import type * as RWS from "./ws";
import type { ProtocolsProvider } from "./ws";

type Maybe<T> = T | null | undefined;
type Params = Record<string, Maybe<string>>;
Expand All @@ -17,7 +18,7 @@ export type PartySocketOptions = Omit<RWS.Options, "constructor"> & {
basePath?: string; // the base path to use for the party
prefix?: string; // the prefix to use for the party
protocol?: "ws" | "wss";
protocols?: string[];
protocols?: ProtocolsProvider;
path?: string; // the path to connect to
query?: Params | (() => Params | Promise<Params>);
disableNameValidation?: boolean; // disable validation of party/room names
Expand Down
Loading