using System;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.NodeServices.HostingModels
{
///
/// Represents an instance of Node.js to which Remote Procedure Calls (RPC) may be sent.
///
public interface INodeInstance : IDisposable
{
///
/// Asynchronously invokes code in the Node.js instance.
///
/// The JSON-serializable data type that the Node.js code will asynchronously return.
/// A that can be used to cancel the invocation.
/// The path to the Node.js module (i.e., JavaScript file) relative to your project root that contains the code to be invoked.
/// If set, specifies the CommonJS export to be invoked. If not set, the module's default CommonJS export itself must be a function to be invoked.
/// Any sequence of JSON-serializable arguments to be passed to the Node.js function.
/// A representing the completion of the RPC call.
Task InvokeExportAsync(CancellationToken cancellationToken, string moduleName, string exportNameOrNull, params object[] args);
}
}