diff --git a/versioned_docs/version-latest/03-language-reference.md b/versioned_docs/version-latest/03-language-reference.md index 7eb734e29..370a045b7 100644 --- a/versioned_docs/version-latest/03-language-reference.md +++ b/versioned_docs/version-latest/03-language-reference.md @@ -1152,7 +1152,7 @@ The following features are not yet implemented, but we are planning to add them ### 2.1 bring -**bring** statement can be used to import and reuse code from +**bring** statement can be used to import and reuse code from Wing and other JSII supported languages. The statement is detailed in its own section in this document: [Module System](#4-module-system). @@ -1776,12 +1776,20 @@ code. Comments before the first bring expression are valid. ### 4.1 Imports -To import a JSII package under a named import, you may use the following +To import a built-in module or trusted Wing library, you can use the following syntax: + +```TS +bring util; // import types from the built-in "util" module +bring cloud; // import types from the built-in "cloud" module +bring containers; // import types from the `@winglibs/containers` trusted library +``` + +To use a trusted library, you must install the relevant npm package with `npm i @winglibs/containers`. + +To import a Wing or JSII library under a named import, you may use the following syntax: ```TS -bring util; // from util bring * as util; -bring cloud; // from cloud bring * as cloud; bring "cdktf" as cdktf; // from "cdktf" bring * as cdktf; ``` @@ -1805,7 +1813,7 @@ new myModule.submodule.MyClass(); The following features are not yet implemented, but we are planning to add them in the future: -* Specify types as public using `pub` - see https://github.com/winglang/wing/issues/4294 to track. +* Install trusted libraries using `wing install containers` - see https://github.com/winglang/wing/issues/1037 to track. * Specify types as public within the current project or library, and private outside, using `internal` - see https://github.com/winglang/wing/issues/4156 to track. [`▲ top`][top]