mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 15:42:39 +08:00
Provide .d.ts file for illustration of DebugInfos.json (#6340)
This commit is contained in:
committed by
GitHub
parent
d049b259f2
commit
e23ddb23f1
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
/**
|
||||
* This is a declaration file for 'DebugInfos.json'
|
||||
* which is generated from 'EngineErrorMap.md'.
|
||||
* You may run cli command
|
||||
* `gulp build-debug-infos` or `npx gulp build-debug-infos` to generate the json file.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Engine error maps.
|
||||
* The keys are error codes and their values are format strings.
|
||||
*/
|
||||
declare const $: Record<number, string>;
|
||||
|
||||
export default $;
|
||||
@@ -26,7 +26,8 @@
|
||||
* @category core
|
||||
*/
|
||||
|
||||
// @ts-ignore
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import debugInfos from '../../../DebugInfos';
|
||||
import { EDITOR, JSB, DEV, DEBUG } from 'internal:constants';
|
||||
const ERROR_MAP_URL = 'https://github.com/cocos-creator/engine/blob/3d/EngineErrorMap.md';
|
||||
@@ -242,7 +243,6 @@ export function _resetDebugSetting (mode: DebugMode) {
|
||||
|
||||
export function _throw (error_: any) {
|
||||
if (EDITOR) {
|
||||
// @ts-ignore
|
||||
return error(error_);
|
||||
} else {
|
||||
const stack = error_.stack;
|
||||
@@ -345,7 +345,7 @@ export function getError (errorId: any, ...param: any[]): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* @en Returns whether or not to display the FPS informations.
|
||||
* @en Returns whether or not to display the FPS information.
|
||||
* @zh 是否显示 FPS 信息。
|
||||
*/
|
||||
export function isDisplayStats (): boolean {
|
||||
|
||||
Reference in New Issue
Block a user