@ives_xxz/packages 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/AddComponent/main.js +32 -0
  2. package/AddComponent/package.json +26 -0
  3. package/AddComponent/panel/index.js +233 -0
  4. package/AddComponent/readme.md +38 -0
  5. package/AddComponent/scene-accessor.js +109 -0
  6. package/AddComponent/template-auto-dock.js +73 -0
  7. package/BitmapFontTools/i18n/en.js +1 -0
  8. package/BitmapFontTools/i18n/zh.js +1 -0
  9. package/BitmapFontTools/main.js +1 -0
  10. package/BitmapFontTools/package-lock.json +83 -0
  11. package/BitmapFontTools/package.json +37 -0
  12. package/BitmapFontTools/panel/font.css +1 -0
  13. package/BitmapFontTools/panel/font.js +58 -0
  14. package/BitmapFontTools/panel/font_panel.js +1 -0
  15. package/BitmapFontTools/panel/ttf.css +1 -0
  16. package/BitmapFontTools/panel/ttf.js +68 -0
  17. package/BitmapFontTools/panel/ttf_panel.js +1 -0
  18. package/FWAssetsFinder/main.js +9 -0
  19. package/FWAssetsFinder/package.json +20 -0
  20. package/FWAssetsFinder/panel/index.css +2 -0
  21. package/FWAssetsFinder/panel/index.html +52 -0
  22. package/FWAssetsFinder/panel/index.js +265 -0
  23. package/FWAssetsFinder/panel/less.css +71 -0
  24. package/FWAssetsFinder/panel/scene.js +194 -0
  25. package/FWExcelGenerator/main.js +367 -0
  26. package/FWExcelGenerator/package-lock.json +109 -0
  27. package/FWExcelGenerator/package.json +23 -0
  28. package/FWExcelGenerator/panel/index.js +648 -0
  29. package/FWLayerGenerator/main.js +186 -0
  30. package/FWLayerGenerator/package.json +21 -0
  31. package/FWLayerGenerator/panel/index.css +36 -0
  32. package/FWLayerGenerator/panel/index.html +17 -0
  33. package/FWLayerGenerator/panel/index.js +29 -0
  34. package/FWMask/inspector.js +26 -0
  35. package/FWMask/main.js +16 -0
  36. package/FWMask/package.json +6 -0
  37. package/FWPolygonPoints/main.js +149 -0
  38. package/FWPolygonPoints/package.json +9 -0
  39. package/PNG Auto Compress/CHANGELOG.md +32 -0
  40. package/PNG Auto Compress/LICENSE +21 -0
  41. package/PNG Auto Compress/README.md +113 -0
  42. package/PNG Auto Compress/config-manager.js +72 -0
  43. package/PNG Auto Compress/i18n/en.js +14 -0
  44. package/PNG Auto Compress/i18n/zh.js +14 -0
  45. package/PNG Auto Compress/images/setting.png +0 -0
  46. package/PNG Auto Compress/jsconfig.json +1 -0
  47. package/PNG Auto Compress/main.js +377 -0
  48. package/PNG Auto Compress/package.json +41 -0
  49. package/PNG Auto Compress/panel.setting/index.css +13 -0
  50. package/PNG Auto Compress/panel.setting/index.html +51 -0
  51. package/PNG Auto Compress/panel.setting/index.js +124 -0
  52. package/PNG Auto Compress/pngquant/macos/COPYRIGHT +687 -0
  53. package/PNG Auto Compress/pngquant/macos/README.md +78 -0
  54. package/PNG Auto Compress/pngquant/macos/pngquant +0 -0
  55. package/PNG Auto Compress/pngquant/macos/pngquant-compat +0 -0
  56. package/PNG Auto Compress/pngquant/windows/COPYRIGHT +687 -0
  57. package/PNG Auto Compress/pngquant/windows/Drag PNG here to reduce palette automatically.bat +11 -0
  58. package/PNG Auto Compress/pngquant/windows/Drag PNG here to reduce palette to 256.bat +10 -0
  59. package/PNG Auto Compress/pngquant/windows/README.txt +78 -0
  60. package/PNG Auto Compress/pngquant/windows/pngquant.exe +0 -0
  61. package/PNG Auto Compress/typings/cocos/editor.d.ts +1053 -0
  62. package/PNG Auto Compress/utils/file-utils.js +67 -0
  63. package/Quick Finder/CHANGELOG.md +100 -0
  64. package/Quick Finder/LICENSE +21 -0
  65. package/Quick Finder/README.en.md +141 -0
  66. package/Quick Finder/README.md +149 -0
  67. package/Quick Finder/i18n/en.js +42 -0
  68. package/Quick Finder/i18n/zh.js +42 -0
  69. package/Quick Finder/images/assets/animation-clip.png +0 -0
  70. package/Quick Finder/images/assets/asset.png +0 -0
  71. package/Quick Finder/images/assets/atlas.png +0 -0
  72. package/Quick Finder/images/assets/audio-clip.png +0 -0
  73. package/Quick Finder/images/assets/auto-atlas.png +0 -0
  74. package/Quick Finder/images/assets/bitmap-font.png +0 -0
  75. package/Quick Finder/images/assets/buffer.png +0 -0
  76. package/Quick Finder/images/assets/coffeescript.png +0 -0
  77. package/Quick Finder/images/assets/component.png +0 -0
  78. package/Quick Finder/images/assets/css.png +0 -0
  79. package/Quick Finder/images/assets/dragonbones-atlas.png +0 -0
  80. package/Quick Finder/images/assets/folder.png +0 -0
  81. package/Quick Finder/images/assets/html.png +0 -0
  82. package/Quick Finder/images/assets/javascript.png +0 -0
  83. package/Quick Finder/images/assets/json.png +0 -0
  84. package/Quick Finder/images/assets/label-atlas.png +0 -0
  85. package/Quick Finder/images/assets/markdown.png +0 -0
  86. package/Quick Finder/images/assets/material.png +0 -0
  87. package/Quick Finder/images/assets/mesh.png +0 -0
  88. package/Quick Finder/images/assets/mount.png +0 -0
  89. package/Quick Finder/images/assets/node.png +0 -0
  90. package/Quick Finder/images/assets/particle.png +0 -0
  91. package/Quick Finder/images/assets/physics-material.png +0 -0
  92. package/Quick Finder/images/assets/prefab.png +0 -0
  93. package/Quick Finder/images/assets/raw-asset.png +0 -0
  94. package/Quick Finder/images/assets/scene.png +0 -0
  95. package/Quick Finder/images/assets/shader.png +0 -0
  96. package/Quick Finder/images/assets/skeleton.png +0 -0
  97. package/Quick Finder/images/assets/spine.png +0 -0
  98. package/Quick Finder/images/assets/sprite-animation.png +0 -0
  99. package/Quick Finder/images/assets/sprite-atlas.png +0 -0
  100. package/Quick Finder/images/assets/sprite-frame.png +0 -0
  101. package/Quick Finder/images/assets/text.png +0 -0
  102. package/Quick Finder/images/assets/tiled-map.png +0 -0
  103. package/Quick Finder/images/assets/ttf-font.png +0 -0
  104. package/Quick Finder/images/assets/typescript.png +0 -0
  105. package/Quick Finder/images/search.png +0 -0
  106. package/Quick Finder/images/settings.png +0 -0
  107. package/Quick Finder/images/update.png +0 -0
  108. package/Quick Finder/images/version.png +0 -0
  109. package/Quick Finder/jsconfig.json +17 -0
  110. package/Quick Finder/lib/node-fetch.js +1649 -0
  111. package/Quick Finder/lib/vue.global.prod.js +7 -0
  112. package/Quick Finder/package.json +45 -0
  113. package/Quick Finder/src/common/config-manager.js +122 -0
  114. package/Quick Finder/src/eazax/browser-util.js +61 -0
  115. package/Quick Finder/src/eazax/color-util.js +37 -0
  116. package/Quick Finder/src/eazax/css/cocos-class.css +202 -0
  117. package/Quick Finder/src/eazax/css/cocos-tag.css +197 -0
  118. package/Quick Finder/src/eazax/css/eazax-colors.css +18 -0
  119. package/Quick Finder/src/eazax/editor-main-kit.js +53 -0
  120. package/Quick Finder/src/eazax/editor-main-util.js +112 -0
  121. package/Quick Finder/src/eazax/editor-renderer-kit.js +26 -0
  122. package/Quick Finder/src/eazax/file-util.js +158 -0
  123. package/Quick Finder/src/eazax/i18n.js +36 -0
  124. package/Quick Finder/src/eazax/main-event.js +81 -0
  125. package/Quick Finder/src/eazax/package-util.js +47 -0
  126. package/Quick Finder/src/eazax/renderer-event.js +80 -0
  127. package/Quick Finder/src/eazax/updater.js +92 -0
  128. package/Quick Finder/src/eazax/version-util.js +61 -0
  129. package/Quick Finder/src/eazax/window-util.js +80 -0
  130. package/Quick Finder/src/main/finder.js +101 -0
  131. package/Quick Finder/src/main/index.js +155 -0
  132. package/Quick Finder/src/main/opener.js +95 -0
  133. package/Quick Finder/src/main/panel-manager.js +159 -0
  134. package/Quick Finder/src/renderer/search/index.css +222 -0
  135. package/Quick Finder/src/renderer/search/index.html +46 -0
  136. package/Quick Finder/src/renderer/search/index.js +348 -0
  137. package/Quick Finder/src/renderer/settings/index.css +101 -0
  138. package/Quick Finder/src/renderer/settings/index.html +86 -0
  139. package/Quick Finder/src/renderer/settings/index.js +219 -0
  140. package/Quick Finder/typings/cocos/editor.d.ts +1053 -0
  141. package/Quick Finder/typings/vue.d.ts +1 -0
  142. package/README.md +93 -0
  143. package/package.json +12 -0
  144. package/unpack plist/main.js +253 -0
  145. package/unpack plist/package.json +13 -0
  146. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/CHANGELOG.md +30 -0
  147. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/LICENSE +21 -0
  148. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/README.en.md +111 -0
  149. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/README.md +115 -0
  150. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/i18n/en.js +55 -0
  151. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/i18n/zh.js +55 -0
  152. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/images/search.png +0 -0
  153. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/images/settings.png +0 -0
  154. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/images/update.png +0 -0
  155. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/images/version.png +0 -0
  156. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/jsconfig.json +17 -0
  157. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/lib/node-fetch.js +1649 -0
  158. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/lib/vue.global.prod.js +7 -0
  159. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/package.json +44 -0
  160. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/common/config-manager.js +104 -0
  161. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/browser-util.js +61 -0
  162. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/color-util.js +37 -0
  163. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/css/cocos-class.css +201 -0
  164. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/css/cocos-tag.css +197 -0
  165. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/css/eazax-colors.css +18 -0
  166. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/editor-main-kit.js +53 -0
  167. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/editor-main-util.js +147 -0
  168. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/editor-renderer-kit.js +26 -0
  169. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/file-util.js +158 -0
  170. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/i18n.js +36 -0
  171. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/main-event.js +81 -0
  172. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/package-util.js +47 -0
  173. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/renderer-event.js +80 -0
  174. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/updater.js +92 -0
  175. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/version-util.js +61 -0
  176. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/window-util.js +80 -0
  177. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/editor-api.js +90 -0
  178. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/finder.js +248 -0
  179. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/index.js +155 -0
  180. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/object-util.js +70 -0
  181. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/panel-manager.js +86 -0
  182. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/parser.js +161 -0
  183. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/printer.js +108 -0
  184. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/renderer/settings/index.css +61 -0
  185. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/renderer/settings/index.html +90 -0
  186. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/renderer/settings/index.js +191 -0
  187. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/typings/cocos/editor.d.ts +1053 -0
  188. package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/typings/vue.d.ts +1 -0
