From 1a097e70d8c3305f6adf7c172a4d65ceb688d422 Mon Sep 17 00:00:00 2001 From: SmallMain Date: Thu, 24 Oct 2024 19:49:42 +0800 Subject: [PATCH] =?UTF-8?q?[common]=20=E5=A2=9E=E5=8A=A0=E5=A4=9A=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E7=9B=B8=E5=85=B3=E7=9A=84=E7=B1=BB=E5=9E=8B=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- creator-sp.d.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/creator-sp.d.ts b/creator-sp.d.ts index a9fde1b5..bc5f6bce 100644 --- a/creator-sp.d.ts +++ b/creator-sp.d.ts @@ -790,6 +790,34 @@ declare module cc { } +declare namespace cc.AssetManager { + interface CacheManager { + /** + !#en + Get temporary path with origin url, this method only works on mini-game platforms + + Use 'getTempAsync' if multithreading is enabled. + + !#zh + 通过原始 url 获取临时文件的路径,此方法只在小游戏平台有效 + + 如果启用了多线程特性,请使用 `getTempAsync`. + @param originUrl originUrl + */ + getTemp(originUrl: string): string; + /** + !#en + Get temporary path with origin url, this method only works on mini-game platforms + + !#zh + 通过原始 url 获取临时文件的路径,此方法只在小游戏平台有效 + @param originUrl originUrl + @param callback 回调函数,参数是返回的路径 + */ + getTempAsync(originUrl: string, callback: (path: string) => void): void; + } +} + declare module sp { /**