зеркало из https://github.com/microsoft/napajs.git
Merged PR 327505: Merge dev/dapeng/license to master
This commit is contained in:
Родитель
f177191ffe
Коммит
fbd5569ee2
|
@ -15,3 +15,6 @@ test/**/*.js
|
|||
package-lock.json
|
||||
|
||||
!tsconfig.json
|
||||
|
||||
# ignore all VSCode files
|
||||
.vscode
|
|
@ -0,0 +1,11 @@
|
|||
Napa.JS
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
/// <summary> Utility function to generate object for testing. </summary>
|
||||
|
||||
export function generateString(length: number): string {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import { bench } from './index';
|
||||
|
||||
bench();
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import * as napa from 'napajs';
|
||||
import * as mdTable from 'markdown-table';
|
||||
import { formatTimeDiff } from './bench-utils';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import * as napa from 'napajs';
|
||||
import * as assert from 'assert';
|
||||
import * as mdTable from 'markdown-table';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import * as napa from 'napajs';
|
||||
import * as nodeNapaPerfComp from './node-napa-perf-comparison';
|
||||
import * as executeOverhead from './execute-overhead';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import * as napa from 'napajs';
|
||||
import * as mdTable from 'markdown-table';
|
||||
import { formatTimeDiff } from './bench-utils';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import * as napa from 'napajs';
|
||||
import * as assert from 'assert';
|
||||
import * as mdTable from 'markdown-table';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import * as napa from 'napajs';
|
||||
import * as assert from 'assert';
|
||||
import * as mdTable from 'markdown-table';
|
||||
|
|
|
@ -28,7 +28,7 @@ A log row may contain following information:
|
|||
- Debug: for debugging purpose
|
||||
|
||||
## C++ API
|
||||
Include header: `<napa-log.h>`
|
||||
Include header: `<napa/log.h>`
|
||||
|
||||
Macros:
|
||||
- LOG_ERROR(section, format, ...)
|
||||
|
@ -41,7 +41,7 @@ Macros:
|
|||
- LOG_DEBUG_WITH_TRACEID(section, traceId, format, ...)
|
||||
|
||||
```cpp
|
||||
#include <napa-log.h>
|
||||
#include <napa/log.h>
|
||||
|
||||
void MyFunction() {
|
||||
// ...
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Figure out a list of example applications.
|
|
@ -1 +0,0 @@
|
|||
This is where cpp embedders example will be placed.
|
|
@ -1 +0,0 @@
|
|||
// Example for JS embedder.
|
|
@ -55,7 +55,7 @@ This example shows how to create async module. It keeps one number and three API
|
|||
* *Now*: It returns the current value of a number.
|
||||
|
||||
```cpp
|
||||
#include <napa-module.h>
|
||||
#include <napa/module.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include <napa-module.h>
|
||||
#include <napa-async.h>
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include <napa/module.h>
|
||||
#include <napa/async.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
var addon = require('../bin/addon');
|
||||
|
||||
export function increase(value: number, callback: (now: number) => void) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
var assert = require('assert');
|
||||
var asyncNumber = require('async-number');
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
This example shows the simple napa module, which shows the basic difference between node.js module and napa module.
|
||||
|
||||
```cpp
|
||||
#include <napa-module.h>
|
||||
#include <napa/module.h>
|
||||
|
||||
namespace napa {
|
||||
namespace demo {
|
||||
|
@ -26,8 +26,8 @@ NAPA_MODULE(addon, Init)
|
|||
```
|
||||
|
||||
## Transition from node.js module
|
||||
* *napa-module.h* is used instead of *node.h*. Depending on preprocessor definition, *NAPA_MODULE_EXTENSION* or
|
||||
*BUILDING_NODE_EXTENSION* preprocessor definition, *napa-module.h* includes necessary napa or node header files
|
||||
* *napa/module.h* is used instead of *node.h*. Depending on preprocessor definition, *NAPA_MODULE_EXTENSION* or
|
||||
*BUILDING_NODE_EXTENSION* preprocessor definition, *napa/module.h* includes necessary napa or node header files
|
||||
accordingly and build system creates either node.js module or napa module.
|
||||
* *NAPA_SET_METHOD* is equivalent to *NODE_SET_METHOD*. This module will have *hello()* function.
|
||||
* *NAPA_MODULE* is equivalent to *NODE_MODULE*, which exports an initialization function.
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#include <napa-module.h>
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include <napa/module.h>
|
||||
|
||||
namespace napa {
|
||||
namespace demo {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
var addon = require('../bin/addon');
|
||||
|
||||
export function hello(): string {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
var assert = require('assert');
|
||||
var helloWorld = require('hello-world');
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace demo {
|
|||
*addon.h* declares the wrapper class inherited from *NAPA_OBJECTWRAP* as follows,
|
||||
|
||||
```h
|
||||
#include <napa-module.h>
|
||||
#include <napa/module.h>
|
||||
#include <plus-number.h>
|
||||
|
||||
namespace napa {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef NAPA_EXAMPLE_API
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "addon.h"
|
||||
|
||||
using namespace napa::demo;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa-module.h>
|
||||
#include <napa/module.h>
|
||||
#include <plus-number.h>
|
||||
|
||||
namespace napa {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
var addon = require('../bin/addon');
|
||||
|
||||
export declare class PlusNumber {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "plus-number.h"
|
||||
|
||||
using namespace napa::demo;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "plus-number.h"
|
||||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
var assert = require('assert');
|
||||
var plusNumber = require('plus-number');
|
||||
|
||||
|
|
171
inc/napa.h
171
inc/napa.h
|
@ -1,162 +1,17 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "napa-c.h"
|
||||
#include <napa/assert.h>
|
||||
#include <napa/async.h>
|
||||
#include <napa/exports.h>
|
||||
#include <napa/memory.h>
|
||||
#include <napa/module.h>
|
||||
#include <napa/log.h>
|
||||
#include <napa/transport.h>
|
||||
#include <napa/types.h>
|
||||
#include <napa/v8-helpers.h>
|
||||
#include <napa/zone.h>
|
||||
|
||||
#include <functional>
|
||||
#include <future>
|
||||
|
||||
namespace napa {
|
||||
|
||||
/// <summary> Initializes napa with global scope settings. </summary>
|
||||
inline ResultCode Initialize(const std::string& settings = "") {
|
||||
return napa_initialize(STD_STRING_TO_NAPA_STRING_REF(settings));
|
||||
}
|
||||
|
||||
/// <summary> Initialize napa using console provided arguments. </summary>
|
||||
inline ResultCode InitializeFromConsole(int argc, char* argv[]) {
|
||||
return napa_initialize_from_console(argc, argv);
|
||||
}
|
||||
|
||||
/// <summary> Shut down napa. </summary>
|
||||
inline ResultCode Shutdown() {
|
||||
return napa_shutdown();
|
||||
}
|
||||
|
||||
/// <summary> C++ proxy around napa Zone C APIs. </summary>
|
||||
class Zone {
|
||||
public:
|
||||
|
||||
/// <summary> Creates a new zone and wraps it with a zone proxy instance. </summary>
|
||||
/// <param name="id"> A unique id for the zone. </param>
|
||||
/// <param name="settings"> A settings string to set zone specific settings. </param>
|
||||
explicit Zone(const std::string& id, const std::string& settings = "") : _zoneId(id) {
|
||||
_handle = napa_zone_create(STD_STRING_TO_NAPA_STRING_REF(id));
|
||||
|
||||
auto res = napa_zone_init(_handle, STD_STRING_TO_NAPA_STRING_REF(settings));
|
||||
if (res != NAPA_RESULT_SUCCESS) {
|
||||
napa_zone_release(_handle);
|
||||
throw std::runtime_error(napa_result_code_to_string(res));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Releases the underlying zone handle. </summary>
|
||||
~Zone() {
|
||||
napa_zone_release(_handle);
|
||||
}
|
||||
|
||||
/// <summary> Compiles and run the provided source code on all zone workers asynchronously. </summary>
|
||||
/// <param name="source"> The source code. </param>
|
||||
/// <param name="callback"> A callback that is triggered when broadcasting is done. </param>
|
||||
const std::string& GetId() const {
|
||||
return _zoneId;
|
||||
}
|
||||
|
||||
/// <see cref="Zone::Broadcast" />
|
||||
void Broadcast(const std::string& source, BroadcastCallback callback) {
|
||||
// Will be deleted on when the callback scope ends.
|
||||
auto context = new BroadcastCallback(std::move(callback));
|
||||
|
||||
napa_zone_broadcast(
|
||||
_handle,
|
||||
STD_STRING_TO_NAPA_STRING_REF(source),
|
||||
[](napa_result_code code, void* context) {
|
||||
// Ensures the context is deleted when this scope ends.
|
||||
std::unique_ptr<BroadcastCallback> callback(reinterpret_cast<BroadcastCallback*>(context));
|
||||
|
||||
(*callback)(code);
|
||||
}, context);
|
||||
}
|
||||
|
||||
/// <summary> Compiles and run the provided source code on all zone workers synchronously. </summary>
|
||||
/// <param name="source"> The source code. </param>
|
||||
ResultCode BroadcastSync(const std::string& source) {
|
||||
std::promise<ResultCode> prom;
|
||||
auto fut = prom.get_future();
|
||||
|
||||
Broadcast(source, [&prom](ResultCode code) {
|
||||
prom.set_value(code);
|
||||
});
|
||||
|
||||
return fut.get();
|
||||
}
|
||||
|
||||
/// <summary> Executes a pre-loaded JS function asynchronously. </summary>
|
||||
/// <param name="spec"> A function spec to call. </param>
|
||||
/// <param name="callback"> A callback that is triggered when execution is done. </param>
|
||||
void Execute(const FunctionSpec& spec, ExecuteCallback callback) {
|
||||
// Will be deleted on when the callback scope ends.
|
||||
auto context = new ExecuteCallback(std::move(callback));
|
||||
|
||||
napa_zone_function_spec req;
|
||||
req.module = spec.module;
|
||||
req.function = spec.function;
|
||||
req.arguments = spec.arguments.data();
|
||||
req.arguments_count = spec.arguments.size();
|
||||
req.options = spec.options;
|
||||
|
||||
// Release ownership of transport context
|
||||
req.transport_context = reinterpret_cast<void*>(spec.transportContext.release());
|
||||
|
||||
napa_zone_execute(_handle, req, [](napa_zone_result result, void* context) {
|
||||
// Ensures the context is deleted when this scope ends.
|
||||
std::unique_ptr<ExecuteCallback> callback(reinterpret_cast<ExecuteCallback*>(context));
|
||||
|
||||
Result res;
|
||||
res.code = result.code;
|
||||
res.errorMessage = NAPA_STRING_REF_TO_STD_STRING(result.error_message);
|
||||
res.returnValue = NAPA_STRING_REF_TO_STD_STRING(result.return_value);
|
||||
|
||||
// Assume ownership of transport context
|
||||
res.transportContext.reset(
|
||||
reinterpret_cast<napa::transport::TransportContext*>(result.transport_context));
|
||||
|
||||
(*callback)(std::move(res));
|
||||
}, context);
|
||||
}
|
||||
|
||||
/// <summary> Executes a pre-loaded JS function synchronously. </summary>
|
||||
/// <param name="spec"> The function spec to call. </param>
|
||||
Result ExecuteSync(const FunctionSpec& spec) {
|
||||
std::promise<Result> prom;
|
||||
auto fut = prom.get_future();
|
||||
|
||||
Execute(spec, [&prom](Result result) {
|
||||
prom.set_value(std::move(result));
|
||||
});
|
||||
|
||||
return fut.get();
|
||||
}
|
||||
|
||||
/// <summary> Retrieves a new zone proxy for the zone id, throws if zone is not found. </summary>
|
||||
static std::unique_ptr<Zone> Get(const std::string& id) {
|
||||
auto handle = napa_zone_get(STD_STRING_TO_NAPA_STRING_REF(id));
|
||||
if (!handle) {
|
||||
throw std::runtime_error("No zone exists for id '" + id + "'");
|
||||
}
|
||||
|
||||
return std::unique_ptr<Zone>(new Zone(id, handle));
|
||||
}
|
||||
|
||||
/// <summary> Creates a proxy to the current zone, throws if non is associated with this thread. </summary>
|
||||
static std::unique_ptr<Zone> GetCurrent() {
|
||||
auto handle = napa_zone_get_current();
|
||||
if (!handle) {
|
||||
throw std::runtime_error("The calling thread is not associated with a zone");
|
||||
}
|
||||
|
||||
auto zoneId = NAPA_STRING_REF_TO_STD_STRING(napa_zone_get_id(handle));
|
||||
return std::unique_ptr<Zone>(new Zone(std::move(zoneId), handle));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
/// <summary> Private constructor to create a C++ zone proxy from a C handle. </summary>
|
||||
explicit Zone(const std::string& id, napa_zone_handle handle) : _zoneId(id), _handle(handle) {}
|
||||
|
||||
/// <summary> The zone id. </summary>
|
||||
std::string _zoneId;
|
||||
|
||||
/// <summary> Underlying zone handle. </summary>
|
||||
napa_zone_handle _handle;
|
||||
};
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef BUILDING_NAPA_EXTENSION
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "napa/exports.h"
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
// Microsoft Windows
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "napa-assert.h"
|
||||
#include <napa/assert.h>
|
||||
#include <napa/providers/logging.h>
|
||||
|
||||
#include <stdarg.h>
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa-c.h>
|
||||
#include <napa/capi.h>
|
||||
#include <napa/memory/allocator.h>
|
||||
#include <napa/memory/common.h>
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/memory/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/exports.h>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa-c.h>
|
||||
#include <napa/capi.h>
|
||||
#include <napa/memory/allocator.h>
|
||||
#include <napa/stl/allocator.h>
|
||||
#include <memory>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
// Suppress 4100 warnings.
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa-assert.h>
|
||||
#include <napa/assert.h>
|
||||
#include <napa/exports.h>
|
||||
#include <napa/v8-helpers/maybe.h>
|
||||
#include <napa/v8-helpers/string.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/module/binding.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/v8-helpers.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/exports.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
/// <summary> It binds the method name with V8 function object. </summary>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa-module.h>
|
||||
#include <napa-transport.h>
|
||||
|
||||
#include <napa/module.h>
|
||||
#include <napa/module/common.h>
|
||||
#include <napa/module/transport-context-wrap.h>
|
||||
#include <napa/transport.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa-module.h>
|
||||
#include <napa/module.h>
|
||||
#include <napa/transport/transport-context.h>
|
||||
|
||||
namespace napa {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/exports.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/exports.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
///
|
||||
/// Napa result codes definition file!
|
||||
///
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/memory/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/allocator.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/transport/transport-context.h>
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/stl/unordered_map.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/module/binding.h>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa-module.h>
|
||||
#include <napa/module.h>
|
||||
#include <napa/module/common.h>
|
||||
#include <napa/transport/transport-context.h>
|
||||
#include <napa/transport/transport.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "stddef.h"
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa-assert.h>
|
||||
#include <napa/assert.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <stdarg.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/v8-helpers/array.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "conversion.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/v8-helpers/string.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/v8-helpers/string.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/utils.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/v8-helpers/flow.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/v8-helpers/maybe.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <v8.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/v8-helpers/string.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <v8.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <v8.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <v8.h>
|
||||
|
|
|
@ -0,0 +1,165 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "napa/capi.h"
|
||||
|
||||
#include <functional>
|
||||
#include <future>
|
||||
|
||||
namespace napa {
|
||||
|
||||
/// <summary> Initializes napa with global scope settings. </summary>
|
||||
inline ResultCode Initialize(const std::string& settings = "") {
|
||||
return napa_initialize(STD_STRING_TO_NAPA_STRING_REF(settings));
|
||||
}
|
||||
|
||||
/// <summary> Initialize napa using console provided arguments. </summary>
|
||||
inline ResultCode InitializeFromConsole(int argc, char* argv[]) {
|
||||
return napa_initialize_from_console(argc, argv);
|
||||
}
|
||||
|
||||
/// <summary> Shut down napa. </summary>
|
||||
inline ResultCode Shutdown() {
|
||||
return napa_shutdown();
|
||||
}
|
||||
|
||||
/// <summary> C++ proxy around napa Zone C APIs. </summary>
|
||||
class Zone {
|
||||
public:
|
||||
|
||||
/// <summary> Creates a new zone and wraps it with a zone proxy instance. </summary>
|
||||
/// <param name="id"> A unique id for the zone. </param>
|
||||
/// <param name="settings"> A settings string to set zone specific settings. </param>
|
||||
explicit Zone(const std::string& id, const std::string& settings = "") : _zoneId(id) {
|
||||
_handle = napa_zone_create(STD_STRING_TO_NAPA_STRING_REF(id));
|
||||
|
||||
auto res = napa_zone_init(_handle, STD_STRING_TO_NAPA_STRING_REF(settings));
|
||||
if (res != NAPA_RESULT_SUCCESS) {
|
||||
napa_zone_release(_handle);
|
||||
throw std::runtime_error(napa_result_code_to_string(res));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Releases the underlying zone handle. </summary>
|
||||
~Zone() {
|
||||
napa_zone_release(_handle);
|
||||
}
|
||||
|
||||
/// <summary> Compiles and run the provided source code on all zone workers asynchronously. </summary>
|
||||
/// <param name="source"> The source code. </param>
|
||||
/// <param name="callback"> A callback that is triggered when broadcasting is done. </param>
|
||||
const std::string& GetId() const {
|
||||
return _zoneId;
|
||||
}
|
||||
|
||||
/// <see cref="Zone::Broadcast" />
|
||||
void Broadcast(const std::string& source, BroadcastCallback callback) {
|
||||
// Will be deleted on when the callback scope ends.
|
||||
auto context = new BroadcastCallback(std::move(callback));
|
||||
|
||||
napa_zone_broadcast(
|
||||
_handle,
|
||||
STD_STRING_TO_NAPA_STRING_REF(source),
|
||||
[](napa_result_code code, void* context) {
|
||||
// Ensures the context is deleted when this scope ends.
|
||||
std::unique_ptr<BroadcastCallback> callback(reinterpret_cast<BroadcastCallback*>(context));
|
||||
|
||||
(*callback)(code);
|
||||
}, context);
|
||||
}
|
||||
|
||||
/// <summary> Compiles and run the provided source code on all zone workers synchronously. </summary>
|
||||
/// <param name="source"> The source code. </param>
|
||||
ResultCode BroadcastSync(const std::string& source) {
|
||||
std::promise<ResultCode> prom;
|
||||
auto fut = prom.get_future();
|
||||
|
||||
Broadcast(source, [&prom](ResultCode code) {
|
||||
prom.set_value(code);
|
||||
});
|
||||
|
||||
return fut.get();
|
||||
}
|
||||
|
||||
/// <summary> Executes a pre-loaded JS function asynchronously. </summary>
|
||||
/// <param name="spec"> A function spec to call. </param>
|
||||
/// <param name="callback"> A callback that is triggered when execution is done. </param>
|
||||
void Execute(const FunctionSpec& spec, ExecuteCallback callback) {
|
||||
// Will be deleted on when the callback scope ends.
|
||||
auto context = new ExecuteCallback(std::move(callback));
|
||||
|
||||
napa_zone_function_spec req;
|
||||
req.module = spec.module;
|
||||
req.function = spec.function;
|
||||
req.arguments = spec.arguments.data();
|
||||
req.arguments_count = spec.arguments.size();
|
||||
req.options = spec.options;
|
||||
|
||||
// Release ownership of transport context
|
||||
req.transport_context = reinterpret_cast<void*>(spec.transportContext.release());
|
||||
|
||||
napa_zone_execute(_handle, req, [](napa_zone_result result, void* context) {
|
||||
// Ensures the context is deleted when this scope ends.
|
||||
std::unique_ptr<ExecuteCallback> callback(reinterpret_cast<ExecuteCallback*>(context));
|
||||
|
||||
Result res;
|
||||
res.code = result.code;
|
||||
res.errorMessage = NAPA_STRING_REF_TO_STD_STRING(result.error_message);
|
||||
res.returnValue = NAPA_STRING_REF_TO_STD_STRING(result.return_value);
|
||||
|
||||
// Assume ownership of transport context
|
||||
res.transportContext.reset(
|
||||
reinterpret_cast<napa::transport::TransportContext*>(result.transport_context));
|
||||
|
||||
(*callback)(std::move(res));
|
||||
}, context);
|
||||
}
|
||||
|
||||
/// <summary> Executes a pre-loaded JS function synchronously. </summary>
|
||||
/// <param name="spec"> The function spec to call. </param>
|
||||
Result ExecuteSync(const FunctionSpec& spec) {
|
||||
std::promise<Result> prom;
|
||||
auto fut = prom.get_future();
|
||||
|
||||
Execute(spec, [&prom](Result result) {
|
||||
prom.set_value(std::move(result));
|
||||
});
|
||||
|
||||
return fut.get();
|
||||
}
|
||||
|
||||
/// <summary> Retrieves a new zone proxy for the zone id, throws if zone is not found. </summary>
|
||||
static std::unique_ptr<Zone> Get(const std::string& id) {
|
||||
auto handle = napa_zone_get(STD_STRING_TO_NAPA_STRING_REF(id));
|
||||
if (!handle) {
|
||||
throw std::runtime_error("No zone exists for id '" + id + "'");
|
||||
}
|
||||
|
||||
return std::unique_ptr<Zone>(new Zone(id, handle));
|
||||
}
|
||||
|
||||
/// <summary> Creates a proxy to the current zone, throws if non is associated with this thread. </summary>
|
||||
static std::unique_ptr<Zone> GetCurrent() {
|
||||
auto handle = napa_zone_get_current();
|
||||
if (!handle) {
|
||||
throw std::runtime_error("The calling thread is not associated with a zone");
|
||||
}
|
||||
|
||||
auto zoneId = NAPA_STRING_REF_TO_STD_STRING(napa_zone_get_id(handle));
|
||||
return std::unique_ptr<Zone>(new Zone(std::move(zoneId), handle));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
/// <summary> Private constructor to create a C++ zone proxy from a C handle. </summary>
|
||||
explicit Zone(const std::string& id, napa_zone_handle handle) : _zoneId(id), _handle(handle) {}
|
||||
|
||||
/// <summary> The zone id. </summary>
|
||||
std::string _zoneId;
|
||||
|
||||
/// <summary> Underlying zone handle. </summary>
|
||||
napa_zone_handle _handle;
|
||||
};
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napa/exports.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <node.h>
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
#ifndef SRC_NODE_VERSION_H_
|
||||
#define SRC_NODE_VERSION_H_
|
||||
|
||||
#define NODE_MAJOR_VERSION 6
|
||||
#define NODE_MINOR_VERSION 10
|
||||
#define NODE_PATCH_VERSION 3
|
||||
|
||||
#define NODE_VERSION_IS_LTS 1
|
||||
#define NODE_VERSION_LTS_CODENAME "Boron"
|
||||
|
||||
#define NODE_VERSION_IS_RELEASE 1
|
||||
|
||||
#ifndef NODE_STRINGIFY
|
||||
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
|
||||
#define NODE_STRINGIFY_HELPER(n) #n
|
||||
#endif
|
||||
|
||||
#ifndef NODE_TAG
|
||||
# if NODE_VERSION_IS_RELEASE
|
||||
# define NODE_TAG ""
|
||||
# else
|
||||
# define NODE_TAG "-pre"
|
||||
# endif
|
||||
#else
|
||||
// NODE_TAG is passed without quotes when rc.exe is run from msbuild
|
||||
# define NODE_EXE_VERSION NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
|
||||
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
|
||||
NODE_STRINGIFY(NODE_PATCH_VERSION) \
|
||||
NODE_STRINGIFY(NODE_TAG)
|
||||
#endif
|
||||
|
||||
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
|
||||
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
|
||||
NODE_STRINGIFY(NODE_PATCH_VERSION) \
|
||||
NODE_TAG
|
||||
#ifndef NODE_EXE_VERSION
|
||||
# define NODE_EXE_VERSION NODE_VERSION_STRING
|
||||
#endif
|
||||
|
||||
#define NODE_VERSION "v" NODE_VERSION_STRING
|
||||
|
||||
|
||||
#define NODE_VERSION_AT_LEAST(major, minor, patch) \
|
||||
(( (major) < NODE_MAJOR_VERSION) \
|
||||
|| ((major) == NODE_MAJOR_VERSION && (minor) < NODE_MINOR_VERSION) \
|
||||
|| ((major) == NODE_MAJOR_VERSION && \
|
||||
(minor) == NODE_MINOR_VERSION && (patch) <= NODE_PATCH_VERSION))
|
||||
|
||||
/**
|
||||
* Node.js will refuse to load modules that weren't compiled against its own
|
||||
* module ABI number, exposed as the process.versions.modules property.
|
||||
*
|
||||
* When this version number is changed, node.js will refuse
|
||||
* to load older modules. This should be done whenever
|
||||
* an API is broken in the C++ side, including in v8 or
|
||||
* other dependencies.
|
||||
*/
|
||||
#define NODE_MODULE_VERSION 48 /* Node.js v6.0.0 */
|
||||
|
||||
#endif // SRC_NODE_VERSION_H_
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
if (typeof __in_napa === 'undefined') {
|
||||
module.exports = require('../bin/napa-binding');
|
||||
} else {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
var binding = exports;
|
||||
|
||||
for (var prop in process) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
var binding = process.binding('tty_wrap');
|
||||
var tty = exports;
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import { log } from './log';
|
||||
import * as memory from './memory';
|
||||
import * as metric from './metric';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
let binding = require('./binding');
|
||||
|
||||
export interface LogFunction {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
export * from './memory/allocator';
|
||||
export * from './memory/handle';
|
||||
export * from './memory/shareable';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import { Handle } from './handle';
|
||||
import { Shareable } from './shareable';
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
export type Handle = [number, number] | [number, number, number];
|
||||
|
||||
/// <summary> nullptr. </summary>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import { Handle} from './handle';
|
||||
import { Transportable, isTransportable } from '../transport/transportable';
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
let binding = require('./binding');
|
||||
|
||||
export enum MetricType {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
export {
|
||||
setPlatformSettings
|
||||
} from './runtime/platform';
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
let binding = require('../binding');
|
||||
import { log } from '../log';
|
||||
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
export * from './store/store';
|
||||
export * from './store/store-api';
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import { Store } from './store';
|
||||
|
||||
let binding = require('../binding');
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
/// <summary> Store is a facility to share (built-in JavaScript types or Transportable subclasses) objects across isolates. </summary>
|
||||
export interface Store {
|
||||
/// <summary> Id of this store. </summary>
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче