Skip to content

Commit 4918b9e

Browse files
committed
Address feedback
1 parent 484de79 commit 4918b9e

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

tools/dgeni/common/dgeni-definitions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {ClassExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
22
import {ClassLikeExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassLikeExportDoc';
33
import {PropertyMemberDoc} from 'dgeni-packages/typescript/api-doc-types/PropertyMemberDoc';
4-
import {DirectiveMetadata} from './directive-metadata';
54
import {NormalizedMethodMemberDoc} from './normalize-method-parameters';
65

76
/** Extended Dgeni class-like document that includes separated class members. */
@@ -18,7 +17,7 @@ export interface CategorizedClassDoc extends ClassExportDoc, CategorizedClassLik
1817
isNgModule: boolean;
1918
directiveExportAs?: string | null;
2019
directiveSelectors?: string[];
21-
directiveMetadata: DirectiveMetadata | null;
20+
directiveMetadata: Map<string, any> | null;
2221
extendedDoc: ClassLikeExportDoc | null;
2322
}
2423

tools/dgeni/common/directive-metadata.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ import {
77
StringLiteral, SyntaxKind
88
} from 'typescript';
99

10-
export type DirectiveMetadata = Map<string, any>;
11-
1210
/**
1311
* Determines the component or directive metadata from the specified Dgeni class doc. The resolved
1412
* directive metadata will be stored in a Map.
1513
*
16-
* Currently only string literal assignments and array literal assignments are supported.
14+
* Currently only string literal assignments and array literal assignments are supported. Other
15+
* value types are not necessary because they are not needed for any user-facing documentation.
1716
*
1817
* ```ts
1918
* @Component({
@@ -23,7 +22,7 @@ export type DirectiveMetadata = Map<string, any>;
2322
* export class MyComponent {}
2423
* ```
2524
*/
26-
export function getDirectiveMetadata(classDoc: CategorizedClassDoc): DirectiveMetadata | null {
25+
export function getDirectiveMetadata(classDoc: CategorizedClassDoc): Map<string, any> | null {
2726
const declaration = classDoc.symbol.valueDeclaration;
2827

2928
if (!declaration || !declaration.decorators) {

tools/dgeni/common/property-bindings.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {PropertyMemberDoc} from 'dgeni-packages/typescript/api-doc-types/PropertyMemberDoc';
2-
import {DirectiveMetadata} from './directive-metadata';
32
import {hasMemberDecorator} from './decorators';
43

54
/** Interface that describes an Angular property binding. Can be either an input or output. */
@@ -12,7 +11,7 @@ export interface PropertyBinding {
1211
* Detects whether the specified property member is an input. If the property is an input, the
1312
* alias and input name will be returned.
1413
*/
15-
export function getInputBindingData(doc: PropertyMemberDoc, metadata: DirectiveMetadata)
14+
export function getInputBindingData(doc: PropertyMemberDoc, metadata: Map<string, any>)
1615
: PropertyBinding | undefined {
1716
return getBindingPropertyData(doc, metadata, 'inputs', 'Input');
1817
}
@@ -21,7 +20,7 @@ export function getInputBindingData(doc: PropertyMemberDoc, metadata: DirectiveM
2120
* Detects whether the specified property member is an output. If the property is an output, the
2221
* alias and output name will be returned.
2322
*/
24-
export function getOutputBindingData(doc: PropertyMemberDoc, metadata: DirectiveMetadata)
23+
export function getOutputBindingData(doc: PropertyMemberDoc, metadata: Map<string, any>)
2524
: PropertyBinding | undefined {
2625
return getBindingPropertyData(doc, metadata, 'outputs', 'Output');
2726
}
@@ -30,7 +29,7 @@ export function getOutputBindingData(doc: PropertyMemberDoc, metadata: Directive
3029
* Method that detects the specified type of property binding (either "output" or "input") from
3130
* the directive metadata or from the associated decorator on the property.
3231
*/
33-
function getBindingPropertyData(doc: PropertyMemberDoc, metadata: DirectiveMetadata,
32+
function getBindingPropertyData(doc: PropertyMemberDoc, metadata: Map<string, any>,
3433
propertyName: string, decoratorName: string) {
3534

3635
if (metadata) {

0 commit comments

Comments
 (0)