@utoo/web 0.0.1-alpha.27 → 0.0.1-alpha.28

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.
@@ -14,10 +14,10 @@ self.addEventListener("message", (event) => {
14
14
  }
15
15
  });
16
16
  self.addEventListener("fetch", async (event) => {
17
+ await _promise;
17
18
  const { url, referrer } = event.request;
18
19
  if (new URL(url).pathname.startsWith(_serviceWorkerScope) ||
19
20
  (referrer && new URL(referrer).pathname.startsWith(_serviceWorkerScope))) {
20
- await _promise;
21
21
  const projectPath = "." + new URL(url).pathname.replace(_serviceWorkerScope, "");
22
22
  event.respondWith(readFileFromProject(projectPath));
23
23
  }
@@ -54,35 +54,22 @@ export class Project {
54
54
  __destroy_into_raw(): number;
55
55
  __wbg_ptr: number;
56
56
  free(): void;
57
- /**
58
- * @returns {string}
59
- */
60
- get cwd(): string;
61
- /**
62
- * @param {string} package_lock
63
- * @returns {Promise<void>}
64
- */
65
- install(package_lock: string): Promise<void>;
66
- /**
67
- * @returns {Promise<any>}
68
- */
69
- build(): Promise<any>;
70
57
  /**
71
58
  * @param {string} path
72
- * @returns {Promise<Uint8Array>}
59
+ * @returns {Promise<void>}
73
60
  */
74
- read(path: string): Promise<Uint8Array>;
61
+ createDir(path: string): Promise<void>;
75
62
  /**
76
63
  * @param {string} path
77
- * @returns {Promise<string>}
64
+ * @param {boolean} recursive
65
+ * @returns {Promise<void>}
78
66
  */
79
- readToString(path: string): Promise<string>;
67
+ removeDir(path: string, recursive: boolean): Promise<void>;
80
68
  /**
81
69
  * @param {string} path
82
- * @param {Uint8Array} content
83
70
  * @returns {Promise<void>}
84
71
  */
85
- write(path: string, content: Uint8Array): Promise<void>;
72
+ removeFile(path: string): Promise<void>;
86
73
  /**
87
74
  * @param {string} path
88
75
  * @param {string} content
@@ -91,41 +78,54 @@ export class Project {
91
78
  writeString(path: string, content: string): Promise<void>;
92
79
  /**
93
80
  * @param {string} path
94
- * @returns {Promise<DirEntry[]>}
81
+ * @returns {Promise<void>}
95
82
  */
96
- readDir(path: string): Promise<DirEntry[]>;
83
+ createDirAll(path: string): Promise<void>;
97
84
  /**
98
85
  * @param {string} path
99
- * @returns {Promise<void>}
86
+ * @returns {Promise<string>}
100
87
  */
101
- createDir(path: string): Promise<void>;
88
+ readToString(path: string): Promise<string>;
89
+ /**
90
+ * @returns {string}
91
+ */
92
+ get cwd(): string;
102
93
  /**
103
94
  * @param {string} path
104
- * @returns {Promise<void>}
95
+ * @returns {Promise<Uint8Array>}
105
96
  */
106
- createDirAll(path: string): Promise<void>;
97
+ read(path: string): Promise<Uint8Array>;
107
98
  /**
108
- * @param {string} src
109
- * @param {string} dst
110
- * @returns {Promise<void>}
99
+ * @returns {Promise<any>}
111
100
  */
112
- copyFile(src: string, dst: string): Promise<void>;
101
+ build(): Promise<any>;
113
102
  /**
114
103
  * @param {string} path
104
+ * @param {Uint8Array} content
115
105
  * @returns {Promise<void>}
116
106
  */
117
- removeFile(path: string): Promise<void>;
107
+ write(path: string, content: Uint8Array): Promise<void>;
118
108
  /**
119
- * @param {string} path
120
- * @param {boolean} recursive
109
+ * @param {string} package_lock
121
110
  * @returns {Promise<void>}
122
111
  */
123
- removeDir(path: string, recursive: boolean): Promise<void>;
112
+ install(package_lock: string): Promise<void>;
124
113
  /**
125
114
  * @param {string} path
126
115
  * @returns {Promise<Metadata>}
127
116
  */
128
117
  metadata(path: string): Promise<Metadata>;
118
+ /**
119
+ * @param {string} path
120
+ * @returns {Promise<DirEntry[]>}
121
+ */
122
+ readDir(path: string): Promise<DirEntry[]>;
123
+ /**
124
+ * @param {string} src
125
+ * @param {string} dst
126
+ * @returns {Promise<void>}
127
+ */
128
+ copyFile(src: string, dst: string): Promise<void>;
129
129
  }
130
130
  export default __wbg_init;
131
131
  export function initSync(module: any, memory: any): any;