[common] 补全类型提示

This commit is contained in:
SmallMain 2024-12-13 16:43:16 +08:00
parent 9a8eae69d7
commit 53091170c4
No known key found for this signature in database
2 changed files with 138 additions and 0 deletions

1
.gitignore vendored
View File

@ -28,6 +28,7 @@ Thumbs.db
!.vscode/settings.json
!.vscode/launch.json
!.vscode/**/*.code-snippets
!.vscode/mega.code-workspace
#/////////////////////////////////////////////////////////////////////////////
# Temp files

137
creator-sp.d.ts vendored
View File

@ -187,6 +187,11 @@ declare module cc {
}
/**
*
*/
const multiBatcher: MultiBatcher;
};
namespace RenderComponent {
@ -306,6 +311,21 @@ declare module cc {
}
/**
* CHAR
*/
interface LetterCache {
char: string;
hash: string;
measure: number;
fontDesc: string;
fontSize: number;
margin: number;
out: string;
color: string;
isOutlined: boolean;
}
/**
* CHAR
*/
@ -331,6 +351,21 @@ declare module cc {
*/
_fontDefDictionary: any;
/**
*
*/
letterCache: Record<string, LetterCache> | null;
/**
*
*/
enableLetterCache: boolean;
/**
*
*/
static init(): void;
/**
* 使 CHAR
*/
@ -341,6 +376,21 @@ declare module cc {
*/
getLetter(key: string): cc.BitmapFont.FontLetterDefinition;
/**
*
*/
cacheLetter(info: LetterCache): void;
/**
*
*/
getLetterCache(): LetterCache[];
/**
*
*/
applyLetterCache(data: LetterCache[]): void;
/**
*
*/
@ -363,6 +413,42 @@ declare module cc {
*/
const _shareAtlas: LetterAtlases;
/**
* Label Canvas
*/
const _canvasPool: {
/**
*
*/
pool: object[];
/**
* 使
*/
used: number;
/**
*
*/
max: number;
/**
*
*/
get(): object;
/**
*
*/
put(canvas: object): void;
/**
*
*
*
*/
cache(count: number): void;
};
}
namespace BitmapFont {
@ -786,7 +872,58 @@ declare module cc {
}
export namespace macro {
/**
* !#en
* Enable advanced performance indicators, allowing for customization and display of more performance metrics.
*
* !#zh
*
*
* @property {Boolean} ENABLE_CUSTOM_PROFILER
* @default false
*/
export let ENABLE_CUSTOM_PROFILER: boolean;
}
/**
*
*/
export const textUtils: {
/**
*
*/
measureCache: {
count: number;
limit: number;
size: number;
datas: Record<string, { value: number }>;
};
/**
*
*
* `ctx` `cc.Label._canvasPool`
*/
safeMeasureText(ctx: object, string: string, desc: string): number;
/**
*
*/
computeHash(string: string, desc: string): string;
/**
*
*/
getMeasureCache(): Record<string, number>;
/**
*
*/
applyMeasureCache(data: Record<string, number>): void;
};
}