Skip to content

Commit

Permalink
chore: apply lint and formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] committed Mar 1, 2024
1 parent 4b7dd5a commit e692be4
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 47 deletions.
16 changes: 11 additions & 5 deletions examples/next-prisma-websockets-starter/src/server/routers/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ interface MyEvents {
isTypingUpdate: () => void;
}
declare interface MyEventEmitter {
on<TEv extends keyof MyEvents>(event: TEv, listener: MyEvents[TEv]): this;
off<TEv extends keyof MyEvents>(event: TEv, listener: MyEvents[TEv]): this;
once<TEv extends keyof MyEvents>(event: TEv, listener: MyEvents[TEv]): this;
emit<TEv extends keyof MyEvents>(
on: <TEv extends keyof MyEvents>(event: TEv, listener: MyEvents[TEv]) => this;
off: <TEv extends keyof MyEvents>(
event: TEv,
listener: MyEvents[TEv],
) => this;
once: <TEv extends keyof MyEvents>(
event: TEv,
listener: MyEvents[TEv],
) => this;
emit: <TEv extends keyof MyEvents>(
event: TEv,
...args: Parameters<MyEvents[TEv]>
): boolean;
) => boolean;
}

class MyEventEmitter extends EventEmitter {}
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/links/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type Operation<TInput = unknown> = {
};

