forked from imbytecat/fullstack-starter
refactor: 优化合约类型导出与导入方式
- 导出合约类型以支持类型安全的接口定义 - 更新类型导入以使用 Contract 而非直接导出的 contract 变量
This commit is contained in:
@@ -3,3 +3,5 @@ import * as todo from './todo'
|
||||
export const contract = {
|
||||
todo,
|
||||
}
|
||||
|
||||
export type Contract = typeof contract
|
||||
|
||||
@@ -3,9 +3,8 @@ import type {
|
||||
InferContractRouterInputs,
|
||||
InferContractRouterOutputs,
|
||||
} from '@orpc/contract'
|
||||
import type { contract } from './contract'
|
||||
import type { Contract } from './contract'
|
||||
|
||||
export type Contract = typeof contract
|
||||
export type RouterClient = ContractRouterClient<Contract>
|
||||
export type RouterInputs = InferContractRouterInputs<Contract>
|
||||
export type RouterOutputs = InferContractRouterOutputs<Contract>
|
||||
|
||||
Reference in New Issue
Block a user