editor-assetDB.d.ts 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * @author zhangxin
  3. * @description creator编辑器头文件
  4. * 2020/9/4
  5. */
  6. /**@class AssetDB */
  7. declare module Editor{
  8. /**@see API for main process https://docs.cocos.com/creator/manual/zh/extension/api/asset-db/asset-db-main.html
  9. * @see API for renderer process https://docs.cocos.com/creator/manual/zh/extension/api/asset-db/asset-db-renderer.html
  10. * @see API all https://docs.cocos.com/creator/api/zh/editor/asset-db.html
  11. */
  12. declare class AssetDB{
  13. urlToUuid(url) : string
  14. fspathToUuid(fspath) : string
  15. uuidToFspath(uuid) : string
  16. uuidToUrl(uuid) : string
  17. fspathToUrl(fspath) : string
  18. urlToFspath(url) : string
  19. exists(url) : string
  20. existsByUuid(uuid) : string
  21. existsByPath(fspath) : string
  22. isSubAsset(url) : boolean
  23. isSubAssetByUuid(uuid) : boolean
  24. isSubAssetByPath(fspath) : boolean
  25. containsSubAssets(url) : boolean
  26. containsSubAssetsByUuid(uuid) : boolean
  27. containsSubAssetsByPath(path) : boolean
  28. assetInfo(url) : object
  29. assetInfoByUuid(uuid) : object
  30. assetInfoByPath(fspath) : object
  31. subAssetInfos(url) : array
  32. subAssetInfosByUuid(uuid) : array
  33. subAssetInfosByPath(fspath) : array
  34. loadMeta(url) : object
  35. loadMetaByUuid(uuid) : object
  36. loadMetaByPath(fspath) : object
  37. isMount(url) : boolean
  38. isMountByPath(fspath) : boolean
  39. isMountByUuid(uuid) : boolean
  40. mountInfo(url) : object
  41. mountInfoByUuid(uuid) : object
  42. mountInfoByPath(fspath) : object
  43. mount(path, mountPath, opts, [cb])
  44. attachMountPath(mountPath, [cb])
  45. unattachMountPath(mountPath, [cb])
  46. unmount(mountPath, [cb])
  47. static init([cb])
  48. static refresh(url, [cb])
  49. static deepQuery([cb])
  50. static queryAssets(pattern, assetTypes, [cb])
  51. static queryMetas(pattern, type, [cb])
  52. static move(srcUrl, destUrl, [cb])
  53. static delete(urls, [cb])
  54. static create(url, data, [cb])
  55. static saveExists(url, data, [cb])
  56. static import(rawfiles, url, [cb])
  57. static saveMeta(uuid, jsonString, [cb])
  58. static exchangeUuid(urlA, urlB, [cb])
  59. static clearImports(url, [cb])
  60. static register(extname, folder, metaCtor)
  61. static unregister(metaCtor)
  62. static getRelativePath(fspath) : string
  63. static getAssetBackupPath(filePath)
  64. static setEventCallback(cb)
  65. }
  66. }