Skip to content

Commit e23ddb2

Browse files
authored
Provide .d.ts file for illustration of DebugInfos.json (#6340)
1 parent d049b25 commit e23ddb2

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

DebugInfos.d.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
/**
3+
* This is a declaration file for 'DebugInfos.json'
4+
* which is generated from 'EngineErrorMap.md'.
5+
* You may run cli command
6+
* `gulp build-debug-infos` or `npx gulp build-debug-infos` to generate the json file.
7+
*/
8+
9+
/**
10+
* Engine error maps.
11+
* The keys are error codes and their values are format strings.
12+
*/
13+
declare const $: Record<number, string>;
14+
15+
export default $;

cocos/core/platform/debug.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
* @category core
2727
*/
2828

29-
// @ts-ignore
29+
/* eslint-disable no-console */
30+
3031
import debugInfos from '../../../DebugInfos';
3132
import { EDITOR, JSB, DEV, DEBUG } from 'internal:constants';
3233
const ERROR_MAP_URL = 'https://github.com/cocos-creator/engine/blob/3d/EngineErrorMap.md';
@@ -242,7 +243,6 @@ export function _resetDebugSetting (mode: DebugMode) {
242243

243244
export function _throw (error_: any) {
244245
if (EDITOR) {
245-
// @ts-ignore
246246
return error(error_);
247247
} else {
248248
const stack = error_.stack;
@@ -345,7 +345,7 @@ export function getError (errorId: any, ...param: any[]): string {
345345
}
346346

347347
/**
348-
* @en Returns whether or not to display the FPS informations.
348+
* @en Returns whether or not to display the FPS information.
349349
* @zh 是否显示 FPS 信息。
350350
*/
351351
export function isDisplayStats (): boolean {

0 commit comments

Comments
 (0)