Skip to content

Commit 930fb14

Browse files
named types
1 parent b3b9da9 commit 930fb14

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

packages/start-client-core/src/createIsomorphicFn.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,25 @@ export interface ClientOnlyFn<TArgs extends Array<any>, TClient>
2222
}
2323

2424
type AnyFn = (...args: Array<any>) => any
25-
export interface ServerOnlyFnWithType<TArgs extends Array<any>, TReturnType>
26-
extends IsomorphicFn<TArgs, TReturnType> {
25+
export interface ClientImplRequired<TArgs extends Array<any>, TReturnType> {
2726
client: (
2827
clientImpl: (...args: TArgs) => TReturnType,
2928
) => IsomorphicFn<TArgs, TReturnType, TReturnType>
3029
}
3130

32-
export interface ClientOnlyFnWithType<TArgs extends Array<any>, TReturnType>
33-
extends IsomorphicFn<TArgs, TReturnType, TReturnType> {
31+
export interface ServerImplRequired<TArgs extends Array<any>, TReturnType> {
3432
server: (
3533
serverImpl: (...args: TArgs) => TReturnType,
3634
) => IsomorphicFn<TArgs, TReturnType, TReturnType>
3735
}
3836

3937
export interface IsomorphicFnWithType<TArgs extends Array<any>, TReturnType> {
40-
server: (serverImpl: (...args: TArgs) => TReturnType) => {
41-
client: (
42-
clientImpl: (...args: TArgs) => TReturnType,
43-
) => IsomorphicFn<TArgs, TReturnType, TReturnType>
44-
}
45-
client: (clientImpl: (...args: TArgs) => TReturnType) => {
46-
server: (
47-
serverImpl: (...args: TArgs) => TReturnType,
48-
) => IsomorphicFn<TArgs, TReturnType, TReturnType>
49-
}
38+
server: (
39+
serverImpl: (...args: TArgs) => TReturnType,
40+
) => ClientImplRequired<TArgs, TReturnType>
41+
client: (
42+
clientImpl: (...args: TArgs) => TReturnType,
43+
) => ServerImplRequired<TArgs, TReturnType>
5044
}
5145

5246
export interface IsomorphicFnBase extends IsomorphicFn {

0 commit comments

Comments
 (0)