@emnapi/core
Advanced tools
@@ -34,2 +34,26 @@ /// <reference types="node" /> | ||
| /** @public */ | ||
| export declare interface CleanupThreadPayload { | ||
| tid: number; | ||
| } | ||
| /** @public */ | ||
| export declare interface CommandInfo<T extends CommandType> { | ||
| type: T; | ||
| payload: CommandPayloadMap[T]; | ||
| } | ||
| /** @public */ | ||
| export declare interface CommandPayloadMap { | ||
| load: LoadPayload; | ||
| loaded: LoadedPayload; | ||
| start: StartPayload; | ||
| 'cleanup-thread': CleanupThreadPayload; | ||
| 'terminate-all-threads': TerminateAllThreadsPayload; | ||
| 'spawn-thread': SpawnThreadPayload; | ||
| } | ||
| /** @public */ | ||
| export declare type CommandType = keyof CommandPayloadMap; | ||
| /** @public */ | ||
| export declare function createInstanceProxy(instance: WebAssembly.Instance, memory?: WebAssembly.Memory | (() => WebAssembly.Memory)): WebAssembly.Instance; | ||
@@ -90,2 +114,6 @@ | ||
| /** @public */ | ||
| export declare interface LoadedPayload { | ||
| } | ||
| /** @public */ | ||
| export declare interface LoadedSource extends WebAssembly.WebAssemblyInstantiatedSource { | ||
@@ -112,2 +140,3 @@ usedInstance: WebAssembly.Instance; | ||
| /** @public */ | ||
| export declare interface LoadPayload { | ||
@@ -137,2 +166,7 @@ wasmModule: WebAssembly.Module; | ||
| /** @public */ | ||
| export declare interface MessageEventData<T extends CommandType> { | ||
| __emnapi__: CommandInfo<T>; | ||
| } | ||
| /** @public */ | ||
| export declare class MessageHandler extends ThreadMessageHandler { | ||
@@ -142,3 +176,3 @@ napiModule: NapiModule | undefined; | ||
| instantiate(data: LoadPayload): InstantiatedSource | PromiseLike<InstantiatedSource>; | ||
| handle(e: any): void; | ||
| handle(e: WorkerMessageEvent): void; | ||
| } | ||
@@ -215,2 +249,15 @@ | ||
| /** @public */ | ||
| export declare interface SpawnThreadPayload { | ||
| startArg: number; | ||
| errorOrTid: number; | ||
| } | ||
| /** @public */ | ||
| export declare interface StartPayload { | ||
| tid: number; | ||
| arg: number; | ||
| sab?: Int32Array; | ||
| } | ||
| /** @public */ | ||
| export declare interface StartResult { | ||
@@ -222,2 +269,6 @@ exitCode: number; | ||
| /** @public */ | ||
| export declare interface TerminateAllThreadsPayload { | ||
| } | ||
| /** @public */ | ||
| export declare class ThreadManager { | ||
@@ -283,2 +334,3 @@ unusedWorkers: WorkerLike[]; | ||
| protected onLoad?: (data: LoadPayload) => WebAssembly.WebAssemblyInstantiatedSource | PromiseLike<WebAssembly.WebAssemblyInstantiatedSource>; | ||
| protected onError: (error: Error, type: WorkerMessageType) => void; | ||
| constructor(options?: ThreadMessageHandlerOptions); | ||
@@ -288,3 +340,3 @@ /** @virtual */ | ||
| /** @virtual */ | ||
| handle(e: WorkerMessageEvent): void; | ||
| handle(e: WorkerMessageEvent<MessageEventData<WorkerMessageType>>): void; | ||
| private _load; | ||
@@ -299,2 +351,3 @@ private _start; | ||
| onLoad?: (data: LoadPayload) => WebAssembly.WebAssemblyInstantiatedSource | PromiseLike<WebAssembly.WebAssemblyInstantiatedSource>; | ||
| onError?: (error: Error, type: WorkerMessageType) => void; | ||
| postMessage?: (message: any) => void; | ||
@@ -373,2 +426,5 @@ } | ||
| /** @public */ | ||
| export declare type WorkerMessageType = 'load' | 'start'; | ||
| export { } |
@@ -34,2 +34,26 @@ /// <reference types="node" /> | ||
| /** @public */ | ||
| export declare interface CleanupThreadPayload { | ||
| tid: number; | ||
| } | ||
| /** @public */ | ||
| export declare interface CommandInfo<T extends CommandType> { | ||
| type: T; | ||
| payload: CommandPayloadMap[T]; | ||
| } | ||
| /** @public */ | ||
| export declare interface CommandPayloadMap { | ||
| load: LoadPayload; | ||
| loaded: LoadedPayload; | ||
| start: StartPayload; | ||
| 'cleanup-thread': CleanupThreadPayload; | ||
| 'terminate-all-threads': TerminateAllThreadsPayload; | ||
| 'spawn-thread': SpawnThreadPayload; | ||
| } | ||
| /** @public */ | ||
| export declare type CommandType = keyof CommandPayloadMap; | ||
| /** @public */ | ||
| export declare function createInstanceProxy(instance: WebAssembly.Instance, memory?: WebAssembly.Memory | (() => WebAssembly.Memory)): WebAssembly.Instance; | ||
@@ -90,2 +114,6 @@ | ||
| /** @public */ | ||
| export declare interface LoadedPayload { | ||
| } | ||
| /** @public */ | ||
| export declare interface LoadedSource extends WebAssembly.WebAssemblyInstantiatedSource { | ||
@@ -112,2 +140,3 @@ usedInstance: WebAssembly.Instance; | ||
| /** @public */ | ||
| export declare interface LoadPayload { | ||
@@ -137,2 +166,7 @@ wasmModule: WebAssembly.Module; | ||
| /** @public */ | ||
| export declare interface MessageEventData<T extends CommandType> { | ||
| __emnapi__: CommandInfo<T>; | ||
| } | ||
| /** @public */ | ||
| export declare class MessageHandler extends ThreadMessageHandler { | ||
@@ -142,3 +176,3 @@ napiModule: NapiModule | undefined; | ||
| instantiate(data: LoadPayload): InstantiatedSource | PromiseLike<InstantiatedSource>; | ||
| handle(e: any): void; | ||
| handle(e: WorkerMessageEvent): void; | ||
| } | ||
@@ -215,2 +249,15 @@ | ||
| /** @public */ | ||
| export declare interface SpawnThreadPayload { | ||
| startArg: number; | ||
| errorOrTid: number; | ||
| } | ||
| /** @public */ | ||
| export declare interface StartPayload { | ||
| tid: number; | ||
| arg: number; | ||
| sab?: Int32Array; | ||
| } | ||
| /** @public */ | ||
| export declare interface StartResult { | ||
@@ -222,2 +269,6 @@ exitCode: number; | ||
| /** @public */ | ||
| export declare interface TerminateAllThreadsPayload { | ||
| } | ||
| /** @public */ | ||
| export declare class ThreadManager { | ||
@@ -283,2 +334,3 @@ unusedWorkers: WorkerLike[]; | ||
| protected onLoad?: (data: LoadPayload) => WebAssembly.WebAssemblyInstantiatedSource | PromiseLike<WebAssembly.WebAssemblyInstantiatedSource>; | ||
| protected onError: (error: Error, type: WorkerMessageType) => void; | ||
| constructor(options?: ThreadMessageHandlerOptions); | ||
@@ -288,3 +340,3 @@ /** @virtual */ | ||
| /** @virtual */ | ||
| handle(e: WorkerMessageEvent): void; | ||
| handle(e: WorkerMessageEvent<MessageEventData<WorkerMessageType>>): void; | ||
| private _load; | ||
@@ -299,2 +351,3 @@ private _start; | ||
| onLoad?: (data: LoadPayload) => WebAssembly.WebAssemblyInstantiatedSource | PromiseLike<WebAssembly.WebAssemblyInstantiatedSource>; | ||
| onError?: (error: Error, type: WorkerMessageType) => void; | ||
| postMessage?: (message: any) => void; | ||
@@ -373,2 +426,5 @@ } | ||
| /** @public */ | ||
| export declare type WorkerMessageType = 'load' | 'start'; | ||
| export { } |
@@ -34,2 +34,26 @@ /// <reference types="node" /> | ||
| /** @public */ | ||
| export declare interface CleanupThreadPayload { | ||
| tid: number; | ||
| } | ||
| /** @public */ | ||
| export declare interface CommandInfo<T extends CommandType> { | ||
| type: T; | ||
| payload: CommandPayloadMap[T]; | ||
| } | ||
| /** @public */ | ||
| export declare interface CommandPayloadMap { | ||
| load: LoadPayload; | ||
| loaded: LoadedPayload; | ||
| start: StartPayload; | ||
| 'cleanup-thread': CleanupThreadPayload; | ||
| 'terminate-all-threads': TerminateAllThreadsPayload; | ||
| 'spawn-thread': SpawnThreadPayload; | ||
| } | ||
| /** @public */ | ||
| export declare type CommandType = keyof CommandPayloadMap; | ||
| /** @public */ | ||
| export declare function createInstanceProxy(instance: WebAssembly.Instance, memory?: WebAssembly.Memory | (() => WebAssembly.Memory)): WebAssembly.Instance; | ||
@@ -90,2 +114,6 @@ | ||
| /** @public */ | ||
| export declare interface LoadedPayload { | ||
| } | ||
| /** @public */ | ||
| export declare interface LoadedSource extends WebAssembly.WebAssemblyInstantiatedSource { | ||
@@ -112,2 +140,3 @@ usedInstance: WebAssembly.Instance; | ||
| /** @public */ | ||
| export declare interface LoadPayload { | ||
@@ -137,2 +166,7 @@ wasmModule: WebAssembly.Module; | ||
| /** @public */ | ||
| export declare interface MessageEventData<T extends CommandType> { | ||
| __emnapi__: CommandInfo<T>; | ||
| } | ||
| /** @public */ | ||
| export declare class MessageHandler extends ThreadMessageHandler { | ||
@@ -142,3 +176,3 @@ napiModule: NapiModule | undefined; | ||
| instantiate(data: LoadPayload): InstantiatedSource | PromiseLike<InstantiatedSource>; | ||
| handle(e: any): void; | ||
| handle(e: WorkerMessageEvent): void; | ||
| } | ||
@@ -215,2 +249,15 @@ | ||
| /** @public */ | ||
| export declare interface SpawnThreadPayload { | ||
| startArg: number; | ||
| errorOrTid: number; | ||
| } | ||
| /** @public */ | ||
| export declare interface StartPayload { | ||
| tid: number; | ||
| arg: number; | ||
| sab?: Int32Array; | ||
| } | ||
| /** @public */ | ||
| export declare interface StartResult { | ||
@@ -222,2 +269,6 @@ exitCode: number; | ||
| /** @public */ | ||
| export declare interface TerminateAllThreadsPayload { | ||
| } | ||
| /** @public */ | ||
| export declare class ThreadManager { | ||
@@ -283,2 +334,3 @@ unusedWorkers: WorkerLike[]; | ||
| protected onLoad?: (data: LoadPayload) => WebAssembly.WebAssemblyInstantiatedSource | PromiseLike<WebAssembly.WebAssemblyInstantiatedSource>; | ||
| protected onError: (error: Error, type: WorkerMessageType) => void; | ||
| constructor(options?: ThreadMessageHandlerOptions); | ||
@@ -288,3 +340,3 @@ /** @virtual */ | ||
| /** @virtual */ | ||
| handle(e: WorkerMessageEvent): void; | ||
| handle(e: WorkerMessageEvent<MessageEventData<WorkerMessageType>>): void; | ||
| private _load; | ||
@@ -299,2 +351,3 @@ private _start; | ||
| onLoad?: (data: LoadPayload) => WebAssembly.WebAssemblyInstantiatedSource | PromiseLike<WebAssembly.WebAssemblyInstantiatedSource>; | ||
| onError?: (error: Error, type: WorkerMessageType) => void; | ||
| postMessage?: (message: any) => void; | ||
@@ -373,4 +426,7 @@ } | ||
| /** @public */ | ||
| export declare type WorkerMessageType = 'load' | 'start'; | ||
| export { } | ||
| export as namespace emnapiCore; |
@@ -34,2 +34,26 @@ /// <reference types="node" /> | ||
| /** @public */ | ||
| export declare interface CleanupThreadPayload { | ||
| tid: number; | ||
| } | ||
| /** @public */ | ||
| export declare interface CommandInfo<T extends CommandType> { | ||
| type: T; | ||
| payload: CommandPayloadMap[T]; | ||
| } | ||
| /** @public */ | ||
| export declare interface CommandPayloadMap { | ||
| load: LoadPayload; | ||
| loaded: LoadedPayload; | ||
| start: StartPayload; | ||
| 'cleanup-thread': CleanupThreadPayload; | ||
| 'terminate-all-threads': TerminateAllThreadsPayload; | ||
| 'spawn-thread': SpawnThreadPayload; | ||
| } | ||
| /** @public */ | ||
| export declare type CommandType = keyof CommandPayloadMap; | ||
| /** @public */ | ||
| export declare function createInstanceProxy(instance: WebAssembly.Instance, memory?: WebAssembly.Memory | (() => WebAssembly.Memory)): WebAssembly.Instance; | ||
@@ -90,2 +114,6 @@ | ||
| /** @public */ | ||
| export declare interface LoadedPayload { | ||
| } | ||
| /** @public */ | ||
| export declare interface LoadedSource extends WebAssembly.WebAssemblyInstantiatedSource { | ||
@@ -112,2 +140,3 @@ usedInstance: WebAssembly.Instance; | ||
| /** @public */ | ||
| export declare interface LoadPayload { | ||
@@ -137,2 +166,7 @@ wasmModule: WebAssembly.Module; | ||
| /** @public */ | ||
| export declare interface MessageEventData<T extends CommandType> { | ||
| __emnapi__: CommandInfo<T>; | ||
| } | ||
| /** @public */ | ||
| export declare class MessageHandler extends ThreadMessageHandler { | ||
@@ -142,3 +176,3 @@ napiModule: NapiModule | undefined; | ||
| instantiate(data: LoadPayload): InstantiatedSource | PromiseLike<InstantiatedSource>; | ||
| handle(e: any): void; | ||
| handle(e: WorkerMessageEvent): void; | ||
| } | ||
@@ -215,2 +249,15 @@ | ||
| /** @public */ | ||
| export declare interface SpawnThreadPayload { | ||
| startArg: number; | ||
| errorOrTid: number; | ||
| } | ||
| /** @public */ | ||
| export declare interface StartPayload { | ||
| tid: number; | ||
| arg: number; | ||
| sab?: Int32Array; | ||
| } | ||
| /** @public */ | ||
| export declare interface StartResult { | ||
@@ -222,2 +269,6 @@ exitCode: number; | ||
| /** @public */ | ||
| export declare interface TerminateAllThreadsPayload { | ||
| } | ||
| /** @public */ | ||
| export declare class ThreadManager { | ||
@@ -283,2 +334,3 @@ unusedWorkers: WorkerLike[]; | ||
| protected onLoad?: (data: LoadPayload) => WebAssembly.WebAssemblyInstantiatedSource | PromiseLike<WebAssembly.WebAssemblyInstantiatedSource>; | ||
| protected onError: (error: Error, type: WorkerMessageType) => void; | ||
| constructor(options?: ThreadMessageHandlerOptions); | ||
@@ -288,3 +340,3 @@ /** @virtual */ | ||
| /** @virtual */ | ||
| handle(e: WorkerMessageEvent): void; | ||
| handle(e: WorkerMessageEvent<MessageEventData<WorkerMessageType>>): void; | ||
| private _load; | ||
@@ -299,2 +351,3 @@ private _start; | ||
| onLoad?: (data: LoadPayload) => WebAssembly.WebAssemblyInstantiatedSource | PromiseLike<WebAssembly.WebAssemblyInstantiatedSource>; | ||
| onError?: (error: Error, type: WorkerMessageType) => void; | ||
| postMessage?: (message: any) => void; | ||
@@ -373,2 +426,5 @@ } | ||
| /** @public */ | ||
| export declare type WorkerMessageType = 'load' | 'start'; | ||
| export { } |
+2
-2
| { | ||
| "name": "@emnapi/core", | ||
| "version": "1.4.5", | ||
| "version": "1.5.0", | ||
| "description": "emnapi core", | ||
@@ -30,3 +30,3 @@ "main": "index.js", | ||
| "dependencies": { | ||
| "@emnapi/wasi-threads": "1.0.4", | ||
| "@emnapi/wasi-threads": "1.1.0", | ||
| "tslib": "^2.4.0" | ||
@@ -33,0 +33,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
1796599
1.08%31368
1.22%+ Added
- Removed
Updated