// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
import * as zone from './zone/zone';
import * as impl from './zone/zone-impl';
import * as platform from './runtime/platform';
let binding = require('./binding');
// This variable is either defined by napa runtime, or not defined (hence node runtime)
declare var __in_napa: boolean;
/// Creates a new zone.
/// A unique id to identify the zone.
/// The settings of the new zone.
export function create(id: string, settings: zone.ZoneSettings = zone.DEFAULT_SETTINGS) : zone.Zone {
platform.initialize();
return new impl.ZoneImpl(binding.createZone(id, settings));
}
/// Returns the zone associated with the provided id.
export function get(id: string) : zone.Zone {
platform.initialize();
return new impl.ZoneImpl(binding.getZone(id));
}
/// TODO: add function getOrCreate(id: string, settings: zone.ZoneSettings): Zone.
/// Define a getter property 'current' to retrieve the current zone.
export declare let current: zone.Zone;
Object.defineProperty(exports, "current", {
get: function () : zone.Zone {
platform.initialize();
return new impl.ZoneImpl(binding.getCurrentZone());
}
});
/// Define a getter property 'node' to retrieve node zone.
export declare let node: zone.Zone;
Object.defineProperty(exports, "node", {
get: function () : zone.Zone {
platform.initialize();
return new impl.ZoneImpl(binding.getZone('node'));
}
});
export * from './zone/zone';