interface HeadersInitEsque {
[Symbol.iterator](): IterableIterator<[string, string]>;
[Symbol.iterator]: () => IterableIterator<[string, string]>;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/createTRPCNext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export interface CreateTRPCNextBase<
*
* @link https://trpc.io/docs/v11/client/react/useUtils
*/
useContext(): CreateReactUtils<TRouter, TSSRContext>;
useContext: () => CreateReactUtils<TRouter, TSSRContext>;
/**
* @link https://trpc.io/docs/v11/client/react/useUtils
*/
useUtils(): CreateReactUtils<TRouter, TSSRContext>;
useUtils: () => CreateReactUtils<TRouter, TSSRContext>;
withTRPC: ReturnType<typeof withTRPC<TRouter, TSSRContext>>;
useQueries: TRPCUseQueries<TRouter>;
useSuspenseQueries: TRPCUseSuspenseQueries<TRouter>;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-query/src/createTRPCReact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ export type CreateTRPCReactBase<TRouter extends AnyRouter, TSSRContext> = {
*
* @link https://trpc.io/docs/v11/client/react/useUtils
*/
useContext(): CreateReactUtils<TRouter, TSSRContext>;
useContext: () => CreateReactUtils<TRouter, TSSRContext>;
/**
* @link https://trpc.io/docs/v11/client/react/useUtils
*/
useUtils(): CreateReactUtils<TRouter, TSSRContext>;
useUtils: () => CreateReactUtils<TRouter, TSSRContext>;
Provider: TRPCProvider<TRouter, TSSRContext>;
createClient: CreateClient<TRouter>;
useQueries: TRPCUseQueries<TRouter>;
Expand Down
16 changes: 8 additions & 8 deletions packages/react-query/src/server/ssgProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,25 @@ type DecorateProcedure<
/**
* @link https://tanstack.com/query/v5/docs/framework/react/guides/prefetching
*/
fetch(
fetch: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;
) => Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;

/**
* @link https://tanstack.com/query/v5/docs/framework/react/guides/prefetching
*/
fetchInfinite(
fetchInfinite: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchInfiniteQueryOptions<
inferProcedureInput<TProcedure>,
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<
) => Promise<
InfiniteData<
inferTransformedProcedureOutput<TRoot, TProcedure>,
NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null
Expand All @@ -87,25 +87,25 @@ type DecorateProcedure<
/**
* @link https://tanstack.com/query/v5/docs/framework/react/guides/prefetching
*/
prefetch(
prefetch: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<void>;
) => Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/framework/react/guides/prefetching
*/
prefetchInfinite(
prefetchInfinite: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchInfiniteQueryOptions<
inferProcedureInput<TProcedure>,
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<void>;
) => Promise<void>;
};

/**
Expand Down
56 changes: 28 additions & 28 deletions packages/react-query/src/shared/proxy/utilsProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ type DecorateProcedure<
/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchquery
*/
fetch(
fetch: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;
) => Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchinfinitequery
*/
fetchInfinite(
fetchInfinite: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchInfiniteQueryOptions<
inferProcedureInput<TProcedure>,
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<
) => Promise<
InfiniteData<
inferTransformedProcedureOutput<TRoot, TProcedure>,
NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null
Expand All @@ -73,41 +73,41 @@ type DecorateProcedure<
/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchquery
*/
prefetch(
prefetch: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<void>;
) => Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchinfinitequery
*/
prefetchInfinite(
prefetchInfinite: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchInfiniteQueryOptions<
inferProcedureInput<TProcedure>,
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<void>;
) => Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientensurequerydata
*/
ensureData(
ensureData: (
input: inferProcedureInput<TProcedure>,
opts?: TRPCFetchQueryOptions<
inferTransformedProcedureOutput<TRoot, TProcedure>,
TRPCClientError<TRoot>
>,
): Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;
) => Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientinvalidatequeries
*/
invalidate(
invalidate: (
input?: DeepPartial<inferProcedureInput<TProcedure>>,
filters?: Omit<InvalidateQueryFilters, 'predicate'> & {
predicate?: (
Expand All @@ -125,37 +125,37 @@ type DecorateProcedure<
) => boolean;
},
options?: InvalidateOptions,
): Promise<void>;
) => Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientrefetchqueries
*/
refetch(
refetch: (
input?: inferProcedureInput<TProcedure>,
filters?: RefetchQueryFilters,
options?: RefetchOptions,
): Promise<void>;
) => Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientcancelqueries
*/
cancel(
cancel: (
input?: inferProcedureInput<TProcedure>,
options?: CancelOptions,
): Promise<void>;
) => Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientresetqueries
*/
reset(
reset: (
input?: inferProcedureInput<TProcedure>,
options?: ResetOptions,
): Promise<void>;
) => Promise<void>;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata
*/
setData(
setData: (
/**
* The input of the procedure
*/
Expand All @@ -165,12 +165,12 @@ type DecorateProcedure<
inferTransformedProcedureOutput<TRoot, TProcedure> | undefined
>,
options?: SetDataOptions,
): void;
) => void;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata
*/
setInfiniteData(
setInfiniteData: (
input: inferProcedureInput<TProcedure>,
updater: Updater<
| InfiniteData<
Expand All @@ -185,21 +185,21 @@ type DecorateProcedure<
| undefined
>,
options?: SetDataOptions,
): void;
) => void;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata
*/
getData(
getData: (
input?: inferProcedureInput<TProcedure>,
): inferTransformedProcedureOutput<TRoot, TProcedure> | undefined;
) => inferTransformedProcedureOutput<TRoot, TProcedure> | undefined;

/**
* @link https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata
*/
getInfiniteData(
getInfiniteData: (
input?: inferProcedureInput<TProcedure>,
):
) =>
| InfiniteData<
inferTransformedProcedureOutput<TRoot, TProcedure>,
NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null
Expand All @@ -217,11 +217,11 @@ type DecorateRouter = {
* @link https://trpc.io/docs/v10/useContext#query-invalidation
* @link https://tanstack.com/query/v5/docs/framework/react/guides/query-invalidation
*/
invalidate(
invalidate: (
input?: undefined,
filters?: InvalidateQueryFilters,
options?: InvalidateOptions,
): Promise<void>;
) => Promise<void>;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/server/react/__testHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function subscriptionPullFactory<TOutput>(opts: {
* The interval of how often the function should run
*/
intervalMs: number;
pull(emit: Observer<TOutput, unknown>): Promise<void> | void;
pull: (emit: Observer<TOutput, unknown>) => Promise<void> | void;
}): Observable<TOutput, unknown> {
let timer: any;
let stopped = false;
Expand Down

0 comments on commit e692be4

Please sign in to comment.