This change makes a few simplifications to how properties are exposed in the system, mostly in the name of usability, but also to feel a bit more like "idiomatic JavaScript". Namely: * Rename `then` to `mapValue`. This hopefully helps to suggest that this is meant for a dataflow style of programming. * Move Property<T> into the runtime module, and remove PropertyState<T>, collapsing back down to a single type. This also eliminates some of the messy internal runtime casting, accessing of internal members, etc. * Export a Computed<T> interface from the root of the module. This is the entirety of the public-facing surface area for properties, and exposes that single `mapValue` member function. The internal runtime logic understands how to handle Property<T>s specifically in addition to Computed<T>s more generally (in case someone writes their own).
15 lines
410 B
TypeScript
15 lines
410 B
TypeScript
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
|
|
|
|
// Enable source map support so we get good stack traces.
|
|
import "source-map-support/register";
|
|
|
|
// Export top-level elements.
|
|
export * from "./computed";
|
|
export * from "./config";
|
|
export * from "./resource";
|
|
|
|
// Export submodules individually.
|
|
import * as asset from "./asset";
|
|
import * as runtime from "./runtime";
|
|
export {asset, runtime};
|
|
|