@php-wasm/web 0.1.61 → 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.
- package/.htaccess +0 -4
- package/index.d.ts +5 -12
- package/index.js +276 -283
- package/lib/worker-thread/spawn-php-worker-thread.d.ts +1 -9
- package/package.json +6 -2
- package/php_5_6.js +15 -1
- package/php_5_6.wasm +0 -0
- package/php_7_0.js +15 -1
- package/php_7_0.wasm +0 -0
- package/php_7_1.js +15 -1
- package/php_7_1.wasm +0 -0
- package/php_7_2.js +15 -1
- package/php_7_2.wasm +0 -0
- package/php_7_3.js +15 -1
- package/php_7_3.wasm +0 -0
- package/php_7_4.js +16 -2
- package/php_7_4.wasm +0 -0
- package/php_8_0.js +16 -2
- package/php_8_0.wasm +0 -0
- package/php_8_1.js +16 -2
- package/php_8_1.wasm +0 -0
- package/php_8_2.js +15 -1
- package/php_8_2.wasm +0 -0
- package/README.md +0 -31
package/.htaccess
CHANGED
package/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare function consumeAPI<APIType>(remote: Worker | Window): RemoteAPI<
|
|
|
20
20
|
export type PublicAPI<Methods, PipedAPI = unknown> = RemoteAPI<Methods & PipedAPI>;
|
|
21
21
|
export declare function exposeAPI<Methods, PipedAPI>(apiMethods?: Methods, pipedApi?: PipedAPI): [
|
|
22
22
|
() => void,
|
|
23
|
+
(e: Error) => void,
|
|
23
24
|
PublicAPI<Methods, PipedAPI>
|
|
24
25
|
];
|
|
25
26
|
export interface PHPResponseData {
|
|
@@ -142,7 +143,7 @@ export interface RequestHandler {
|
|
|
142
143
|
* }
|
|
143
144
|
* })
|
|
144
145
|
* php.writeFile("/www/index.php", `<?php echo file_get_contents("php://input");`);
|
|
145
|
-
* const result = await php.
|
|
146
|
+
* const result = await php.request({
|
|
146
147
|
* method: "GET",
|
|
147
148
|
* headers: {
|
|
148
149
|
* "Content-Type": "text/plain"
|
|
@@ -380,7 +381,7 @@ export interface IsomorphicLocalPHP extends RequestHandler {
|
|
|
380
381
|
* post_message_to_js(string $data)
|
|
381
382
|
*
|
|
382
383
|
* Arguments:
|
|
383
|
-
* $data –
|
|
384
|
+
* $data (string) – Data to pass to JavaScript.
|
|
384
385
|
*
|
|
385
386
|
* @example
|
|
386
387
|
*
|
|
@@ -787,23 +788,15 @@ export declare function getPHPLoaderModule(version?: SupportedPHPVersion): Promi
|
|
|
787
788
|
* mismatched with the actual version, the service worker
|
|
788
789
|
* will be re-registered.
|
|
789
790
|
*/
|
|
790
|
-
export declare function registerServiceWorker<Client extends Remote<WebPHPEndpoint>>(phpApi: Client, scope: string, scriptUrl: string
|
|
791
|
+
export declare function registerServiceWorker<Client extends Remote<WebPHPEndpoint>>(phpApi: Client, scope: string, scriptUrl: string): Promise<void>;
|
|
791
792
|
export declare function parseWorkerStartupOptions<T extends Record<string, string>>(): T;
|
|
792
|
-
/**
|
|
793
|
-
* Recommended Worker Thread backend.
|
|
794
|
-
* It's typically "webworker", but in Firefox it's "iframe"
|
|
795
|
-
* because Firefox doesn't support module workers with dynamic imports.
|
|
796
|
-
* See https://github.com/mdn/content/issues/24402
|
|
797
|
-
*/
|
|
798
|
-
export declare const recommendedWorkerBackend: string;
|
|
799
793
|
/**
|
|
800
794
|
* Spawns a new Worker Thread.
|
|
801
795
|
*
|
|
802
796
|
* @param workerUrl The absolute URL of the worker script.
|
|
803
|
-
* @param workerBackend The Worker Thread backend to use. Either 'webworker' or 'iframe'.
|
|
804
797
|
* @param config
|
|
805
798
|
* @returns The spawned Worker Thread.
|
|
806
799
|
*/
|
|
807
|
-
export declare function spawnPHPWorkerThread(workerUrl: string,
|
|
800
|
+
export declare function spawnPHPWorkerThread(workerUrl: string, startupOptions?: Record<string, string>): Promise<Worker>;
|
|
808
801
|
|
|
809
802
|
export {};
|