Skip to content

Commit 5cd590e

Browse files
committed
https://github.com/TypeStrong/typedoc/issues/2503
1 parent 3658482 commit 5cd590e

File tree

6 files changed

+94
-145
lines changed

6 files changed

+94
-145
lines changed

src/.decls/cn/base/tools.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ declare class ExtensibleFunction<args_T extends Array<any>, return_T> extends Fu
4545
*/
4646
readonly length: number;
4747
}
48+
interface ExtensibleFunction<args_T extends Array<any>, return_T> {
49+
/**
50+
* 自函数实例初始化
51+
* @param {Function} func
52+
* @returns {ExtensibleFunction}
53+
*/
54+
new(func: (...args: args_T) => return_T): ExtensibleFunction<args_T, return_T>;
55+
/**
56+
* 调用签名
57+
*/
58+
(...args: args_T): return_T;
59+
}
4860
/**
4961
* ghost交互中的安全等级
5062
* @see {@link https://www.google.com/search?q=site%3Assp.shillest.net%2Fukadoc%2F+SecurityLevel}

src/.decls/cn/types/ghost_events_queryer_t.d.ts

Lines changed: 19 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ import type jsstp_t from "./jsstp_t.d.ts";
22
import type { ExtensibleFunction, security_level_t } from "../base/tools.d.ts"
33

44
/**
5-
* ghost事件查询器:类定义实现
5+
* ghost事件查询器
66
* @example
77
* let ghost_events_queryer = jsstp.new_event_queryer();
88
* if(!ghost_events_queryer.available)
99
* console.log("当前ghost不支持事件查询");
1010
* if(ghost_events_queryer.has_event("OnBoom"))
1111
* jsstp.OnBoom();
12+
* @alias jsstp.ghost_events_queryer_t
1213
* @see {@link jsstp_t.new_event_queryer}
13-
* @group ghost_events_queryer_t implementations
1414
*/
15-
declare class ghost_events_queryer_t_class_impl extends ExtensibleFunction<[string,string], Promise<Boolean>> {
15+
declare class ghost_events_queryer_t extends ExtensibleFunction<[string,security_level_t], Promise<Boolean>> {
1616
/**
1717
* 构造一个事件查询器
1818
* @param {jsstp_t} base_jsstp
19-
* @returns {void}
2019
*/
2120
/*@__PURE__*/constructor(base_jsstp: jsstp_t);
2221
/**
@@ -64,10 +63,22 @@ declare class ghost_events_queryer_t_class_impl extends ExtensibleFunction<[stri
6463
clear(): void;
6564
}
6665
/**
67-
* ghost事件查询器:调用签名
68-
* @group ghost_events_queryer_t implementations
66+
* ghost事件查询器
67+
* @example
68+
* let ghost_events_queryer = jsstp.new_event_queryer();
69+
* if(!ghost_events_queryer.available)
70+
* console.log("当前ghost不支持事件查询");
71+
* if(ghost_events_queryer.has_event("OnBoom"))
72+
* jsstp.OnBoom();
73+
* @alias jsstp.ghost_events_queryer_t
74+
* @see {@link jsstp_t.new_event_queryer}
6975
*/
70-
type ghost_events_queryer_t_call_signature = {
76+
interface ghost_events_queryer_t {
77+
/**
78+
* 构造一个事件查询器
79+
* @param {jsstp_t} base_jsstp
80+
*/
81+
/*@__PURE__*/new(base_jsstp: jsstp_t): ghost_events_queryer_t;
7182
/**
7283
* 调用声明
7384
* 检查事件是否存在,ghost至少需要`Has_Event`事件的支持,并可以通过提供`Get_Supported_Events`事件来提高效率
@@ -76,49 +87,9 @@ type ghost_events_queryer_t_call_signature = {
7687
* @returns {Promise<Boolean>}
7788
* @example
7889
* let result = await ghost_events_queryer("On_connect");
79-
* @see 基于 {@link ghost_events_queryer_t_class_impl.check_event}
90+
* @see 基于 {@link ghost_events_queryer_t.check_event}
8091
*/
8192
/*@__PURE__*/(event_name: String, security_level?: security_level_t): Promise<Boolean>;
8293
}
83-
/**
84-
* ghost事件查询器:构造器接口声明
85-
* @group ghost_events_queryer_t implementations
86-
*/
87-
type ghost_events_queryer_t_constructor = {
88-
/**
89-
* 构造一个事件查询器
90-
* @param {jsstp_t} base_jsstp
91-
* @returns {void}
92-
*/
93-
/*@__PURE__*/new(base_jsstp: jsstp_t): ghost_events_queryer_t;
94-
}
95-
/**
96-
* ghost事件查询器
97-
* @example
98-
* let ghost_events_queryer = jsstp.new_event_queryer();
99-
* if(!ghost_events_queryer.available)
100-
* console.log("当前ghost不支持事件查询");
101-
* if(ghost_events_queryer.has_event("OnBoom"))
102-
* jsstp.OnBoom();
103-
* @alias jsstp.ghost_events_queryer_t
104-
* @see {@link jsstp_t.new_event_queryer}
105-
* @class
106-
*/
107-
declare const ghost_events_queryer_t: typeof ghost_events_queryer_t_class_impl & ghost_events_queryer_t_constructor;
108-
/**
109-
* ghost事件查询器
110-
* @example
111-
* let ghost_events_queryer = jsstp.new_event_queryer();
112-
* if(!ghost_events_queryer.available)
113-
* console.log("当前ghost不支持事件查询");
114-
* if(ghost_events_queryer.has_event("OnBoom"))
115-
* jsstp.OnBoom();
116-
* @alias jsstp.ghost_events_queryer_t
117-
* @see {@link jsstp_t.new_event_queryer}
118-
* @class
119-
*/
120-
type ghost_events_queryer_t = ghost_events_queryer_t_class_impl & ghost_events_queryer_t_call_signature & {
121-
constructor: typeof ghost_events_queryer_t;
122-
}
12394

12495
export default ghost_events_queryer_t;

src/.decls/en/base/tools.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ declare class ExtensibleFunction<args_T extends Array<any>, return_T> extends Fu
4545
*/
4646
readonly length: number;
4747
}
48+
interface ExtensibleFunction<args_T extends Array<any>, return_T> {
49+
/**
50+
* Initialising from a function instance
51+
* @param {Function} func
52+
* @returns {ExtensibleFunction}
53+
*/
54+
new(func: (...args: args_T) => return_T): ExtensibleFunction<args_T, return_T>;
55+
/**
56+
* The function's signature
57+
*/
58+
(...args: args_T): return_T;
59+
}
4860
/**
4961
* Security levels in ghost interactions
5062
* @see {@link https://www.google.com/search?q=site%3Assp.shillest.net%2Fukadoc%2F+SecurityLevel}

src/.decls/en/types/ghost_events_queryer_t.d.ts

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ import type jsstp_t from "./jsstp_t.d.ts";
22
import type { ExtensibleFunction, security_level_t } from "../base/tools.d.ts"
33

44
/**
5-
* ghost event finder: class definition implementation
5+
* ghost event finder
66
* @example
77
* let ghost_events_queryer = jsstp.new_event_queryer();
88
* if(!ghost_events_queryer.available)
9-
* console.log("Currently ghost does not support event queries");
9+
* console.log("Current ghost does not support event queries");
1010
* if(ghost_events_queryer.has_event("OnBoom"))
1111
* jsstp.OnBoom();
12+
* @alias jsstp.ghost_events_queryer_t
1213
* @see {@link jsstp_t.new_event_queryer}
13-
* @group ghost_events_queryer_t implementations
1414
*/
15-
declare class ghost_events_queryer_t_class_impl extends ExtensibleFunction<[string,string], Promise<Boolean>> {
15+
declare class ghost_events_queryer_t extends ExtensibleFunction<[string,security_level_t], Promise<Boolean>> {
1616
/**
1717
* Constructing an Event Querier
1818
* @param {jsstp_t} base_jsstp
19-
* @returns {void}
2019
*/
2120
/*@__PURE__*/constructor(base_jsstp: jsstp_t);
2221
/**
@@ -64,10 +63,22 @@ declare class ghost_events_queryer_t_class_impl extends ExtensibleFunction<[stri
6463
clear(): void;
6564
}
6665
/**
67-
* ghost event finder: call signatures
68-
* @group ghost_events_queryer_t implementations
66+
* ghost event finder
67+
* @example
68+
* let ghost_events_queryer = jsstp.new_event_queryer();
69+
* if(!ghost_events_queryer.available)
70+
* console.log("Current ghost does not support event queries");
71+
* if(ghost_events_queryer.has_event("OnBoom"))
72+
* jsstp.OnBoom();
73+
* @alias jsstp.ghost_events_queryer_t
74+
* @see {@link jsstp_t.new_event_queryer}
6975
*/
70-
type ghost_events_queryer_t_call_signature = {
76+
interface ghost_events_queryer_t {
77+
/**
78+
* Constructing an Event Querier
79+
* @param {jsstp_t} base_jsstp
80+
*/
81+
/*@__PURE__*/new(base_jsstp: jsstp_t): ghost_events_queryer_t;
7182
/**
7283
* Call declarations
7384
* Check for the existence of events, ghost requires at least `Has_Event` event support and can be made more efficient by providing `Get_Supported_Events` events
@@ -76,49 +87,9 @@ type ghost_events_queryer_t_call_signature = {
7687
* @returns {Promise<Boolean>}
7788
* @example
7889
* let result = await ghost_events_queryer("On_connect");
79-
* @see based on {@link ghost_events_queryer_t_class_impl.check_event}
90+
* @see based on {@link ghost_events_queryer_t.check_event}
8091
*/
8192
/*@__PURE__*/(event_name: String, security_level?: security_level_t): Promise<Boolean>;
8293
}
83-
/**
84-
* ghost event finder: constructor interface declaration
85-
* @group ghost_events_queryer_t implementations
86-
*/
87-
type ghost_events_queryer_t_constructor = {
88-
/**
89-
* Constructing an Event Querier
90-
* @param {jsstp_t} base_jsstp
91-
* @returns {void}
92-
*/
93-
/*@__PURE__*/new(base_jsstp: jsstp_t): ghost_events_queryer_t;
94-
}
95-
/**
96-
* ghost event finder
97-
* @example
98-
* let ghost_events_queryer = jsstp.new_event_queryer();
99-
* if(!ghost_events_queryer.available)
100-
* console.log("Current ghost does not support event queries");
101-
* if(ghost_events_queryer.has_event("OnBoom"))
102-
* jsstp.OnBoom();
103-
* @alias jsstp.ghost_events_queryer_t
104-
* @see {@link jsstp_t.new_event_queryer}
105-
* @class
106-
*/
107-
declare const ghost_events_queryer_t: typeof ghost_events_queryer_t_class_impl & ghost_events_queryer_t_constructor;
108-
/**
109-
* ghost event finder
110-
* @example
111-
* let ghost_events_queryer = jsstp.new_event_queryer();
112-
* if(!ghost_events_queryer.available)
113-
* console.log("Current ghost does not support event queries");
114-
* if(ghost_events_queryer.has_event("OnBoom"))
115-
* jsstp.OnBoom();
116-
* @alias jsstp.ghost_events_queryer_t
117-
* @see {@link jsstp_t.new_event_queryer}
118-
* @class
119-
*/
120-
type ghost_events_queryer_t = ghost_events_queryer_t_class_impl & ghost_events_queryer_t_call_signature & {
121-
constructor: typeof ghost_events_queryer_t;
122-
}
12394

12495
export default ghost_events_queryer_t;

src/.decls/jp/base/tools.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ declare class ExtensibleFunction<args_T extends Array<any>, return_T> extends Fu
4545
*/
4646
readonly length: number;
4747
}
48+
interface ExtensibleFunction<args_T extends Array<any>, return_T> {
49+
/**
50+
* 自己関数のインスタンス初期化
51+
* @param {Function} func
52+
* @returns {ExtensibleFunction}
53+
*/
54+
new(func: (...args: args_T) => return_T): ExtensibleFunction<args_T, return_T>;
55+
/**
56+
* 関数を呼び出し
57+
*/
58+
(...args: args_T): return_T;
59+
}
4860
/**
4961
* ghostとの通信におけるセキュリティレベル
5062
* @see {@link https://www.google.com/search?q=site%3Assp.shillest.net%2Fukadoc%2F+SecurityLevel}

src/.decls/jp/types/ghost_events_queryer_t.d.ts

Lines changed: 19 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ import type jsstp_t from "./jsstp_t.d.ts";
22
import type { ExtensibleFunction, security_level_t } from "../base/tools.d.ts"
33

44
/**
5-
* ゴースト・イベント・ファインダー:クラス定義の実装
5+
* ゴースト・イベント・ファインダー
66
* @example
77
* let ghost_events_queryer = jsstp.new_event_queryer();
88
* if(!ghost_events_queryer.available)
99
* console.log("現在、ゴーストはイベントクエリをサポートしていません。");
1010
* if(ghost_events_queryer.has_event("OnBoom"))
1111
* jsstp.OnBoom();
12+
* @alias jsstp.ghost_events_queryer_t
1213
* @see {@link jsstp_t.new_event_queryer}
13-
* @group ghost_events_queryer_t implementations
1414
*/
15-
declare class ghost_events_queryer_t_class_impl extends ExtensibleFunction<[string,string], Promise<Boolean>> {
15+
declare class ghost_events_queryer_t extends ExtensibleFunction<[string,security_level_t], Promise<Boolean>> {
1616
/**
1717
* イベントクエリアの構築
1818
* @param {jsstp_t} base_jsstp
19-
* @returns {void}
2019
*/
2120
/*@__PURE__*/constructor(base_jsstp: jsstp_t);
2221
/**
@@ -64,10 +63,22 @@ declare class ghost_events_queryer_t_class_impl extends ExtensibleFunction<[stri
6463
clear(): void;
6564
}
6665
/**
67-
* ゴースト・イベント・ファインダー:コール・シグネチャー
68-
* @group ghost_events_queryer_t implementations
66+
* ゴースト・イベント・ファインダー
67+
* @example
68+
* let ghost_events_queryer = jsstp.new_event_queryer();
69+
* if(!ghost_events_queryer.available)
70+
* console.log("現在、ゴーストはイベントクエリをサポートしていません。");
71+
* if(ghost_events_queryer.has_event("OnBoom"))
72+
* jsstp.OnBoom();
73+
* @alias jsstp.ghost_events_queryer_t
74+
* @see {@link jsstp_t.new_event_queryer}
6975
*/
70-
type ghost_events_queryer_t_call_signature = {
76+
interface ghost_events_queryer_t {
77+
/**
78+
* イベントクエリアの構築
79+
* @param {jsstp_t} base_jsstp
80+
*/
81+
/*@__PURE__*/new(base_jsstp: jsstp_t): ghost_events_queryer_t;
7182
/**
7283
* 宣言の呼び出し
7384
* ゴーストには少なくとも `Has_Event` イベントサポートが必要で、 `Get_Supported_Events` イベントを提供することでより効率的にすることができる。
@@ -76,49 +87,9 @@ type ghost_events_queryer_t_call_signature = {
7687
* @returns {Promise<Boolean>}
7788
* @example
7889
* let result = await ghost_events_queryer("On_connect");
79-
* @see {@link ghost_events_queryer_t_class_impl.check_event} に基づく。
90+
* @see {@link ghost_events_queryer_t_class.check_event} に基づく。
8091
*/
8192
/*@__PURE__*/(event_name: String, security_level?: security_level_t): Promise<Boolean>;
8293
}
83-
/**
84-
* ゴースト・イベント・ファインダー: コンストラクタのインターフェイス宣言
85-
* @group ghost_events_queryer_t implementations
86-
*/
87-
type ghost_events_queryer_t_constructor = {
88-
/**
89-
* イベントクエリアの構築
90-
* @param {jsstp_t} base_jsstp
91-
* @returns {void}
92-
*/
93-
/*@__PURE__*/new(base_jsstp: jsstp_t): ghost_events_queryer_t;
94-
}
95-
/**
96-
* ゴースト・イベント・ファインダー
97-
* @example
98-
* let ghost_events_queryer = jsstp.new_event_queryer();
99-
* if(!ghost_events_queryer.available)
100-
* console.log("現在、ゴーストはイベントクエリをサポートしていません。");
101-
* if(ghost_events_queryer.has_event("OnBoom"))
102-
* jsstp.OnBoom();
103-
* @alias jsstp.ghost_events_queryer_t
104-
* @see {@link jsstp_t.new_event_queryer}
105-
* @class
106-
*/
107-
declare const ghost_events_queryer_t: typeof ghost_events_queryer_t_class_impl & ghost_events_queryer_t_constructor;
108-
/**
109-
* ゴースト・イベント・ファインダー
110-
* @example
111-
* let ghost_events_queryer = jsstp.new_event_queryer();
112-
* if(!ghost_events_queryer.available)
113-
* console.log("現在、ゴーストはイベントクエリをサポートしていません。");
114-
* if(ghost_events_queryer.has_event("OnBoom"))
115-
* jsstp.OnBoom();
116-
* @alias jsstp.ghost_events_queryer_t
117-
* @see {@link jsstp_t.new_event_queryer}
118-
* @class
119-
*/
120-
type ghost_events_queryer_t = ghost_events_queryer_t_class_impl & ghost_events_queryer_t_call_signature & {
121-
constructor: typeof ghost_events_queryer_t;
122-
}
12394

12495
export default ghost_events_queryer_t;

0 commit comments

Comments
 (0)