@php-wasm/universal 0.5.1 → 0.5.3

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/lib/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export type { FileInfo, IsomorphicLocalPHP, IsomorphicRemotePHP, MessageListener, PHPOutput, PHPRunOptions, UniversalPHP, ListFilesOptions, RmDirOptions, PHPEvent, PHPEventListener, HTTPMethod, PHPRequest, PHPRequestHeaders, RequestHandler, SpawnHandler, } from './universal-php';
2
2
  export { UnhandledRejectionsTarget } from './wasm-error-reporting';
3
+ export type { IteratePhpFilesOptions as IterateFilesOptions } from './iterate-files';
4
+ export { iteratePhpFiles as iterateFiles } from './iterate-files';
5
+ export { writeFilesStreamToPhp } from './write-files-stream-to-php';
3
6
  export { PHPResponse } from './php-response';
4
7
  export type { PHPResponseData } from './php-response';
5
8
  export type { ErrnoError } from './rethrow-file-system-error';
@@ -0,0 +1,26 @@
1
+ import { UniversalPHP } from './universal-php';
2
+ export type IteratePhpFilesOptions = {
3
+ /**
4
+ * Should yield paths relative to the root directory?
5
+ * If false, all paths will be absolute.
6
+ */
7
+ relativePaths?: boolean;
8
+ /**
9
+ * A prefix to add to all paths.
10
+ * Only used if `relativePaths` is true.
11
+ */
12
+ pathPrefix?: string;
13
+ /**
14
+ * A list of paths to exclude from the results.
15
+ */
16
+ exceptPaths?: string[];
17
+ };
18
+ /**
19
+ * Iterates over all files in a php directory and its subdirectories.
20
+ *
21
+ * @param php - The PHP instance.
22
+ * @param root - The root directory to start iterating from.
23
+ * @param options - Optional configuration.
24
+ * @returns All files found in the tree.
25
+ */
26
+ export declare function iteratePhpFiles(php: UniversalPHP, root: string, { relativePaths, pathPrefix, exceptPaths, }?: IteratePhpFilesOptions): AsyncGenerator<File>;
@@ -10,4 +10,9 @@ export interface ErrnoError extends Error {
10
10
  errno: number;
11
11
  message: string;
12
12
  }
13
+ /**
14
+ * @see https://github.com/emscripten-core/emscripten/blob/38eedc630f17094b3202fd48ac0c2c585dbea31e/system/include/wasi/api.h#L336
15
+ */
16
+ export declare const FileErrorCodes: any;
17
+ export declare function getEmscriptenFsError(e: any): any;
13
18
  export declare function rethrowFileSystemError(messagePrefix?: string): (target: any, methodName: string, descriptor: PropertyDescriptor) => void;
@@ -0,0 +1,5 @@
1
+ import { UniversalPHP } from './universal-php';
2
+ /**
3
+ * Reads a file from PHP filesystem using a stream.
4
+ */
5
+ export declare function streamReadFileFromPHP(php: UniversalPHP, path: string): ReadableStream<any>;
@@ -0,0 +1,5 @@
1
+ import { UniversalPHP } from './universal-php';
2
+ /**
3
+ * Writes streamed files to PHP filesystem.
4
+ */
5
+ export declare function writeFilesStreamToPhp(php: UniversalPHP, root: string): WritableStream<File>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/universal",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "PHP.wasm – emscripten bindings for PHP",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,9 +36,9 @@
36
36
  "main": "./index.cjs",
37
37
  "module": "./index.js",
38
38
  "license": "GPL-2.0-or-later",
39
- "gitHead": "6c2256a8f3b6bafb2d9a5860f236b00832839769",
39
+ "gitHead": "3d0f04ee35f15e9a7906818352f6ccdd34f46fbe",
40
40
  "engines": {
41
- "node": ">=16.15.1",
41
+ "node": ">=18.18.2",
42
42
  "npm": ">=8.11.0"
43
43
  }
44
44
  }