@php-wasm/logger 0.9.37 → 0.9.39

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.
@@ -1,4 +1,4 @@
1
- import { UniversalPHP } from '../../universal';
1
+ import type { UniversalPHP } from '../types';
2
2
  import { Logger } from '../logger';
3
3
  /**
4
4
  * Collect PHP logs from the error_log file and log them.
package/lib/types.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ export interface UniversalPHP {
2
+ /**
3
+ * Read the content of a file as text.
4
+ *
5
+ * @param path The path to the file
6
+ * @returns string The content of the file
7
+ */
8
+ readFileAsText(path: string): Promise<string>;
9
+ /**
10
+ * Check if a file exists.
11
+ *
12
+ * @param path The path to the file
13
+ * @returns boolean Whether the file exists
14
+ */
15
+ fileExists(path: string): Promise<boolean>;
16
+ addEventListener(event: string, listener: (event: PHPRequestErrorEvent) => void): void;
17
+ }
18
+ export interface PHPRequestErrorEvent {
19
+ type: 'request.error';
20
+ error: Error;
21
+ source?: 'request' | 'php-wasm';
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/logger",
3
- "version": "0.9.37",
3
+ "version": "0.9.39",
4
4
  "description": "A logger for PHP-wasm clients like Playground and WP-now.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  "node": ">=18.18.0",
28
28
  "npm": ">=8.11.0"
29
29
  },
30
- "gitHead": "7bb24a2519a65bc8265b2c73f2f01dd67bf13204",
30
+ "gitHead": "cbb5ec6aeed54bebf0fd6503f207c93261b3e4ba",
31
31
  "dependencies": {
32
- "@php-wasm/node-polyfills": "0.9.37"
32
+ "@php-wasm/node-polyfills": "0.9.39"
33
33
  }
34
34
  }