@@ -0,0 +1,1053 @@
1
+ /**
2
+ * Cocos Creator 编辑器模块
3
+ * @author 陈皮皮(ifaswind)
4
+ * @version 20210312
5
+ * @see https://gitee.com/ifaswind/eazax-ccc/blob/master/declarations/editor.d.ts
6
+ */
7
+ declare module Editor {
8
+
9
+ /**
10
+ * Log the normal message and show on the console. The method will send ipc message editor:console-log to all windows.
11
+ * @param args Whatever arguments the message needs
12
+ */
13
+ function log(...args: any): void;
14
+
15
+ /**
16
+ * Log the normal message and show on the console. The method will send ipc message editor:console-log to all windows.
17
+ * @param args Whatever arguments the message needs
18
+ */
19
+ function info(...args: any): void;
20
+
21
+ /**
22
+ * Log the warnning message and show on the console, it also shows the call stack start from the function call it. The method will send ipc message editor:console-warn to all windows.
23
+ * @param args Whatever arguments the message needs
24
+ */
25
+ function warn(...args: any): void;
26
+
27
+ /**
28
+ * Log the error message and show on the console, it also shows the call stack start from the function call it. The method will sends ipc message editor:console-error to all windows.
29
+ * @param args Whatever arguments the message needs
30
+ */
31
+ function error(...args: any): void;
32
+
33
+ /**
34
+ * Log the success message and show on the console The method will send ipc message editor:console-success to all windows.
35
+ * @param args Whatever arguments the message needs
36
+ */
37
+ function success(...args: any): void;
38
+
39
+ /**
40
+ * Require the module by Editor.url. This is good for module exists in package, since the absolute path of package may be variant in different machine.
41
+ * @param url
42
+ */
43
+ function require(url: string): any;
44
+
45
+ /**
46
+ * Returns the file path (if it is registered in custom protocol) or url (if it is a known public protocol).
47
+ * @param url
48
+ * @param encode
49
+ */
50
+ function url(url: string, encode?: string): string;
51
+
52
+ function T(key: string): string;
53
+
54
+ }
55
+
56
+ declare module Editor {
57
+ readonly let appPath: string;
58
+ readonly let frameworkPath: string;
59
+ readonly let importPath: string;
60
+ readonly let isWin32: boolean;
61
+ readonly let isDarwin: boolean;
62
+ readonly let lang: string;
63
+ readonly let libraryPath: string;
64
+ readonly let sceneScripts: { [packageName: string]: string };
65
+ }
66
+
67
+ declare module Editor {
68
+
69
+ /**
70
+ * 渲染进程
71
+ */
72
+ module RendererProcess {
73
+
74
+ /**
75
+ * AssetDB singleton class in renderer process, you can access the instance with `Editor.assetdb`.
76
+ */
77
+ class AssetDB {
78
+
79
+ /**
80
+ * The remote AssetDB instance of main process, same as `Editor.remote.assetdb`.
81
+ */
82
+ readonly remote: Remote;
83
+
84
+ /**
85
+ * The library path.
86
+ */
87
+ readonly library: string;
88
+
89
+ /**
90
+ * Reveal given url in native file system.
91
+ * @param url
92
+ */
93
+ explore(url: string): string;
94
+
95
+ /**
96
+ * Reveal given url's library file in native file system.
97
+ * @param url
98
+ */
99
+ exploreLib(url: string): string;
100
+
101
+ /**
102
+ * Get native file path by url.
103
+ * @param url
104
+ * @param cb The callback function.
105
+ */
106
+ queryPathByUrl(url: string, cb?: (err: any, path: any) => void): void;
107
+
108
+ /**
109
+ * Get uuid by url.
110
+ * @param url
111
+ * @param cb The callback function.
112
+ */
113
+ queryUuidByUrl(url: string, cb?: (err: any, uuid: any) => void): void;
114
+
115
+ /**
116
+ * Get native file path by uuid.
117
+ * @param uuid
118
+ * @param cb The callback function.
119
+ */
120
+ queryPathByUuid(uuid: string, cb?: (err: any, path: any) => void): void;
121
+
122
+ /**
123
+ * Get asset url by uuid.
124
+ * @param uuid
125
+ * @param cb The callback function.
126
+ */
127
+ queryUrlByUuid(uuid: string, cb?: (err: any, url: any) => void): void;
128
+
129
+ /**
130
+ * Get asset info by uuid.
131
+ * @param uuid
132
+ * @param cb The callback function.
133
+ */
134
+ queryInfoByUuid(uuid: string, cb?: (err: any, info: any) => void): void;
135
+
136
+ /**
137
+ * Get meta info by uuid.
138
+ * @param uuid
139
+ * @param cb The callback function.
140
+ */
141
+ queryMetaInfoByUuid(uuid: string, cb?: (err: any, info: any) => void): void;
142
+
143
+ /**
144
+ * Query all assets from asset-db.
145
+ * @param cb The callback function.
146
+ */
147
+ deepQuery(cb?: (err: any, results: any[]) => void): void;
148
+
149
+ /**
150
+ * Query assets by url pattern and asset-type.
151
+ * @param pattern The url pattern.
152
+ * @param assetTypes The asset type(s).
153
+ * @param cb The callback function.
154
+ */
155
+ queryAssets(pattern: string, assetTypes: string | string[], cb?: (err: any, results: any[]) => void): void;
156
+
157
+ /**
158
+ * Import files outside asset-db to specific url folder.
159
+ * @param rawfiles Rawfile path list.
160
+ * @param destUrl The url of dest folder.
161
+ * @param showProgress Show progress or not.
162
+ * @param cb The callbak function.
163
+ */
164
+ import(rawfiles: string[], destUrl: string, showProgress?: boolean, cb?: (err: any, result: any) => void): void;
165
+
166
+ /**
167
+ * Create asset in specific url by sending string data to it.
168
+ * @param uuid
169
+ * @param metaJson
170
+ * @param cb the callback function.
171
+ */
172
+ create(url: string, data: string, cb?: (err: any, result: any) => void): void;
173
+
174
+ /**
175
+ * Move asset from src to dest.
176
+ * @param srcUrl
177
+ * @param destUrl
178
+ * @param showMessageBox
179
+ */
180
+ move(srcUrl: string, destUrl: string, showMessageBox?: boolean): void;
181
+
182
+ /**
183
+ * Delete assets by url list.
184
+ * @param urls
185
+ */
186
+ delete(urls: string[]): void;
187
+
188
+ /**
189
+ * Save specific asset by sending string data.
190
+ * @param url
191
+ * @param data
192
+ * @param cb the callback function.
193
+ */
194
+ saveExists(url: string, data: string, cb?: (err: any, result: any) => void): void;
195
+
196
+ /**
197
+ * Create or save assets by sending string data. If the url is already existed, it will be changed with new data. The behavior is same with method saveExists. Otherwise, a new asset will be created. The behavior is same with method create.
198
+ * @param url
199
+ * @param data
200
+ * @param cb the callback function.
201
+ */
202
+ createOrSave(url: string, data: string, cb?: (err: any, result: any) => void): void;
203
+
204
+ /**
205
+ * Save specific meta by sending meta's json string.
206
+ * @param uuid
207
+ * @param metaJson
208
+ * @param cb the callback function.
209
+ */
210
+ saveMeta(uuid: string, metaJson: string, cb?: (err: any, result: any) => void): void;
211
+
212
+ /**
213
+ * Refresh the assets in url, and return the results.
214
+ * @param url
215
+ * @param cb
216
+ */
217
+ refresh(url: string, cb?: (err: any, results: any[]) => void): void;
218
+
219
+ }
220
+
221
+ }
222
+
223
+ /**
224
+ * 主进程
225
+ */
226
+ module MainProcess {
227
+
228
+ /**
229
+ * AssetDB singleton class in main process, you can access the instance with `Editor.assetdb`.
230
+ */
231
+ class AssetDB {
232
+
233
+ /**
234
+ * Return uuid by url. If uuid not found, it will return null.
235
+ * @param url
236
+ */
237
+ urlToUuid(url: string): string;
238
+
239
+ /**
240
+ * Return uuid by file path. If uuid not found, it will return null.
241
+ * @param fspath
242
+ */
243
+ fspathToUuid(fspath: string): string;
244
+
245
+ /**
246
+ * Return file path by uuid. If file path not found, it will return null.
247
+ * @param url
248
+ */
249
+ uuidToFspath(url: string): string;
250
+
251
+ /**
252
+ * Return url by uuid. If url not found, it will return null.
253
+ * @param uuid
254
+ */
255
+ uuidToUrl(uuid: string): string;
256
+
257
+ /**
258
+ * Return url by file path. If file path not found, it will return null.
259
+ * @param fspath
260
+ */
261
+ fspathToUrl(fspath: string): string;
262
+
263
+ /**
264
+ * Return file path by url. If url not found, it will return null.
265
+ * @param url
266
+ */
267
+ urlToFspath(url: string): string;
268
+
269
+ /**
270
+ * Check existance by url.
271
+ * @param url
272
+ */
273
+ exists(url: string): string;
274
+
275
+ /**
276
+ * Check existance by uuid.
277
+ * @param uuid
278
+ */
279
+ existsByUuid(uuid: string): string;
280
+
281
+ /**
282
+ * Check existance by path.
283
+ * @param fspath
284
+ */
285
+ existsByPath(fspath: string): string;
286
+
287
+ /**
288
+ * Check whether asset for a given url is a sub asset.
289
+ * @param url
290
+ */
291
+ isSubAsset(url: string): boolean;
292
+
293
+ /**
294
+ * Check whether asset for a given uuid is a sub asset.
295
+ * @param uuid
296
+ */
297
+ isSubAssetByUuid(uuid: string): boolean;
298
+
299
+ /**
300
+ * Check whether asset for a given path is a sub asset.
301
+ * @param fspath
302
+ */
303
+ isSubAssetByPath(fspath: string): boolean;
304
+
305
+ /**
306
+ * Check whether asset contains sub assets for a given url.
307
+ * @param url
308
+ */
309
+ containsSubAssets(url: string): boolean;
310
+
311
+ /**
312
+ * Check whether asset contains sub assets for a given uuid.
313
+ * @param uuid
314
+ */
315
+ containsSubAssetsByUuid(uuid: string): boolean;
316
+
317
+ /**
318
+ * Check whether asset contains sub assets for a given path.
319
+ * @param fspath
320
+ */
321
+ containsSubAssetsByPath(fspath: string): boolean;
322
+
323
+ /**
324
+ * Return asset info by a given url.
325
+ * @param url
326
+ */
327
+ assetInfo(url: string): AssetInfo;
328
+
329
+ /**
330
+ * Return asset info by a given uuid.
331
+ * @param uuid
332
+ */
333
+ assetInfoByUuid(uuid: string): AssetInfo;
334
+
335
+ /**
336
+ * Return asset info by a given file path.
337
+ * @param fspath
338
+ */
339
+ assetInfoByPath(fspath: string): AssetInfo;
340
+
341
+ /**
342
+ * Return all sub assets info by url if the url contains sub assets.
343
+ * @param url
344
+ */
345
+ subAssetInfos(url: string): AssetInfo[];
346
+
347
+ /**
348
+ * Return all sub assets info by uuid if the uuid contains sub assets.
349
+ * @param uuid
350
+ */
351
+ subAssetInfosByUuid(uuid: string): AssetInfo[];
352
+
353
+ /**
354
+ * Return all sub assets info by path if the path contains sub assets.
355
+ * @param fspath
356
+ */
357
+ subAssetInfosByPath(fspath: string): AssetInfo[];
358
+
359
+ /**
360
+ * Return meta instance by a given url.
361
+ * @param url
362
+ */
363
+ loadMeta(url: string): MetaBase;
364
+
365
+ /**
366
+ * Return meta instance by a given uuid.
367
+ * @param uuid
368
+ */
369
+ loadMetaByUuid(uuid: string): MetaBase;
370
+
371
+ /**
372
+ * Return meta instance by a given path.
373
+ * @param fspath
374
+ */
375
+ loadMetaByPath(fspath: string): MetaBase;
376
+
377
+ /**
378
+ * Return whether a given url is reference to a mount.
379
+ * @param url
380
+ */
381
+ isMount(url: string): boolean;
382
+
383
+ /**
384
+ * Return whether a given path is reference to a mount.
385
+ * @param fspath
386
+ */
387
+ isMountByPath(fspath: string): boolean;
388
+
389
+ /**
390
+ * Return whether a given uuid is reference to a mount.
391
+ * @param uuid
392
+ */
393
+ isMountByUuid(uuid: string): boolean;
394
+
395
+ /**
396
+ * Return mount info by url.
397
+ * @param url
398
+ */
399
+ mountInfo(url: string): MountInfo;
400
+
401
+ /**
402
+ * Return mount info by uuid.
403
+ * @param uuid
404
+ */
405
+ mountInfoByUuid(uuid: string): MountInfo;
406
+
407
+ /**
408
+ * Return mount info by path.
409
+ * @param fspath
410
+ */
411
+ mountInfoByPath(fspath: string): MountInfo;
412
+
413
+ /**
414
+ * Mount a directory to assetdb, and give it a name. If you don't provide a name, it will mount to root.
415
+ * @param path file system path.
416
+ * @param mountPath the mount path (relative path).
417
+ * @param opts options.
418
+ * @param opts.hide if the mount hide in assets browser.
419
+ * @param opts.virtual if this is a virtual mount point.
420
+ * @param opts.icon icon for the mount.
421
+ * @param cb a callback function.
422
+ * @example Editor.assetdb.mount('path/to/mount', 'assets', function (err) {
423
+ // mounted, do something ...
424
+ });
425
+ */
426
+ mount(path: string, mountPath: string, opts: { hide: object, vitural: object, icon: object }, cb?: (err: any) => void): void;
427
+
428
+ /**
429
+ * Attach the specified mount path.
430
+ * @param mountPath the mount path (relative path).
431
+ * @param cb a callback function.
432
+ * @example Editor.assetdb.attachMountPath('assets', function (err, results) {
433
+ // mount path attached, do something ...
434
+ // results are the assets created
435
+ });
436
+ */
437
+ attachMountPath(mountPath: string, cb?: (err: any, results: any[]) => void): void;
438
+
439
+ /**
440
+ * Unattach the specified mount path.
441
+ * @param mountPath the mount path (relative path).
442
+ * @param cb a callback function.
443
+ * @example Editor.assetdb.unattachMountPath('assets', function (err, results) {
444
+ // mount path unattached, do something ...
445
+ // results are the assets deleted
446
+ });
447
+ */
448
+ unattachMountPath(mountPath: string, cb?: (err: any, results: any[]) => void): void;
449
+
450
+ /**
451
+ * Unmount by name.
452
+ * @param mountPath the mount path.
453
+ * @param cb a callback function.
454
+ * @example Editor.assetdb.unmount('assets', function (err) {
455
+ // unmounted, do something ...
456
+ });
457
+ */
458
+ unmount(mountPath: string, cb?: (err: any) => void): void;
459
+
460
+ /**
461
+ * Init assetdb, it will scan the mounted directories, and import unimported assets.
462
+ * @param cb a callback function.
463
+ * @example Editor.assetdb.init(function (err, results) {
464
+ // assets that imported during init
465
+ results.forEach(function (result) {
466
+ // result.uuid
467
+ // result.parentUuid
468
+ // result.url
469
+ // result.path
470
+ // result.type
471
+ });
472
+ });
473
+ */
474
+ init(cb?: (err: any, results: any[]) => void): void;
475
+
476
+ /**
477
+ * Refresh the assets in url, and return the results.
478
+ * @param url
479
+ * @param cb
480
+ */
481
+ refresh(url: string, cb?: Function): void;
482
+
483
+ /**
484
+ * deepQuery
485
+ * @param cb
486
+ * @example Editor.assetdb.deepQuery(function (err, results) {
487
+ results.forEach(function (result) {
488
+ // result.name
489
+ // result.extname
490
+ // result.uuid
491
+ // result.type
492
+ // result.isSubAsset
493
+ // result.children - the array of children result
494
+ });
495
+ });
496
+ */
497
+ deepQuery(cb?: Function): void;
498
+
499
+ /**
500
+ * queryAssets
501
+ * @param pattern The url pattern.
502
+ * @param assetTypes The asset type(s).
503
+ * @param cb The callback function.
504
+ */
505
+ queryAssets(pattern: string, assetTypes: string | string[], cb?: (err: Error, results: any[]) => void): void;
506
+
507
+ /**
508
+ * queryMetas
509
+ * @param pattern The url pattern.
510
+ * @param type The asset type.
511
+ * @param cb The callback function.
512
+ */
513
+ queryMetas(pattern: string, type: string, cb?: (err: Error, results: any[]) => void): void;
514
+
515
+ /**
516
+ * move
517
+ * @param srcUrl The url pattern.
518
+ * @param destUrl The asset type.
519
+ * @param cb The callback function.
520
+ */
521
+ move(srcUrl: string, destUrl: string, cb?: (err: Error, results: any[]) => void): void;
522
+
523
+ /**
524
+ * delete
525
+ * @param urls
526
+ * @param cb
527
+ */
528
+ delete(urls: string[], cb?: (err: Error, results: any[]) => void): void;
529
+
530
+ /**
531
+ * Create asset at url with data.
532
+ * @param url
533
+ * @param data
534
+ * @param cb
535
+ */
536
+ create(url: string, data: string, cb?: (err: Error, results: any[]) => void): void;
537
+
538
+ /**
539
+ * Save data to the exists asset at url.
540
+ * @param url
541
+ * @param data
542
+ * @param cb
543
+ */
544
+ saveExists(url: string, data: string, cb?: (err: Error, meta: any) => void): void;
545
+
546
+ /**
547
+ * Import raw files to url
548
+ * @param rawfiles
549
+ * @param url
550
+ * @param cb
551
+ */
552
+ import(rawfiles: string[], url: string, cb?: (err: Error, results: any[]) => void): void;
553
+
554
+ /**
555
+ * Overwrite the meta by loading it through uuid.
556
+ * @param uuid
557
+ * @param jsonString
558
+ * @param cb
559
+ */
560
+ saveMeta(uuid: string, jsonString: string, cb?: (err: Error, meta: any) => void): void;
561
+
562
+ /**
563
+ * Exchange uuid for two assets.
564
+ * @param urlA
565
+ * @param urlB
566
+ * @param cb
567
+ */
568
+ exchangeUuid(urlA: string, urlB: string, cb?: (err: Error, results: any[]) => void): void;
569
+
570
+ /**
571
+ * Clear imports.
572
+ * @param url
573
+ * @param cb
574
+ */
575
+ clearImports(url: string, cb?: (err: Error, results: any[]) => void): void;
576
+
577
+ /**
578
+ * Register meta type.
579
+ * @param extname
580
+ * @param folder Whether it's a folder type.
581
+ * @param metaCtor
582
+ */
583
+ register(extname: string, folder: boolean, metaCtor: object): void;
584
+
585
+ /**
586
+ * Unregister meta type.
587
+ * @param metaCtor
588
+ */
589
+ unregister(metaCtor: object): void;
590
+
591
+ /**
592
+ * Get the relative path from mount path to the asset by fspath.
593
+ * @param fspath
594
+ */
595
+ getRelativePath(fspath: string): string;
596
+
597
+ /**
598
+ * Get the backup file path of asset file.
599
+ * @param filePath
600
+ */
601
+ getAssetBackupPath(filePath: string): string;
602
+
603
+ }
604
+
605
+ }
606
+
607
+ interface MetaBase {
608
+ ver: string;
609
+ uuid: string;
610
+ }
611
+
612
+ interface MountInfo {
613
+ path: string;
614
+ name: string;
615
+ type: string;
616
+ }
617
+
618
+ interface Metas {
619
+ asset: string[];
620
+ folder: string[];
621
+ mount: string[];
622
+ 'custom-asset': string[];
623
+ 'native-asset': string[];
624
+ 'animation-clip': string[];
625
+ 'audio-clip': string[];
626
+ 'bitmap-font': string[];
627
+ }
628
+
629
+ interface App {
630
+ readonly home: string;
631
+ readonly name: string;
632
+ readonly path: string;
633
+ readonly version: string;
634
+ }
635
+
636
+ class Remote {
637
+ readonly App: App;
638
+ readonly isClosing: boolean;
639
+ readonly lang: string;
640
+ readonly isNode: boolean;
641
+ readonly isElectron: boolean;
642
+ readonly isNative: boolean;
643
+ readonly isPureWeb: boolean;
644
+ readonly isRendererProcess: boolean;
645
+ readonly isMainProcess: boolean;
646
+ readonly isDarwin: boolean;
647
+ readonly isWin32: boolean;
648
+ readonly isRetina: boolean;
649
+ readonly frameworkPath: string;
650
+ readonly dev: boolean;
651
+ readonly logfile: string;
652
+ readonly themePaths: string[];
653
+ readonly theme: string;
654
+ readonly showInternalMount: boolean;
655
+ readonly metas: Metas;
656
+ readonly metaBackupPath: string;
657
+ readonly assetBackupPath: string;
658
+ readonly libraryPath: string;
659
+ readonly importPath: string;
660
+ readonly externalMounts: any;
661
+ readonly mountsWritable: string;
662
+ readonly assetdb: MainProcess.AssetDB;
663
+ readonly assetdbInited: boolean;
664
+ readonly sceneList: string[];
665
+ readonly versions: {
666
+ 'asset-db': string;
667
+ CocosCreator: string;
668
+ cocos2d: string;
669
+ 'editor-framework': string;
670
+ }
671
+ }
672
+
673
+ /** Remote 实例 */
674
+ const remote: Remote;
675
+
676
+ /** AssetDB 实例 */
677
+ const assetdb: MainProcess.AssetDB;
678
+
679
+ }
680
+
681
+ interface AssetInfo {
682
+ uuid?: string;
683
+ path?: string;
684
+ url?: string;
685
+ type?: string;
686
+ isSubAsset?: boolean;
687
+ assetType?: string;
688
+ id?: string;
689
+ name?: string;
690
+ subAssetTypes?: string;
691
+ }
692
+
693
+ declare module Editor.Project {
694
+ readonly let id: string;
695
+ readonly let name: string;
696
+ /** Absolute path for current open project. */
697
+ readonly let path: string;
698
+ }
699
+
700
+ declare module Editor.Builder {
701
+
702
+ /**
703
+ *
704
+ * @param eventName The name of the event
705
+ * @param callback The event callback
706
+ */
707
+ function on(eventName: string, callback: (options: BuildOptions, cb: Function) => void): void;
708
+
709
+ /**
710
+ *
711
+ * @param eventName The name of the event
712
+ * @param callback The event callback
713
+ */
714
+ function once(eventName: string, callback: (options: BuildOptions, cb: Function) => void): void;
715
+
716
+ /**
717
+ *
718
+ * @param eventName The name of the event
719
+ * @param callback The event callback
720
+ */
721
+ function removeListener(eventName: string, callback: Function): void;
722
+
723
+ }
724
+
725
+ declare module Editor.Scene {
726
+
727
+ /**
728
+ *
729
+ * @param packageName
730
+ * @param method
731
+ * @param cb
732
+ */
733
+ function callSceneScript(packageName: string, method: string, cb: (err: Error, msg: any) => void): void;
734
+
735
+ }
736
+
737
+ declare module Editor.Panel {
738
+
739
+ /**
740
+ * Open a panel via panelID.
741
+ * @param panelID The panel ID
742
+ * @param argv
743
+ */
744
+ function open(panelID: string, argv?: object): void;
745
+
746
+ /**
747
+ * Close a panel via panelID.
748
+ * @param panelID The panel ID
749
+ */
750
+ function close(panelID: string): void;
751
+
752
+ /**
753
+ * Find panel frame via panelID.
754
+ * @param panelID The panel ID
755
+ */
756
+ function find(panelID: string): void;
757
+
758
+ /**
759
+ * Extends a panel.
760
+ * @param proto
761
+ */
762
+ function extend(proto: object): void;
763
+
764
+ }
765
+
766
+ declare module Editor.Selection {
767
+
768
+ /**
769
+ * Select item with its id.
770
+ * @param type
771
+ * @param id
772
+ * @param unselectOthers
773
+ * @param confirm
774
+ */
775
+ function select(type: string, id: string, unselectOthers?: boolean, confirm?: boolean): void;
776
+
777
+ /**
778
+ * Unselect item with its id.
779
+ * @param type
780
+ * @param id
781
+ * @param confirm
782
+ */
783
+ function unselect(type: string, id: string, confirm?: boolean): void;
784
+
785
+ /**
786
+ * Hover item with its id. If id is null, it means hover out.
787
+ * @param type
788
+ * @param id
789
+ */
790
+ function hover(type: string, id: string): string;
791
+
792
+ /**
793
+ *
794
+ * @param type
795
+ */
796
+ function clear(type: string): void;
797
+
798
+ /**
799
+ *
800
+ * @param type
801
+ */
802
+ function curActivate(type: string): string[];
803
+
804
+ /**
805
+ *
806
+ * @param type
807
+ */
808
+ function curGlobalActivate(type: string): string[];
809
+
810
+ /**
811
+ *
812
+ * @param type
813
+ */
814
+ function curSelection(type: string): string[];
815
+
816
+ /**
817
+ *
818
+ * @param items
819
+ * @param mode 'top-level', 'deep' and 'name'
820
+ * @param func
821
+ */
822
+ function filter(items: string[], mode: string, func: Function): string[];
823
+
824
+ }
825
+
826
+ declare module Editor.Ipc {
827
+
828
+ /**
829
+ * Send message with ...args to main process asynchronously. It is possible to add a callback as the last or the 2nd last argument to receive replies from the IPC receiver.
830
+ * @param message Ipc message.
831
+ * @param args Whatever arguments the message needs.
832
+ * @param callback You can specify a callback function to receive IPC reply at the last or the 2nd last argument.
833
+ * @param timeout You can specify a timeout for the callback at the last argument. If no timeout specified, it will be 5000ms.
834
+ */
835
+ function sendToMain(message: string, ...args?: any, callback?: Function, timeout?: number): void;
836
+
837
+ /**
838
+ * Send message with ...args to panel defined in renderer process asynchronously. It is possible to add a callback as the last or the 2nd last argument to receive replies from the IPC receiver.
839
+ * @param panelID Panel ID.
840
+ * @param message Ipc message.
841
+ * @param args Whatever arguments the message needs.
842
+ * @param callback You can specify a callback function to receive IPC reply at the last or the 2nd last argument.
843
+ * @param timeout You can specify a timeout for the callback at the last argument. If no timeout specified, it will be 5000ms.
844
+ */
845
+ function sendToPanel(panelID: string, message: string, ...args?: any, callback?: Function, timeout?: number): void;
846
+
847
+ /**
848
+ * Send message with ...args to all opened window and to main process asynchronously.
849
+ * @param message Ipc message.
850
+ * @param args Whatever arguments the message needs.
851
+ * @param option You can indicate the last argument as an IPC option by Editor.Ipc.option({...}).
852
+ */
853
+ function sendToAll(message: string, ...args?: any, option?: object): void;
854
+
855
+ /**
856
+ * Send message with ...args to main process synchronized and return a result which is responded from main process.
857
+ * @param message Ipc message.
858
+ * @param args Whatever arguments the message needs.
859
+ */
860
+ function sendToMainSync(message: string, ...args?: any): void;
861
+
862
+ /**
863
+ * Send message with ...args to main process by package name and the short name of the message.
864
+ * @param pkgName Package name.
865
+ * @param message Ipc message.
866
+ * @param args Whatever arguments the message needs.
867
+ */
868
+ function sendToPackage(pkgName: string, message: string, ...args?: any): void;
869
+
870
+ }
871
+
872
+ declare module Editor.UI {
873
+
874
+ module Setting {
875
+
876
+ /**
877
+ * Control the default step for float point input element. Default is 0.1.
878
+ * @param value
879
+ */
880
+ function stepFloat(value: number): void;
881
+
882
+ /**
883
+ * Control the default step for integer input element. Default is 1.
884
+ * @param value
885
+ */
886
+ function stepInt(value: number): void;
887
+
888
+ /**
889
+ * Control the step when shift key press down. Default is 10.
890
+ * @param value
891
+ */
892
+ function shiftStep(value: number): void;
893
+
894
+ }
895
+
896
+ module DragDrop {
897
+
898
+ readonly let dragging: boolean;
899
+
900
+ function start(e: any, t: any): void;
901
+
902
+ function end(): void;
903
+
904
+ function updateDropEffect(e: any, t: any);
905
+
906
+ function type(e: any);
907
+
908
+ function filterFiles(e: any);
909
+
910
+ function items(dataTransfer: DataTransfer): AssetInfo[];
911
+
912
+ function getDragIcon(e: any);
913
+
914
+ function options(e: any);
915
+
916
+ function getLength(e: any): number;
917
+
918
+ }
919
+
920
+ }
921
+
922
+ declare module Editor.GizmosUtils {
923
+
924
+ function addMoveHandles(e, n, t);
925
+
926
+ function getCenter(e);
927
+
928
+ function getCenterWorldPos(n);
929
+
930
+ function getCenterWorldPos3D(e);
931
+
932
+ function getRecursiveNodes(e, t);
933
+
934
+ function getRecursiveWorldBounds3D(e);
935
+
936
+ function getWorldBounds3D(n);
937
+
938
+ function snapPixel(e);
939
+
940
+ function snapPixelWihVec2(e);
941
+
942
+ }
943
+
944
+ declare module Editor.Utils {
945
+
946
+ /**
947
+ * Uuid 工具
948
+ */
949
+ module UuidUtils {
950
+
951
+ /**
952
+ * 压缩后的 uuid 可以减小保存时的尺寸,但不能做为文件名(因为无法区分大小写并且包含非法字符)。
953
+ * 默认将 uuid 的后面 27 位压缩成 18 位,前 5 位保留下来,方便调试。
954
+ * 如果启用 min 则将 uuid 的后面 30 位压缩成 20 位,前 2 位保留不变。
955
+ * @param uuid
956
+ * @param min
957
+ */
958
+ function compressUuid(uuid: string, min?: boolean): string;
959
+
960
+ function compressHex(hexString: string, reservedHeadLength?: number): string;
961
+
962
+ function decompressUuid(str: string): string;
963
+
964
+ function isUuid(str: string): boolean;
965
+
966
+ function uuid(): string;
967
+
968
+ }
969
+
970
+ }
971
+
972
+ declare interface BuildOptions {
973
+ actualPlatform: string;
974
+ android: { packageName: string };
975
+ 'android-instant': {
976
+ REMOTE_SERVER_ROOT: string;
977
+ host: string;
978
+ packageName: string;
979
+ pathPattern: string;
980
+ recordPath: string;
981
+ scheme: string;
982
+ skipRecord: boolean;
983
+ }
984
+ apiLevel: string;
985
+ appABIs: string[];
986
+ appBundle: boolean;
987
+ buildPath: string;
988
+ buildScriptsOnly: boolean;
989
+ debug: string;
990
+ dest: string;
991
+ embedWebDebugger: boolean;
992
+ encryptJs: boolean;
993
+ excludeScenes: string[];
994
+ excludedModules: string[];
995
+ 'fb-instant-games': object;
996
+ inlineSpriteFrames: boolean;
997
+ inlineSpriteFrames_native: boolean;
998
+ ios: { packageName: string };
999
+ mac: { packageName: string };
1000
+ md5Cache: boolean;
1001
+ mergeStartScene: boolean;
1002
+ optimizeHotUpdate: boolean;
1003
+ orientation: {
1004
+ landscapeLeft: boolean;
1005
+ landscapeRight: boolean;
1006
+ portrait: boolean;
1007
+ upsideDown: boolean;
1008
+ };
1009
+ packageName: string;
1010
+ platform: string;
1011
+ previewHeight: number;
1012
+ previewWidth: number;
1013
+ scenes: string[];
1014
+ sourceMaps: boolean;
1015
+ startScene: string;
1016
+ template: string;
1017
+ title: string;
1018
+ useDebugKeystore: boolean;
1019
+ vsVersion: string;
1020
+ webOrientation: boolean;
1021
+ win32: object;
1022
+ xxteaKey: string;
1023
+ zipCompressJs: string;
1024
+ project: string;
1025
+ projectName: string;
1026
+ debugBuildWorker: boolean;
1027
+ bundles: bundle[];
1028
+ }
1029
+
1030
+ interface bundle {
1031
+ /** bundle 的根目录 */
1032
+ root: string;
1033
+ /** bundle 的输出目录 */
1034
+ dest: string;
1035
+ /** 脚本的输出目录 */
1036
+ scriptDest: string;
1037
+ /** bundle 的名称 */
1038
+ name: string;
1039
+ /** bundle 的优先级 */
1040
+ priority: number;
1041
+ /** bundle 中包含的场景 */
1042
+ scenes: string[];
1043
+ /** bundle 的压缩类型 */
1044
+ compressionType: 'subpackage' | 'normal' | 'none' | 'merge_all_json' | 'zip';
1045
+ /** bundle 所构建出来的所有资源 */
1046
+ buildResults: BuildResults;
1047
+ /** bundle 的版本信息,由 config 生成 */
1048
+ version: string;
1049
+ /** bundle 的 config.json 文件 */
1050
+ config: any;
1051
+ /** bundle 是否是远程包 */
1052
+ isRemote: boolean;
1053
+ }