stage-browser 0.1.0 → 0.2.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 (172) hide show
  1. package/README.md +92 -45
  2. package/build/icon.icns +0 -0
  3. package/build/icon.png +0 -0
  4. package/dist/bin/stage.js +111 -0
  5. package/dist/main/cli-args.js +28 -0
  6. package/dist/main/context-menu.js +68 -0
  7. package/dist/main/context.js +2 -0
  8. package/dist/main/extensions.js +78 -0
  9. package/dist/main/ipc.js +73 -0
  10. package/dist/main/main.js +282 -0
  11. package/dist/main/menu.js +140 -0
  12. package/dist/main/reveal.js +170 -0
  13. package/dist/main/selftest.js +570 -0
  14. package/dist/main/store.js +85 -0
  15. package/dist/main/suggest.js +43 -0
  16. package/dist/main/tabs.js +324 -0
  17. package/dist/main/ui-window.js +133 -0
  18. package/dist/main/url.js +38 -0
  19. package/dist/main/window.js +133 -0
  20. package/dist/preload/extension-compat.js +163 -0
  21. package/dist/preload/ui-preload.js +34 -0
  22. package/dist/shared/contract.js +6 -0
  23. package/dist/ui/app.js +692 -0
  24. package/{src → dist}/ui/index.html +15 -5
  25. package/dist/ui/mock.js +500 -0
  26. package/{src → dist}/ui/styles.css +55 -14
  27. package/node_modules/@types/chrome/LICENSE +21 -0
  28. package/node_modules/@types/chrome/README.md +15 -0
  29. package/node_modules/@types/chrome/chrome-cast/index.d.ts +1156 -0
  30. package/node_modules/@types/chrome/har-format/index.d.ts +6 -0
  31. package/node_modules/@types/chrome/index.d.ts +13786 -0
  32. package/node_modules/@types/chrome/package.json +99 -0
  33. package/node_modules/@types/filesystem/LICENSE +21 -0
  34. package/node_modules/@types/filesystem/README.md +15 -0
  35. package/node_modules/@types/filesystem/index.d.ts +564 -0
  36. package/node_modules/@types/filesystem/package.json +26 -0
  37. package/node_modules/@types/filewriter/LICENSE +21 -0
  38. package/node_modules/@types/filewriter/README.md +15 -0
  39. package/node_modules/@types/filewriter/index.d.ts +166 -0
  40. package/node_modules/@types/filewriter/package.json +25 -0
  41. package/node_modules/@types/har-format/LICENSE +21 -0
  42. package/node_modules/@types/har-format/README.md +15 -0
  43. package/node_modules/@types/har-format/index.d.ts +938 -0
  44. package/node_modules/@types/har-format/package.json +31 -0
  45. package/node_modules/adm-zip/LICENSE +21 -0
  46. package/node_modules/adm-zip/README.md +90 -0
  47. package/node_modules/adm-zip/adm-zip.js +1020 -0
  48. package/node_modules/adm-zip/headers/entryHeader.js +396 -0
  49. package/node_modules/adm-zip/headers/index.js +2 -0
  50. package/node_modules/adm-zip/headers/mainHeader.js +177 -0
  51. package/node_modules/adm-zip/methods/deflater.js +33 -0
  52. package/node_modules/adm-zip/methods/index.js +3 -0
  53. package/node_modules/adm-zip/methods/inflater.js +64 -0
  54. package/node_modules/adm-zip/methods/zipcrypto.js +175 -0
  55. package/node_modules/adm-zip/package.json +56 -0
  56. package/node_modules/adm-zip/types.d.ts +223 -0
  57. package/node_modules/adm-zip/util/constants.js +142 -0
  58. package/node_modules/adm-zip/util/decoder.js +5 -0
  59. package/node_modules/adm-zip/util/errors.js +66 -0
  60. package/node_modules/adm-zip/util/fattr.js +76 -0
  61. package/node_modules/adm-zip/util/index.js +5 -0
  62. package/node_modules/adm-zip/util/utils.js +481 -0
  63. package/node_modules/adm-zip/zipEntry.js +415 -0
  64. package/node_modules/adm-zip/zipFile.js +466 -0
  65. package/node_modules/debug/LICENSE +20 -0
  66. package/node_modules/debug/README.md +481 -0
  67. package/node_modules/debug/package.json +64 -0
  68. package/node_modules/debug/src/browser.js +272 -0
  69. package/node_modules/debug/src/common.js +292 -0
  70. package/node_modules/debug/src/index.js +10 -0
  71. package/node_modules/debug/src/node.js +263 -0
  72. package/node_modules/electron-chrome-web-store/README.md +143 -0
  73. package/node_modules/electron-chrome-web-store/dist/chrome-web-store.preload.js +299 -0
  74. package/node_modules/electron-chrome-web-store/dist/cjs/browser/index.js +1674 -0
  75. package/node_modules/electron-chrome-web-store/dist/esm/browser/index.mjs +950 -0
  76. package/node_modules/electron-chrome-web-store/dist/types/browser/api.d.ts +2 -0
  77. package/node_modules/electron-chrome-web-store/dist/types/browser/crx3.d.ts +20 -0
  78. package/node_modules/electron-chrome-web-store/dist/types/browser/id.d.ts +9 -0
  79. package/node_modules/electron-chrome-web-store/dist/types/browser/index.d.ts +62 -0
  80. package/node_modules/electron-chrome-web-store/dist/types/browser/installer.d.ts +29 -0
  81. package/node_modules/electron-chrome-web-store/dist/types/browser/loader.d.ts +18 -0
  82. package/node_modules/electron-chrome-web-store/dist/types/browser/types.d.ts +21 -0
  83. package/node_modules/electron-chrome-web-store/dist/types/browser/updater.d.ts +6 -0
  84. package/node_modules/electron-chrome-web-store/dist/types/browser/utils.d.ts +4 -0
  85. package/node_modules/electron-chrome-web-store/dist/types/common/constants.d.ts +44 -0
  86. package/node_modules/electron-chrome-web-store/dist/types/renderer/chrome-web-store.preload.d.ts +1 -0
  87. package/node_modules/electron-chrome-web-store/package.json +43 -0
  88. package/node_modules/ms/index.js +162 -0
  89. package/node_modules/ms/license.md +21 -0
  90. package/node_modules/ms/package.json +38 -0
  91. package/node_modules/ms/readme.md +59 -0
  92. package/node_modules/pbf/LICENSE +27 -0
  93. package/node_modules/pbf/README.md +293 -0
  94. package/node_modules/pbf/bin/pbf +17 -0
  95. package/node_modules/pbf/compile.js +441 -0
  96. package/node_modules/pbf/dist/pbf-dev.js +838 -0
  97. package/node_modules/pbf/dist/pbf.js +1 -0
  98. package/node_modules/pbf/index.d.ts +206 -0
  99. package/node_modules/pbf/index.js +830 -0
  100. package/node_modules/pbf/package.json +63 -0
  101. package/node_modules/protocol-buffers-schema/.travis.yml +7 -0
  102. package/node_modules/protocol-buffers-schema/LICENSE +21 -0
  103. package/node_modules/protocol-buffers-schema/README.md +122 -0
  104. package/node_modules/protocol-buffers-schema/example.js +11 -0
  105. package/node_modules/protocol-buffers-schema/example.proto +13 -0
  106. package/node_modules/protocol-buffers-schema/index.js +6 -0
  107. package/node_modules/protocol-buffers-schema/package.json +31 -0
  108. package/node_modules/protocol-buffers-schema/parse.js +769 -0
  109. package/node_modules/protocol-buffers-schema/stringify.js +206 -0
  110. package/node_modules/protocol-buffers-schema/test/fixtures/basic.json +90 -0
  111. package/node_modules/protocol-buffers-schema/test/fixtures/basic.proto +11 -0
  112. package/node_modules/protocol-buffers-schema/test/fixtures/comments.json +99 -0
  113. package/node_modules/protocol-buffers-schema/test/fixtures/comments.proto +19 -0
  114. package/node_modules/protocol-buffers-schema/test/fixtures/complex.json +125 -0
  115. package/node_modules/protocol-buffers-schema/test/fixtures/complex.proto +30 -0
  116. package/node_modules/protocol-buffers-schema/test/fixtures/enum.json +42 -0
  117. package/node_modules/protocol-buffers-schema/test/fixtures/enum.proto +8 -0
  118. package/node_modules/protocol-buffers-schema/test/fixtures/escaped-quotes.json +32 -0
  119. package/node_modules/protocol-buffers-schema/test/fixtures/escaped-quotes.proto +3 -0
  120. package/node_modules/protocol-buffers-schema/test/fixtures/extend.json +167 -0
  121. package/node_modules/protocol-buffers-schema/test/fixtures/extend.proto +19 -0
  122. package/node_modules/protocol-buffers-schema/test/fixtures/import.json +30 -0
  123. package/node_modules/protocol-buffers-schema/test/fixtures/import.proto +6 -0
  124. package/node_modules/protocol-buffers-schema/test/fixtures/map.json +33 -0
  125. package/node_modules/protocol-buffers-schema/test/fixtures/map.proto +3 -0
  126. package/node_modules/protocol-buffers-schema/test/fixtures/no-tags.proto +8 -0
  127. package/node_modules/protocol-buffers-schema/test/fixtures/oneof.json +41 -0
  128. package/node_modules/protocol-buffers-schema/test/fixtures/oneof.proto +6 -0
  129. package/node_modules/protocol-buffers-schema/test/fixtures/option.json +364 -0
  130. package/node_modules/protocol-buffers-schema/test/fixtures/option.proto +72 -0
  131. package/node_modules/protocol-buffers-schema/test/fixtures/options.json +47 -0
  132. package/node_modules/protocol-buffers-schema/test/fixtures/options.proto +8 -0
  133. package/node_modules/protocol-buffers-schema/test/fixtures/pheromon-trajectories.proto +8 -0
  134. package/node_modules/protocol-buffers-schema/test/fixtures/reserved.json +55 -0
  135. package/node_modules/protocol-buffers-schema/test/fixtures/reserved.proto +17 -0
  136. package/node_modules/protocol-buffers-schema/test/fixtures/search.json +30 -0
  137. package/node_modules/protocol-buffers-schema/test/fixtures/search.proto +5 -0
  138. package/node_modules/protocol-buffers-schema/test/fixtures/service.json +108 -0
  139. package/node_modules/protocol-buffers-schema/test/fixtures/service.proto +30 -0
  140. package/node_modules/protocol-buffers-schema/test/fixtures/valid-packed.proto +35 -0
  141. package/node_modules/protocol-buffers-schema/test/fixtures/version.json +90 -0
  142. package/node_modules/protocol-buffers-schema/test/fixtures/version.proto +13 -0
  143. package/node_modules/protocol-buffers-schema/test/index.js +157 -0
  144. package/node_modules/protocol-buffers-schema/tokenize.js +56 -0
  145. package/node_modules/resolve-protobuf-schema/.travis.yml +3 -0
  146. package/node_modules/resolve-protobuf-schema/LICENSE +21 -0
  147. package/node_modules/resolve-protobuf-schema/README.md +49 -0
  148. package/node_modules/resolve-protobuf-schema/index.js +50 -0
  149. package/node_modules/resolve-protobuf-schema/package.json +25 -0
  150. package/node_modules/resolve-protobuf-schema/test/a.proto +5 -0
  151. package/node_modules/resolve-protobuf-schema/test/b.proto +5 -0
  152. package/node_modules/resolve-protobuf-schema/test/c.proto +3 -0
  153. package/node_modules/resolve-protobuf-schema/test/index.js +49 -0
  154. package/package.json +35 -11
  155. package/bin/stage.js +0 -52
  156. package/src/main/cli-args.js +0 -28
  157. package/src/main/context-menu.js +0 -64
  158. package/src/main/extensions.js +0 -61
  159. package/src/main/main.js +0 -310
  160. package/src/main/menu.js +0 -171
  161. package/src/main/reveal.js +0 -141
  162. package/src/main/selftest.js +0 -383
  163. package/src/main/store.js +0 -77
  164. package/src/main/suggest.js +0 -50
  165. package/src/main/tabs.js +0 -351
  166. package/src/main/url.js +0 -37
  167. package/src/main/window.js +0 -71
  168. package/src/preload/extension-compat.js +0 -34
  169. package/src/preload/ui-preload.js +0 -40
  170. package/src/ui/app.js +0 -588
  171. package/src/ui/mock.js +0 -455
  172. /package/{src → dist}/ui/newtab.html +0 -0
