@kaguyajs/trss-yunzai-types
Preparing search index...
guoba
Result
Class Result<T>
返回结果
Type Parameters
T
=
any
Index
Constructors
constructor
Properties
code
http
Status
message
result
ERR_
CODE_
501
VOID
Accessors
is
Ok
Methods
to
JSON
error
no
Auth
no
Login
not
Found
ok
unrealized
Constructors
constructor
new
Result
<
T
=
any
>
(
code
:
number
,
result
:
T
,
message
:
string
,
httpStatus
?:
number
,
)
:
Result
<
T
>
Type Parameters
T
=
any
Parameters
code
:
number
result
:
T
message
:
string
Optional
httpStatus
:
number
Returns
Result
<
T
>
Properties
code
code
:
number
http
Status
httpStatus
:
number
message
message
:
string
result
result
:
T
Static
ERR_
CODE_
501
ERR_CODE_501
:
symbol
尚未实现错误码
Static
VOID
VOID
:
symbol
无返回值
Accessors
is
Ok
get
isOk
()
:
boolean
是否成功
Returns
boolean
Methods
to
JSON
toJSON
()
:
{
code
:
number
;
message
:
string
;
ok
:
boolean
;
result
:
T
}
转换为 JSON 对象
Returns
{
code
:
number
;
message
:
string
;
ok
:
boolean
;
result
:
T
}
Static
error
error
<
T
=
any
>
(
...
args
:
[
string
|
number
,
T
?
,
string
?
,
number
?
]
)
:
Result
<
T
>
错误
Type Parameters
T
=
any
Parameters
...
args
:
[
string
|
number
,
T
?
,
string
?
,
number
?
]
Returns
Result
<
T
>
Static
Static
no
Auth
noAuth
()
:
Result
<
null
>
尚未授权
Returns
Result
<
null
>
Static
Static
no
Login
noLogin
()
:
Result
<
null
>
尚未登录
Returns
Result
<
null
>
Static
Static
not
Found
notFound
()
:
Result
<
null
>
404未找到
Returns
Result
<
null
>
Static
Static
ok
ok
<
T
=
any
>
(
result
:
T
,
message
?:
string
)
:
Result
<
T
>
成功
Type Parameters
T
=
any
Parameters
result
:
T
返回结果
Optional
message
:
string
返回消息
Returns
Result
<
T
>
Static
Static
unrealized
unrealized
()
:
Result
<
null
>
功能尚未实现
Returns
Result
<
null
>
Static
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
code
http
Status
message
result
ERR_
CODE_
501
VOID
Accessors
is
Ok
Methods
to
JSON
error
no
Auth
no
Login
not
Found
ok
unrealized
@kaguyajs/trss-yunzai-types
Loading...
返回结果