@pi-oxide/extension-js 0.6.0 → 0.8.1

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.
package/extension_js.d.ts CHANGED
@@ -148,6 +148,11 @@ export interface FsWriteParams {
148
148
  data: string;
149
149
  }
150
150
 
151
+ export interface FsWriteResult {
152
+ path: string;
153
+ bytes_written: number;
154
+ }
155
+
151
156
  export interface JsApiAlias {
152
157
  namespace: string;
153
158
  name: string;
@@ -268,9 +273,9 @@ export class ExtensionSession {
268
273
  * Generate API documentation for every registered public API.
269
274
  */
270
275
  apiDocs(format: string): string;
271
- fsAppend(params: FsWriteParams): Promise<FsBoolResult>;
272
- fsAppendBase64(params: FsWriteParams): Promise<FsBoolResult>;
273
- fsAppendText(params: FsWriteParams): Promise<FsBoolResult>;
276
+ fsAppend(params: FsWriteParams): Promise<FsWriteResult>;
277
+ fsAppendBase64(params: FsWriteParams): Promise<FsWriteResult>;
278
+ fsAppendText(params: FsWriteParams): Promise<FsWriteResult>;
274
279
  fsCopy(params: FsCopyParams): Promise<FsBoolResult>;
275
280
  fsDelete(params: FsPathParams): Promise<FsBoolResult>;
276
281
  fsExists(params: FsPathParams): Promise<FsExistsResult>;
@@ -284,9 +289,9 @@ export class ExtensionSession {
284
289
  fsReadText(params: FsPathParams): Promise<FsStringResult>;
285
290
  fsStat(params: FsPathParams): Promise<FsStatResult>;
286
291
  fsUpdate(params: FsReadRangeDataParams): Promise<FsBoolResult>;
287
- fsWrite(params: FsWriteParams): Promise<FsBoolResult>;
288
- fsWriteBase64(params: FsWriteParams): Promise<FsBoolResult>;
289
- fsWriteText(params: FsWriteParams): Promise<FsBoolResult>;
292
+ fsWrite(params: FsWriteParams): Promise<FsWriteResult>;
293
+ fsWriteBase64(params: FsWriteParams): Promise<FsWriteResult>;
294
+ fsWriteText(params: FsWriteParams): Promise<FsWriteResult>;
290
295
  /**
291
296
  * Inject async and sync API bindings from the doc registry into the JS environment.
292
297
  * Must be called after all manifest entries are registered.
@@ -327,6 +332,8 @@ export class ExtensionSession {
327
332
  stopWith(): void;
328
333
  }
329
334
 
335
+ export function clearVfsWriteCache(): void;
336
+
330
337
  export function collect_document(options: CollectOptions): TreeSnapshot;
331
338
 
332
339
  export function collect_element(root: Element, options: CollectOptions): TreeSnapshot;
@@ -350,6 +357,8 @@ export function registerSharedDispatch(callback: Function): void;
350
357
  */
351
358
  export function setLogLevel(level: number): void;
352
359
 
360
+ export function takeCachedVfsWriteBase64(path: string): string | undefined;
361
+
353
362
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
354
363
 
355
364
  export interface InitOutput {
@@ -384,12 +393,14 @@ export interface InitOutput {
384
393
  readonly extensionsession_setAborted: (a: number, b: number) => void;
385
394
  readonly extensionsession_set_fuel_limit: (a: number, b: number) => void;
386
395
  readonly extensionsession_stopWith: (a: number) => void;
396
+ readonly clearVfsWriteCache: () => void;
387
397
  readonly freezeManifest: () => [number, number];
388
398
  readonly importManifestEntries: (a: any) => [number, number];
389
399
  readonly main: () => void;
390
400
  readonly registerJsCall: (a: any, b: any) => [number, number];
391
401
  readonly registerJsCallBatch: (a: any) => [number, number];
392
402
  readonly registerSharedDispatch: (a: any) => [number, number];
403
+ readonly takeCachedVfsWriteBase64: (a: number, b: number) => [number, number];
393
404
  readonly setLogLevel: (a: number) => void;
394
405
  readonly collect_document: (a: any) => any;
395
406
  readonly collect_element: (a: any, b: any) => any;