@@ -0,0 +1,564 @@
1
+ /// <reference types="filewriter" />
2
+
3
+ interface LocalFileSystem {
4
+ /**
5
+ * Used for storage with no guarantee of persistence.
6
+ */
7
+ TEMPORARY: number;
8
+
9
+ /**
10
+ * Used for storage that should not be removed by the user agent without application or user permission.
11
+ */
12
+ PERSISTENT: number;
13
+
14
+ /**
15
+ * Requests a filesystem in which to store application data.
16
+ * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
17
+ * @param size This is an indicator of how much storage space, in bytes, the application expects to need.
18
+ * @param successCallback The callback that is called when the user agent provides a filesystem.
19
+ * @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
20
+ */
21
+ requestFileSystem(
22
+ type: number,
23
+ size: number,
24
+ successCallback: FileSystemCallback,
25
+ errorCallback?: ErrorCallback,
26
+ ): void;
27
+
28
+ /**
29
+ * Allows the user to look up the Entry for a file or directory referred to by a local URL.
30
+ * @param url A URL referring to a local file in a filesystem accessable via this API.
31
+ * @param successCallback A callback that is called to report the Entry to which the supplied URL refers.
32
+ * @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied.
33
+ */
34
+ resolveLocalFileSystemURL(url: string, successCallback: EntryCallback, errorCallback?: ErrorCallback): void;
35
+
36
+ /**
37
+ * see requestFileSystem.
38
+ */
39
+ webkitRequestFileSystem(
40
+ type: number,
41
+ size: number,
42
+ successCallback: FileSystemCallback,
43
+ errorCallback?: ErrorCallback,
44
+ ): void;
45
+ }
46
+
47
+ interface LocalFileSystemSync {
48
+ /**
49
+ * Used for storage with no guarantee of persistence.
50
+ */
51
+ TEMPORARY: number;
52
+
53
+ /**
54
+ * Used for storage that should not be removed by the user agent without application or user permission.
55
+ */
56
+ PERSISTENT: number;
57
+
58
+ /**
59
+ * Requests a filesystem in which to store application data.
60
+ * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
61
+ * @param size This is an indicator of how much storage space, in bytes, the application expects to need.
62
+ */
63
+ requestFileSystemSync(type: number, size: number): FileSystemSync;
64
+
65
+ /**
66
+ * Allows the user to look up the Entry for a file or directory referred to by a local URL.
67
+ * @param url A URL referring to a local file in a filesystem accessable via this API.
68
+ */
69
+ resolveLocalFileSystemSyncURL(url: string): EntrySync;
70
+
71
+ /**
72
+ * see requestFileSystemSync
73
+ */
74
+ webkitRequestFileSystemSync(type: number, size: number): FileSystemSync;
75
+ }
76
+
77
+ interface Metadata {
78
+ /**
79
+ * This is the time at which the file or directory was last modified.
80
+ */
81
+ modificationTime: Date;
82
+
83
+ /**
84
+ * The size of the file, in bytes. This must return 0 for directories.
85
+ */
86
+ size: number;
87
+ }
88
+
89
+ interface Flags {
90
+ /**
91
+ * Used to indicate that the user wants to create a file or directory if it was not previously there.
92
+ */
93
+ create?: boolean | undefined;
94
+
95
+ /**
96
+ * By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists.
97
+ */
98
+ exclusive?: boolean | undefined;
99
+ }
100
+
101
+ /**
102
+ * This interface represents a file system.
103
+ */
104
+ interface FileSystem {
105
+ /**
106
+ * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
107
+ */
108
+ readonly name: string;
109
+
110
+ /**
111
+ * The root directory of the file system.
112
+ */
113
+ readonly root: FileSystemDirectoryEntry;
114
+ }
115
+
116
+ interface FileSystemEntry {
117
+ /**
118
+ * Entry is a file.
119
+ */
120
+ readonly isFile: boolean;
121
+
122
+ /**
123
+ * Entry is a directory.
124
+ */
125
+ readonly isDirectory: boolean;
126
+
127
+ /**
128
+ * Look up metadata about this entry.
129
+ * @param successCallback A callback that is called with the time of the last modification.
130
+ * @param errorCallback ErrorCallback A callback that is called when errors happen.
131
+ */
132
+ getMetadata(successCallback: MetadataCallback, errorCallback?: ErrorCallback): void;
133
+
134
+ /**
135
+ * The name of the entry, excluding the path leading to it.
136
+ */
137
+ readonly name: string;
138
+
139
+ /**
140
+ * The full absolute path from the root to the entry.
141
+ */
142
+ readonly fullPath: string;
143
+
144
+ /**
145
+ * The file system on which the entry resides.
146
+ */
147
+ readonly filesystem: FileSystem;
148
+
149
+ /**
150
+ * Move an entry to a different location on the file system. It is an error to try to:
151
+ *
152
+ * <ui>
153
+ * <li>move a directory inside itself or to any child at any depth;</li>
154
+ * <li>move an entry into its parent if a name different from its current one isn't provided;</li>
155
+ * <li>move a file to a path occupied by a directory;</li>
156
+ * <li>move a directory to a path occupied by a file;</li>
157
+ * <li>move any element to a path occupied by a directory which is not empty.</li>
158
+ * <ul>
159
+ *
160
+ * A move of a file on top of an existing file must attempt to delete and replace that file.
161
+ * A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
162
+ */
163
+ moveTo(
164
+ parent: FileSystemDirectoryEntry,
165
+ newName?: string,
166
+ successCallback?: EntryCallback,
167
+ errorCallback?: ErrorCallback,
168
+ ): void;
169
+
170
+ /**
171
+ * Copy an entry to a different location on the file system. It is an error to try to:
172
+ *
173
+ * <ul>
174
+ * <li> copy a directory inside itself or to any child at any depth;</li>
175
+ * <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
176
+ * <li> copy a file to a path occupied by a directory;</li>
177
+ * <li> copy a directory to a path occupied by a file;</li>
178
+ * <li> copy any element to a path occupied by a directory which is not empty.</li>
179
+ * <li> A copy of a file on top of an existing file must attempt to delete and replace that file.</li>
180
+ * <li> A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.</li>
181
+ * </ul>
182
+ *
183
+ * Directory copies are always recursive--that is, they copy all contents of the directory.
184
+ */
185
+ copyTo(
186
+ parent: FileSystemDirectoryEntry,
187
+ newName?: string,
188
+ successCallback?: EntryCallback,
189
+ errorCallback?: ErrorCallback,
190
+ ): void;
191
+
192
+ /**
193
+ * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
194
+ */
195
+ toURL(mimeType?: string): string;
196
+
197
+ /**
198
+ * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
199
+ * @param successCallback A callback that is called on success.
200
+ * @param errorCallback A callback that is called when errors happen.
201
+ */
202
+ remove(successCallback: VoidCallback, errorCallback?: ErrorCallback): void;
203
+
204
+ /**
205
+ * Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
206
+ * @param successCallback A callback that is called to return the parent Entry.
207
+ * @param errorCallback A callback that is called when errors happen.
208
+ */
209
+ getParent(successCallback: DirectoryEntryCallback, errorCallback?: ErrorCallback): void;
210
+ }
211
+
212
+ /** Alias provided for backward compatibility */
213
+ type Entry = FileSystemEntry;
214
+
215
+ /**
216
+ * This interface represents a directory on a file system.
217
+ */
218
+ interface FileSystemDirectoryEntry extends FileSystemEntry {
219
+ /**
220
+ * Creates a new DirectoryReader to read Entries from this Directory.
221
+ */
222
+ createReader(): DirectoryReader;
223
+
224
+ /**
225
+ * Creates or looks up a file.
226
+ * @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
227
+ * @param options
228
+ * <ul>
229
+ * <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li>
230
+ * <li>If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
231
+ * <li>If create is not true and the path doesn't exist, getFile must fail.</li>
232
+ * <li>If create is not true and the path exists, but is a directory, getFile must fail.</li>
233
+ * <li>Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.</li>
234
+ * </ul>
235
+ * @param successCallback A callback that is called to return the File selected or created.
236
+ * @param errorCallback A callback that is called when errors happen.
237
+ */
238
+ getFile(path: string, options?: Flags, successCallback?: FileEntryCallback, errorCallback?: ErrorCallback): void;
239
+
240
+ /**
241
+ * Creates or looks up a directory.
242
+ * @param path Either an absolute path or a relative path from this DirectoryEntry to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
243
+ * @param options
244
+ * <ul>
245
+ * <li>If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
246
+ * <li>If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
247
+ * <li>If create is not true and the path doesn't exist, getDirectory must fail.</li>
248
+ * <li>If create is not true and the path exists, but is a file, getDirectory must fail.</li>
249
+ * <li>Otherwise, if no other error occurs, getDirectory must return a DirectoryEntry corresponding to path.</li>
250
+ * </ul>
251
+ * @param successCallback A callback that is called to return the DirectoryEntry selected or created.
252
+ * @param errorCallback A callback that is called when errors happen.
253
+ */
254
+ getDirectory(
255
+ path: string,
256
+ options?: Flags,
257
+ successCallback?: DirectoryEntryCallback,
258
+ errorCallback?: ErrorCallback,
259
+ ): void;
260
+
261
+ /**
262
+ * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
263
+ * @param successCallback A callback that is called on success.
264
+ * @param errorCallback A callback that is called when errors happen.
265
+ */
266
+ removeRecursively(successCallback: VoidCallback, errorCallback?: ErrorCallback): void;
267
+ }
268
+
269
+ /** Alias provided for backward compatibility */
270
+ type DirectoryEntry = FileSystemDirectoryEntry;
271
+
272
+ /**
273
+ * This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
274
+ * <ul>
275
+ * <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
276
+ * <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
277
+ * <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
278
+ * <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
279
+ * </ul>
280
+ */
281
+ interface DirectoryReader {
282
+ /**
283
+ * Read the next block of entries from this directory.
284
+ * @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument.
285
+ * @param errorCallback A callback indicating that there was an error reading from the Directory.
286
+ */
287
+ readEntries(successCallback: EntriesCallback, errorCallback?: ErrorCallback): void;
288
+ }
289
+
290
+ /**
291
+ * This interface represents a file on a file system.
292
+ */
293
+ interface FileEntry extends FileSystemEntry {
294
+ /**
295
+ * Creates a new FileWriter associated with the file that this FileEntry represents.
296
+ * @param successCallback A callback that is called with the new FileWriter.
297
+ * @param errorCallback A callback that is called when errors happen.
298
+ */
299
+ createWriter(successCallback: FileWriterCallback, errorCallback?: ErrorCallback): void;
300
+
301
+ /**
302
+ * Returns a File that represents the current state of the file that this FileEntry represents.
303
+ * @param successCallback A callback that is called with the File.
304
+ * @param errorCallback A callback that is called when errors happen.
305
+ */
306
+ file(successCallback: FileCallback, errorCallback?: ErrorCallback): void;
307
+ }
308
+
309
+ /**
310
+ * When requestFileSystem() succeeds, the following callback is made.
311
+ */
312
+ interface FileSystemCallback {
313
+ /**
314
+ * @param filesystem The file systems to which the app is granted access.
315
+ */
316
+ (filesystem: FileSystem): void;
317
+ }
318
+
319
+ /**
320
+ * This interface is the callback used to look up Entry objects.
321
+ */
322
+ interface EntryCallback {
323
+ /**
324
+ * @param entry
325
+ */
326
+ (entry: FileSystemEntry): void;
327
+ }
328
+
329
+ /**
330
+ * This interface is the callback used to look up FileEntry objects.
331
+ */
332
+ interface FileEntryCallback {
333
+ /**
334
+ * @param entry
335
+ */
336
+ (entry: FileEntry): void;
337
+ }
338
+
339
+ /**
340
+ * This interface is the callback used to look up DirectoryEntry objects.
341
+ */
342
+ interface DirectoryEntryCallback {
343
+ /**
344
+ * @param entry
345
+ */
346
+ (entry: FileSystemDirectoryEntry): void;
347
+ }
348
+
349
+ /**
350
+ * When readEntries() succeeds, the following callback is made.
351
+ */
352
+ interface EntriesCallback {
353
+ (entries: FileSystemEntry[]): void;
354
+ }
355
+
356
+ /**
357
+ * This interface is the callback used to look up file and directory metadata.
358
+ */
359
+ interface MetadataCallback {
360
+ (metadata: Metadata): void;
361
+ }
362
+
363
+ /**
364
+ * This interface is the callback used to create a FileWriter.
365
+ */
366
+ interface FileWriterCallback {
367
+ (fileWriter: FileWriter): void;
368
+ }
369
+
370
+ /**
371
+ * This interface is the callback used to obtain a File.
372
+ */
373
+ interface FileCallback {
374
+ (file: File): void;
375
+ }
376
+
377
+ /**
378
+ * This interface is the generic callback used to indicate success of an asynchronous method.
379
+ */
380
+ interface VoidCallback {
381
+ (): void;
382
+ }
383
+
384
+ /**
385
+ * When an error occurs, the following callback is made.
386
+ */
387
+ interface ErrorCallback {
388
+ (err: Error): void;
389
+ }
390
+
391
+ /**
392
+ * This interface represents a file system.
393
+ */
394
+ interface FileSystemSync {
395
+ /**
396
+ * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
397
+ */
398
+ name: string;
399
+
400
+ /**
401
+ * root The root directory of the file system.
402
+ */
403
+ root: DirectoryEntrySync;
404
+ }
405
+
406
+ /**
407
+ * An abstract interface representing entries in a file system, each of which may be a FileEntrySync or DirectoryEntrySync.
408
+ */
409
+ interface EntrySync {
410
+ /**
411
+ * EntrySync is a file.
412
+ */
413
+ isFile: boolean;
414
+
415
+ /**
416
+ * EntrySync is a directory.
417
+ */
418
+ isDirectory: boolean;
419
+
420
+ /**
421
+ * Look up metadata about this entry.
422
+ */
423
+ getMetadata(): Metadata;
424
+
425
+ /**
426
+ * The name of the entry, excluding the path leading to it.
427
+ */
428
+ name: string;
429
+
430
+ /**
431
+ * The full absolute path from the root to the entry.
432
+ */
433
+ fullPath: string;
434
+
435
+ /**
436
+ * The file system on which the entry resides.
437
+ */
438
+ filesystem: FileSystemSync;
439
+
440
+ /**
441
+ * Move an entry to a different location on the file system. It is an error to try to:
442
+ * <ul>
443
+ * <li> move a directory inside itself or to any child at any depth;</li>
444
+ * <li> move an entry into its parent if a name different from its current one isn't provided;</li>
445
+ * <li> move a file to a path occupied by a directory;</li>
446
+ * <li> move a directory to a path occupied by a file;</li>
447
+ * <li> move any element to a path occupied by a directory which is not empty.</li>
448
+ * </ui>
449
+ * A move of a file on top of an existing file must attempt to delete and replace that file. A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
450
+ * @param parent The directory to which to move the entry.
451
+ * @param newName The new name of the entry. Defaults to the EntrySync's current name if unspecified.
452
+ */
453
+ moveTo(parent: DirectoryEntrySync, newName?: string): EntrySync;
454
+
455
+ /**
456
+ * Copy an entry to a different location on the file system. It is an error to try to:
457
+ * <ul>
458
+ * <li> copy a directory inside itself or to any child at any depth;</li>
459
+ * <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
460
+ * <li> copy a file to a path occupied by a directory;</li>
461
+ * <li> copy a directory to a path occupied by a file;</li>
462
+ * <li> copy any element to a path occupied by a directory which is not empty.</li>
463
+ * </ui>
464
+ * A copy of a file on top of an existing file must attempt to delete and replace that file.
465
+ * A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
466
+ * Directory copies are always recursive--that is, they copy all contents of the directory.
467
+ */
468
+ copyTo(parent: DirectoryEntrySync, newName?: string): EntrySync;
469
+
470
+ /**
471
+ * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
472
+ */
473
+ toURL(): string;
474
+
475
+ /**
476
+ * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
477
+ */
478
+ remove(): void;
479
+
480
+ /**
481
+ * Look up the parent DirectoryEntrySync containing this Entry. If this EntrySync is the root of its filesystem, its parent is itself.
482
+ */
483
+ getParent(): DirectoryEntrySync;
484
+ }
485
+
486
+ /**
487
+ * This interface represents a directory on a file system.
488
+ */
489
+ interface DirectoryEntrySync extends EntrySync {
490
+ /**
491
+ * Creates a new DirectoryReaderSync to read EntrySyncs from this DirectorySync.
492
+ */
493
+ createReader(): DirectoryReaderSync;
494
+
495
+ /**
496
+ * Creates or looks up a directory.
497
+ * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
498
+ * @param options
499
+ * <ul>
500
+ * <li> If create and exclusive are both true and the path already exists, getFile must fail.</li>
501
+ * <li> If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
502
+ * <li> If create is not true and the path doesn't exist, getFile must fail.</li>
503
+ * <li> If create is not true and the path exists, but is a directory, getFile must fail.</li>
504
+ * <li> Otherwise, if no other error occurs, getFile must return a FileEntrySync corresponding to path.</li>
505
+ * </ul>
506
+ */
507
+ getFile(path: string, options?: Flags): FileEntrySync;
508
+
509
+ /**
510
+ * Creates or looks up a directory.
511
+ * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
512
+ * @param options
513
+ * <ul>
514
+ * <li> If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
515
+ * <li> If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
516
+ * <li> If create is not true and the path doesn't exist, getDirectory must fail.</li>
517
+ * <li> If create is not true and the path exists, but is a file, getDirectory must fail.</li>
518
+ * <li> Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path.</li>
519
+ * </ul>
520
+ */
521
+ getDirectory(path: string, options?: Flags): DirectoryEntrySync;
522
+
523
+ /**
524
+ * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
525
+ */
526
+ removeRecursively(): void;
527
+ }
528
+
529
+ /**
530
+ * This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
531
+ * <ul>
532
+ * <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
533
+ * <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
534
+ * <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
535
+ * <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
536
+ * </ul>
537
+ */
538
+ interface DirectoryReaderSync {
539
+ /**
540
+ * Read the next block of entries from this directory.
541
+ */
542
+ readEntries(): EntrySync[];
543
+ }
544
+
545
+ /**
546
+ * This interface represents a file on a file system.
547
+ */
548
+ interface FileEntrySync extends EntrySync {
549
+ /**
550
+ * Creates a new FileWriterSync associated with the file that this FileEntrySync represents.
551
+ */
552
+ createWriter(): FileWriterSync;
553
+
554
+ /**
555
+ * Returns a File that represents the current state of the file that this FileEntrySync represents.
556
+ */
557
+ file(): File;
558
+ }
559
+
560
+ interface Window extends LocalFileSystem, LocalFileSystemSync {
561
+ }
562
+
563
+ interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync {
564
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@types/filesystem",
3
+ "version": "0.0.36",
4
+ "description": "TypeScript definitions for filesystem",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/filesystem",
6
+ "license": "MIT",
7
+ "contributors": [
8
+ {
9
+ "name": "Kon",
10
+ "url": "http://phyzkit.net/"
11
+ }
12
+ ],
13
+ "main": "",
14
+ "types": "index.d.ts",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
18
+ "directory": "types/filesystem"
19
+ },
20
+ "scripts": {},
21
+ "dependencies": {
22
+ "@types/filewriter": "*"
23
+ },
24
+ "typesPublisherContentHash": "df13d0739a4c80f9d834170c83eb0285fdd638e7e22ab9d000be34cf7cbfa73d",
25
+ "typeScriptVersion": "4.7"
26
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
@@ -0,0 +1,15 @@
1
+ # Installation
2
+ > `npm install --save @types/filewriter`
3
+
4
+ # Summary
5
+ This package contains type definitions for filewriter (http://www.w3.org/TR/file-writer-api/).
6
+
7
+ # Details
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/filewriter.
9
+
10
+ ### Additional Details
11
+ * Last updated: Tue, 30 Jan 2024 21:35:45 GMT
12
+ * Dependencies: none
13
+
14
+ # Credits
15
+ These definitions were written by [Kon](http://phyzkit.net/).