Skip to content

Commit

Permalink
fix: make types compatible with exactOptionalPropertyTypes TypeScri…
Browse files Browse the repository at this point in the history
…pt config
  • Loading branch information
andipaetzold committed Mar 2, 2024
1 parent 746b9c4 commit 76484a2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .changeset/soft-lizards-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@andipaetzold/realtime-websocket-client": patch
"@andipaetzold/realtime-rest-client": patch
"@andipaetzold/realtime-server": patch
---

Make types compatible with `exactOptionalPropertyTypes` TypeScript config
2 changes: 1 addition & 1 deletion packages/realtime-rest-client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface RealtimeRESTClientOptions {
/**
* Required for write operations
*/
token?: string;
token?: string | undefined;
}

export type Patch = Operation[];
36 changes: 20 additions & 16 deletions packages/realtime-server/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@ import type { Auth } from "./auth/index.js";

export interface Options {
server: HttpServer | HttpsServer | Http2SecureServer;
path?: string;
initialData?: any;
logger?: Logger;
auth?: Auth;
cors?: {
origin: string | string[];
};
adminUI?: {
enabled: boolean;
auth:
| false
| {
username: string;
password: string;
};
};
path?: string | undefined;
initialData?: any | undefined;
logger?: Logger | undefined;
auth?: Auth | undefined;
cors?:
| {
origin: string | string[];
}
| undefined;
adminUI?:
| {
enabled: boolean;
auth:
| false
| {
username: string;
password: string;
};
}
| undefined;
}

export interface Store {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface SubscriptionState<T> {

export interface RealtimeWebSocketClientOptions {
url: string;
onError?: (error: Error) => void;
onError?: ((error: Error) => void) | undefined;
}

export class RealtimeWebSocketClient {
Expand Down

0 comments on commit 76484a2

Please sign in to comment.