Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
steve02081504 committed Mar 1, 2024
1 parent 774f126 commit ddc3c15
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 54 deletions.
20 changes: 9 additions & 11 deletions src/.decls/cn/base/tools.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ interface ExtensibleFunction<args_T extends Array<any>, return_T> {
type security_level_t = "local" | "external";
/**
* SSTP 返回码
* 和 HTTP 一样,200 系列是正常接受,其他的是错误。
* 200 系列是正常接受,其他的是错误。
* 和 HTTP 一样,200 系列是正常接受,其他的是错误。
* @enum {number}
*/
declare enum documented_sstp_return_code_t {
Expand Down Expand Up @@ -105,11 +104,10 @@ declare enum documented_sstp_return_code_t {
}
/**
* SSTP 返回码
* 和 HTTP 一样,200 系列是正常接受,其他的是错误。
* 200 系列是正常接受,其他的是错误。
* 和 HTTP 一样,200 系列是正常接受,其他的是错误。
* @enum {number}
*/
type sstp_return_code_t = documented_sstp_return_code_t | number;
type sstp_return_code_t = number & documented_sstp_return_code_t;
/**
* 基本的SSTP包
* @see {@link https://ssp.shillest.net/ukadoc/manual/spec_sstp.html#req_res}
Expand Down Expand Up @@ -271,7 +269,7 @@ declare enum documented_sstp_command_name_t {
GetPluginNameList = "GetPluginNameList",
/**
* 返回基础软件(运行人格的软件)的版本,以点分隔的版本号的格式
* 这可以和version.json的ssp.full.version等简单比较,就可以检查是否是最新版
* 这可以和[version.json](https://ssp.shillest.net/archive/version.json)的`ssp.full.version`等简单比较,就可以检查是否是最新版
*/
GetShortVersion = "GetShortVersion",
/**
Expand Down Expand Up @@ -299,24 +297,24 @@ declare enum documented_sstp_command_name_t {
*/
ExtractArchive = "ExtractArchive",
/**
* 将合成好的表面图片输出到指定的目录。参数和\![execute,dumpsurface]相同
* 将合成好的表面图片输出到指定的目录。参数和`\![execute,dumpsurface]`相同
* 响应会在处理结束后才返回,注意
* 没有附加数据(状态码200系列表示成功)
*/
DumpSurface = "DumpSurface",
/**
* 不通过Sakura Script执行和\![moveasync]相同的事情。参数指定方法和Sakura Script版相同
* 不通过Sakura Script执行和`\![moveasync]`相同的事情。参数指定方法和Sakura Script版相同
* 因为不能在SSTP的超时时间内返回响应,而且会导致死锁,所以不能执行没有async的move
* 没有附加数据(状态码200系列表示成功)
*/
MoveAsync = "MoveAsync",
/**
* 不通过Sakura Script执行和\![set,tasktrayicon]相同的事情。参数指定方法和Sakura Script版相同
* 不通过Sakura Script执行和`\![set,tasktrayicon]`相同的事情。参数指定方法和Sakura Script版相同
* 没有附加数据(状态码200系列表示成功)
*/
SetTrayIcon = "SetTrayIcon",
/**
* 不通过Sakura Script执行和\![set,trayballoon]相同的事情。参数指定方法和Sakura Script版相同
* 不通过Sakura Script执行和`\![set,trayballoon]`相同的事情。参数指定方法和Sakura Script版相同
* 没有附加数据(状态码200系列表示成功)
*/
SetTrayBalloon = "SetTrayBalloon",
Expand Down Expand Up @@ -352,7 +350,7 @@ declare enum documented_sstp_command_name_t {
* SSTP命令名称
* @enum {string}
*/
type sstp_command_name_t = documented_sstp_command_name_t | string;
type sstp_command_name_t = string & documented_sstp_command_name_t;
/**
* 常见的SSTP执行包内容
* @see {@link https://ssp.shillest.net/ukadoc/manual/spec_sstp.html#method_execute}
Expand Down
49 changes: 42 additions & 7 deletions src/.decls/cn/types/jsstp_t.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ interface base_keyed_method_caller<T = sstp_info_t, Rest extends any[] = [Object
* 对调用参数进行简易处理的可扩展调用器
* @group callers
*/
interface simple_keyed_method_caller<result_T> extends base_keyed_method_caller<result_T, any[]> { }
interface simple_keyed_method_caller<result_T> extends base_keyed_method_caller<result_T, any[]> {
/**
* 扩展调用器
*/
[uuid: `some ${string}`]: simple_keyed_method_caller<result_T>
}
/**
* 通用事件调用器
* 调用时传入一个对象以触发事件!
Expand All @@ -50,7 +55,12 @@ interface simple_keyed_method_caller<result_T> extends base_keyed_method_caller<
* });
* @group callers
*/
interface event_caller extends base_keyed_method_caller<sstp_info_t> { }
interface event_caller extends base_keyed_method_caller<sstp_info_t> {
/**
* 扩展调用器
*/
[uuid: `some ${string}`]: event_caller
}
/**
* 简易事件调用器
* 直接调用以触发事件!
Expand All @@ -64,7 +74,12 @@ interface event_caller extends base_keyed_method_caller<sstp_info_t> { }
* });
* @group callers
*/
interface simple_event_caller extends simple_keyed_method_caller<sstp_info_t> { }
interface simple_event_caller extends simple_keyed_method_caller<sstp_info_t> {
/**
* 扩展调用器
*/
[uuid: `some ${string}`]: simple_event_caller
}
/**
* 命令调用器
* @example
Expand All @@ -82,7 +97,12 @@ interface simple_event_caller extends simple_keyed_method_caller<sstp_info_t> {
* });
* @group callers
*/
interface command_caller extends base_keyed_method_caller<sstp_info_t> { }
interface command_caller extends base_keyed_method_caller<sstp_info_t> {
/**
* 扩展调用器
*/
[uuid: `some ${string}`]: command_caller
}
/**
* 简易命令调用器
* @example
Expand All @@ -95,7 +115,12 @@ interface command_caller extends base_keyed_method_caller<sstp_info_t> { }
* });
* @group callers
*/
interface simple_command_caller extends simple_keyed_method_caller<sstp_info_t> { }
interface simple_command_caller extends simple_keyed_method_caller<sstp_info_t> {
/**
* 扩展调用器
*/
[uuid: `some ${string}`]: simple_command_caller
}
/**
* 列表返值命令执行器
* @example
Expand All @@ -108,7 +133,12 @@ interface simple_command_caller extends simple_keyed_method_caller<sstp_info_t>
* });
* @group callers
*/
interface list_command_caller extends base_keyed_method_caller<list_info_t> { }
interface list_command_caller extends base_keyed_method_caller<list_info_t> {
/**
* 扩展调用器
*/
[uuid: `some ${string}`]: list_command_caller
}
/**
* 对参数进行简易处理的列表返值命令执行器
* @example
Expand All @@ -119,7 +149,12 @@ interface list_command_caller extends base_keyed_method_caller<list_info_t> { }
* });
* @group callers
*/
interface simple_list_command_caller extends simple_keyed_method_caller<list_info_t> { }
interface simple_list_command_caller extends simple_keyed_method_caller<list_info_t> {
/**
* 扩展调用器
*/
[uuid: `some ${string}`]: simple_list_command_caller
}

/**
* 比{@link jsstp_t}多了一个ghost_info属性
Expand Down
20 changes: 9 additions & 11 deletions src/.decls/en/base/tools.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ interface ExtensibleFunction<args_T extends Array<any>, return_T> {
type security_level_t = "local" | "external";
/**
* SSTP return codes
* Same as HTTP, 200s are OK, others are errors.
* 200s are OK, others are errors.
* Same as HTTP, 200s are OK, others are errors.
* @enum {number}
*/
declare enum documented_sstp_return_code_t {
Expand Down Expand Up @@ -105,11 +104,10 @@ declare enum documented_sstp_return_code_t {
}
/**
* SSTP return codes
* Same as HTTP, 200s are OK, others are errors.
* 200s are OK, others are errors.
* Same as HTTP, 200s are OK, others are errors.
* @enum {number}
*/
type sstp_return_code_t = documented_sstp_return_code_t | number;
type sstp_return_code_t = number & documented_sstp_return_code_t;
/**
* Basic SSTP packet
* @see {@link https://ssp.shillest.net/ukadoc/manual/spec_sstp.html#req_res}
Expand Down Expand Up @@ -271,7 +269,7 @@ declare enum documented_sstp_command_name_t {
GetPluginNameList = "GetPluginNameList",
/**
* Returns the version of the base ware (the software that runs the ghost) in the format of only the version number separated by periods.
* This can be used to check if the base ware is the latest version by simply comparing it with ssp.full.version in version.json or similar.
* This can be used to check if the base ware is the latest version by simply comparing it with `ssp.full.version` in [version.json](https://ssp.shillest.net/archive/version.json) or similar.
*/
GetShortVersion = "GetShortVersion",
/**
Expand Down Expand Up @@ -299,24 +297,24 @@ declare enum documented_sstp_command_name_t {
*/
ExtractArchive = "ExtractArchive",
/**
* Outputs the synthesized surface image to the specified directory. The parameters are the same as \![execute,dumpsurface].
* Outputs the synthesized surface image to the specified directory. The parameters are the same as `\![execute,dumpsurface]`.
* The response is not returned until the process is finished, so be careful.
* No additional data (success with status code 200 series).
*/
DumpSurface = "DumpSurface",
/**
* Executes the same thing as \![moveasync] without using Sakura Script. The parameter specification method is the same as the Sakura Script version.
* Executes the same thing as `\![moveasync]` without using Sakura Script. The parameter specification method is the same as the Sakura Script version.
* Move without async cannot be executed because it cannot return a response before the SSTP timeout and causes a deadlock.
* No additional data (success with status code 200 series).
*/
MoveAsync = "MoveAsync",
/**
* Executes the same thing as \![set,tasktrayicon] without using Sakura Script. The parameter specification method is the same as the Sakura Script version.
* Executes the same thing as `\![set,tasktrayicon]` without using Sakura Script. The parameter specification method is the same as the Sakura Script version.
* No additional data (success with status code 200 series).
*/
SetTrayIcon = "SetTrayIcon",
/**
* Executes the same thing as \![set,trayballoon] without using Sakura Script. The parameter specification method is the same as the Sakura Script version.
* Executes the same thing as `\![set,trayballoon]` without using Sakura Script. The parameter specification method is the same as the Sakura Script version.
* No additional data (success with status code 200 series).
*/
SetTrayBalloon = "SetTrayBalloon",
Expand Down Expand Up @@ -352,7 +350,7 @@ declare enum documented_sstp_command_name_t {
* SSTP command name
* @enum {string}
*/
type sstp_command_name_t = documented_sstp_command_name_t | string;
type sstp_command_name_t = string & documented_sstp_command_name_t;
/**
* Common SSTP execute packet content
* @see {@link https://ssp.shillest.net/ukadoc/manual/spec_sstp.html#method_execute}
Expand Down
49 changes: 42 additions & 7 deletions src/.decls/en/types/jsstp_t.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ interface base_keyed_method_caller<T = sstp_info_t, Rest extends any[] = [Object
* An extensible caller that performs simple processing on call parameters
* @group callers
*/
interface simple_keyed_method_caller<result_T> extends base_keyed_method_caller<result_T, any[]> { }
interface simple_keyed_method_caller<result_T> extends base_keyed_method_caller<result_T, any[]> {
/**
* Extensible caller
*/
[uuid: `some ${string}`]: simple_keyed_method_caller<result_T>
}
/**
* Generic Event Caller
* Called by passing in an object to trigger an event!
Expand All @@ -50,7 +55,12 @@ interface simple_keyed_method_caller<result_T> extends base_keyed_method_caller<
* });
* @group callers
*/
interface event_caller extends base_keyed_method_caller<sstp_info_t> { }
interface event_caller extends base_keyed_method_caller<sstp_info_t> {
/**
* Extensible caller
*/
[uuid: `some ${string}`]: event_caller
}
/**
* Simple Event Caller
* Directly call to trigger an event!
Expand All @@ -64,7 +74,12 @@ interface event_caller extends base_keyed_method_caller<sstp_info_t> { }
* });
* @group callers
*/
interface simple_event_caller extends simple_keyed_method_caller<sstp_info_t> { }
interface simple_event_caller extends simple_keyed_method_caller<sstp_info_t> {
/**
* Extensible caller
*/
[uuid: `some ${string}`]: simple_event_caller
}

/**
* Command Caller
Expand All @@ -83,7 +98,12 @@ interface simple_event_caller extends simple_keyed_method_caller<sstp_info_t> {
* });
* @group callers
*/
interface command_caller extends base_keyed_method_caller<sstp_info_t> { }
interface command_caller extends base_keyed_method_caller<sstp_info_t> {
/**
* Extensible caller
*/
[uuid: `some ${string}`]: command_caller
}
/**
* Simple Command Caller
* @example
Expand All @@ -96,7 +116,12 @@ interface command_caller extends base_keyed_method_caller<sstp_info_t> { }
* });
* @group callers
*/
interface simple_command_caller extends simple_keyed_method_caller<sstp_info_t> { }
interface simple_command_caller extends simple_keyed_method_caller<sstp_info_t> {
/**
* Extensible caller
*/
[uuid: `some ${string}`]: simple_command_caller
}
/**
* List Return Command Executor
* @example
Expand All @@ -109,7 +134,12 @@ interface simple_command_caller extends simple_keyed_method_caller<sstp_info_t>
* });
* @group callers
*/
interface list_command_caller extends base_keyed_method_caller<list_info_t> { }
interface list_command_caller extends base_keyed_method_caller<list_info_t> {
/**
* Extensible caller
*/
[uuid: `some ${string}`]: list_command_caller
}
/**
* List Return Command Executor with Simple Parameter Processing
* @example
Expand All @@ -120,7 +150,12 @@ interface list_command_caller extends base_keyed_method_caller<list_info_t> { }
* });
* @group callers
*/
interface simple_list_command_caller extends simple_keyed_method_caller<list_info_t> { }
interface simple_list_command_caller extends simple_keyed_method_caller<list_info_t> {
/**
* Extensible caller
*/
[uuid: `some ${string}`]: simple_list_command_caller
}

/**
* One more ghost_info attribute than {@link jsstp_t}
Expand Down
Loading

0 comments on commit ddc3c15

Please sign in to comment.