提交 5148ec76 编写于 作者: fxy060608's avatar fxy060608

fix: types

上级 8db734ec
......@@ -9,10 +9,7 @@ type ProtocolMethod<T, TConstructor = any> = T extends (...args: any) => any
: never
type ProtocolType<T> = ProtocolConstructor<T> | ProtocolConstructor<T>[]
type ApiArgsValidator<T, P> = (
value: T,
params: P
) => boolean | undefined | string
type ApiArgsValidator<T, P> = (value: T, params: P) => boolean | string | void
type ApiProtocol<T extends ApiLike, P = AsyncApiOptions<T>> = {
[K in keyof P]: ProtocolType<P[K]> | ProtocolOptions<P[K]>
......@@ -33,7 +30,7 @@ interface ProtocolOptions<T = any> {
name?: string
type?: ProtocolType<T>
required?: boolean
validator?(value: T): boolean | undefined | string
validator?(value: T): boolean | void | string
}
interface AsyncMethodOptionLike {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册