@@ -4,16 +4,14 @@ import type { Snippet } from "svelte";
44/**
55 * Context value containing the Replane client
66 */
7- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8- export interface ReplaneContextValue < T extends Record < string , unknown > = any > {
7+ export interface ReplaneContextValue < T extends object = Record < string , unknown > > {
98 client : ReplaneClient < T > ;
109}
1110
1211/**
1312 * Props for ReplaneContext when using a pre-created client.
1413 */
15- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16- export interface ReplaneContextWithClientProps < T extends Record < string , unknown > = any > {
14+ export interface ReplaneContextWithClientProps < T extends object = Record < string , unknown > > {
1715 /** Pre-created ReplaneClient instance */
1816 client : ReplaneClient < T > ;
1917 /** Children snippet */
@@ -23,8 +21,7 @@ export interface ReplaneContextWithClientProps<T extends Record<string, unknown>
2321/**
2422 * Props for ReplaneContext when letting it manage the client internally.
2523 */
26- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27- export interface ReplaneContextWithOptionsProps < T extends Record < string , unknown > = any > {
24+ export interface ReplaneContextWithOptionsProps < T extends object = Record < string , unknown > > {
2825 /** Options to create or restore the ReplaneClient */
2926 options : ReplaneClientOptions < T > ;
3027 /** Children snippet */
@@ -44,15 +41,14 @@ export interface ReplaneContextWithOptionsProps<T extends Record<string, unknown
4441 loader ?: Snippet ;
4542}
4643
47- // eslint-disable-next-line @typescript-eslint/no-explicit-any
48- export type ReplaneContextProps < T extends Record < string , unknown > = any > =
44+ export type ReplaneContextProps < T extends object = Record < string , unknown > > =
4945 | ReplaneContextWithClientProps < T >
5046 | ReplaneContextWithOptionsProps < T > ;
5147
5248/**
5349 * Type guard to check if props contain a pre-created client.
5450 */
55- export function hasClient < T extends Record < string , unknown > > (
51+ export function hasClient < T extends object > (
5652 props : ReplaneContextProps < T >
5753) : props is ReplaneContextWithClientProps < T > {
5854 return "client" in props && props . client !== undefined ;
@@ -61,7 +57,7 @@ export function hasClient<T extends Record<string, unknown>>(
6157/**
6258 * Type guard to check if props contain options (with or without snapshot).
6359 */
64- export function hasOptions < T extends Record < string , unknown > > (
60+ export function hasOptions < T extends object > (
6561 props : ReplaneContextProps < T >
6662) : props is ReplaneContextWithOptionsProps < T > {
6763 return "options" in props && props . options !== undefined ;
0 commit comments