File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """This module contains a provider for TypeScript typings files (.d.ts)"""
2+
3+ def provide_declarations (** kwargs ):
4+ """Factory function for creating checked declarations with externs.
5+
6+ Do not directly construct DeclarationInfo()
7+ """
8+
9+ # TODO: add some checking actions to ensure the declarations are well-formed
10+ return DeclarationInfo (** kwargs )
11+
12+ DeclarationInfo = provider (
13+ doc = """The DeclarationInfo provider allows JS rules to communicate typing information.
14+ TypeScript's .d.ts files are used as the interop format for describing types.
15+
16+ Do not create DeclarationInfo instances directly, instead use the provide_declarations factory function.
17+
18+ TODO(alexeagle): The ts_library#deps attribute should require that this provider is attached.
19+
20+ Note: historically this was a subset of the string-typed "typescript" provider.
21+ """ ,
22+ # TODO: if we ever enable --declarationMap we will have .d.ts.map files too
23+ fields = {
24+ "declarations" : "A depset of .d.ts files produced by this rule" ,
25+ "transitive_declarations" : """A depset of .d.ts files produced by this rule and all its transitive dependencies.
26+ This prevents needing an aspect in rules that consume the typings, which improves performance.""" ,
27+ },
28+ )
You can’t perform that action at this time.
0 commit comments