Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: optimize ResourceManager overload for type checking #2081

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
registry=https://registry.npmmirror.com/
chromedriver_cdnurl=https://npmmirror.com/mirrors/chromedriver/
electron_mirror=https://npmmirror.com/mirrors/electron/
operadriver_cdnurl=https://npmmirror.com/mirrors/operadriver/
sass_binary_site=https://npmmirror.com/mirrors/node-sass/
canvas_binary_host_mirror=https://npmmirror.com/mirrors/canvas/

auto-install-peers=true
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"chai": "^4.3.6",
"chai-spies": "^1.0.0",
"cross-env": "^5.2.0",
"electron": "^13",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
Expand Down
32 changes: 16 additions & 16 deletions packages/core/src/asset/ResourceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,33 @@ export class ResourceManager {
*/
constructor(public readonly engine: Engine) {}

/**
* Load asset asynchronously through the path.
* @param path - Path
* @returns Asset promise
*/
load<T>(path: string): AssetPromise<T>;

/**
* Load asset collection asynchronously through urls.
* @param paths - Path collections
* @returns Asset Promise
*/
load(paths: string[]): AssetPromise<Object[]>;

/**
* Load the asset asynchronously by asset item information.
* @param assetItem - AssetItem
* @returns AssetPromise
*/
load<T>(assetItem: LoadItem): AssetPromise<T>;
load<T extends EngineObject>(assetItem: LoadItem): AssetPromise<T>;

/**
* Load the asset collection asynchronously by loading the information collection.
* @param assetItems - Asset collection
* @returns AssetPromise
*/
load(assetItems: LoadItem[]): AssetPromise<Object[]>;
load<T extends EngineObject[]>(assetItems: LoadItem[]): AssetPromise<T>;

/**
* Load asset collection asynchronously through urls.
* @param paths - Path collections
* @returns Asset Promise
*/
load<T extends EngineObject[]>(paths: string[]): AssetPromise<T>;

/**
* Load asset asynchronously through the path.
* @param path - Path
* @returns Asset promise
*/
load<T extends EngineObject>(path: string): AssetPromise<T>;

load<T>(assetInfo: string | LoadItem | (LoadItem | string)[]): AssetPromise<T | Object[]> {
// single item
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading