You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/providers/declaration_info.bzl
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,12 @@
12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
-
"""This module contains a provider for TypeScript typings files (.d.ts)"""
15
+
"""This module contains a provider for TypeScript typings (*.d.ts and package.json#typings)"""
16
16
17
17
DeclarationInfo=provider(
18
-
doc="""The DeclarationInfo provider allows JS rules to communicate typing information. TypeScript's .d.ts files are used as the interop format for describing types.
18
+
doc="""The DeclarationInfo provider allows JS rules to communicate typing information.
19
+
TypeScript's .d.ts files are used as the interop format for describing types.
20
+
package.json files are included as well, as TypeScript needs to read the "typings" property.
19
21
20
22
Do not create DeclarationInfo instances directly, instead use the declaration_info factory function.
21
23
@@ -24,18 +26,18 @@ Note: historically this was a subset of the string-typed "typescript" provider.
24
26
# TODO(alexeagle): The ts_library#deps attribute should require that this provider is attached.
25
27
# TODO: if we ever enable --declarationMap we will have .d.ts.map files too
26
28
fields= {
27
-
"declarations": "A depset of .d.ts files produced by this rule",
28
-
"transitive_declarations": """A depset of .d.ts files produced by this rule and all its transitive dependencies.
29
+
"declarations": "A depset of typings files produced by this rule",
30
+
"transitive_declarations": """A depset of typings files produced by this rule and all its transitive dependencies.
29
31
This prevents needing an aspect in rules that consume the typings, which improves performance.""",
30
32
"type_blacklisted_declarations": """A depset of .d.ts files that we should not use to infer JSCompiler types (via tsickle)""",
31
33
},
32
34
)
33
35
34
36
defdeclaration_info(declarations, deps= []):
35
-
"""Constructs a DeclarationInfo including all transitive declarations from DeclarationInfo providers in a list of deps.
37
+
"""Constructs a DeclarationInfo including all transitive files needed to type-check from DeclarationInfo providers in a list of deps.
36
38
37
39
Args:
38
-
declarations: list of .d.ts files
40
+
declarations: list of typings files
39
41
deps: list of labels of dependencies where we should collect their DeclarationInfo to pass transitively
0 commit comments