@microsoft/api-extractor
Advanced tools
Comparing version 1.1.10 to 1.1.11
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "1.1.11", | ||
"tag": "@microsoft/api-extractor_v1.1.11", | ||
"date": "Sat, 11 Feb 2017 02:32:35 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Changed dependency for ApiDocumentation to abstract the resolving of API definition references." | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "1.1.10", | ||
@@ -7,0 +19,0 @@ "tag": "@microsoft/api-extractor_v1.1.10", |
# Change Log - @microsoft/api-extractor | ||
This log was last generated on Fri, 10 Feb 2017 20:01:30 GMT and should not be manually modified. | ||
This log was last generated on Sat, 11 Feb 2017 02:32:35 GMT and should not be manually modified. | ||
## 1.1.11 | ||
Sat, 11 Feb 2017 02:32:35 GMT | ||
### Patches | ||
- Changed dependency for ApiDocumentation to abstract the resolving of API definition references. | ||
## 1.1.10 | ||
@@ -6,0 +13,0 @@ Fri, 10 Feb 2017 20:01:30 GMT |
/// <reference types="es6-collections" /> | ||
import { IDocElement, IParam } from '../IDocElement'; | ||
import DocItemLoader from '../DocItemLoader'; | ||
import { IDocItem } from '../IDocItem'; | ||
import { IApiDefinitionReference } from '../IApiDefinitionReference'; | ||
@@ -54,2 +54,16 @@ import Token from '../Token'; | ||
} | ||
/** | ||
* A dependency for ApiDocumentation constructor that abstracts away the function | ||
* of resolving an API definition reference. | ||
* | ||
* @internalremarks reportError() will be called if the apiDefinitionRef is to a non local | ||
* item and the package of that non local item can not be found. | ||
* If there is no package given and an item can not be found we will return undefined. | ||
* Once we support local references, we can be sure that reportError will only be | ||
* called once if the item can not be found (and undefined will be retured by the reference | ||
* function). | ||
*/ | ||
export interface IReferenceResolver { | ||
resolve(apiDefinitionRef: IApiDefinitionReference, reportError: (message: string) => void): IDocItem; | ||
} | ||
export default class ApiDocumentation { | ||
@@ -127,4 +141,13 @@ /** | ||
hasReadOnlyTag?: boolean; | ||
docItemLoader: DocItemLoader; | ||
/** | ||
* A function type interface that abstracts away resolving | ||
* an API definition reference to an item that has friendly | ||
* assessible ApiItem properties. | ||
* | ||
* Ex: this is useful in the case of parsing inheritdoc expressions, | ||
* in the sense that we do not know if we the inherited documentation | ||
* is coming from an ApiItem or a IDocItem. | ||
*/ | ||
referenceResolver: IReferenceResolver; | ||
/** | ||
* We need the extractor to access the package that this ApiItem | ||
@@ -146,3 +169,3 @@ * belongs to in order to resolve references. | ||
private static parseScopedPackageName(scopedName); | ||
constructor(docComment: string, docItemLoader: DocItemLoader, extractor: Extractor, errorLogger: (message: string) => void); | ||
constructor(docComment: string, referenceResolver: IReferenceResolver, extractor: Extractor, errorLogger: (message: string) => void); | ||
protected _parseDocs(): void; | ||
@@ -149,0 +172,0 @@ /** |
@@ -41,5 +41,5 @@ /* tslint:disable:no-bitwise */ | ||
var ApiDocumentation = (function () { | ||
function ApiDocumentation(docComment, docItemLoader, extractor, errorLogger) { | ||
function ApiDocumentation(docComment, referenceResolver, extractor, errorLogger) { | ||
this.originalJsDoc = docComment; | ||
this.docItemLoader = docItemLoader; | ||
this.referenceResolver = referenceResolver; | ||
this.extractor = extractor; | ||
@@ -265,3 +265,3 @@ this.reportError = errorLogger; | ||
// Atempt to locate the apiDefinitionRef | ||
var inheritedDoc = this.docItemLoader.getItem(apiDefinitionRef, this.reportError); | ||
var inheritedDoc = this.referenceResolver.resolve(apiDefinitionRef, this.reportError); | ||
// If no IDocItem found then nothing to inherit | ||
@@ -268,0 +268,0 @@ // But for the time being set the summary to a text object |
@@ -34,8 +34,5 @@ import { IDocItem, IDocPackage } from './IDocItem'; | ||
/** | ||
* Attempts to retrieve an API item from the provided apiDefinitionRef. | ||
* First checks the cache for the package, if not in the cache then the method | ||
* will attempt to the locate the associated json file to load the package and | ||
* check there. If the API item can not be found the method will return undefined. | ||
* {@inheritdoc ApiDocumentation.IReferenceResolver} | ||
*/ | ||
getItem(apiDefinitionRef: IApiDefinitionReference, reportError: (message: string) => void): IDocItem; | ||
resolve(apiDefinitionRef: IApiDefinitionReference, reportError: (message: string) => void): IDocItem; | ||
/** | ||
@@ -42,0 +39,0 @@ * Attempts to locate and load the IDocPackage object from the project folder's |
@@ -26,8 +26,5 @@ "use strict"; | ||
/** | ||
* Attempts to retrieve an API item from the provided apiDefinitionRef. | ||
* First checks the cache for the package, if not in the cache then the method | ||
* will attempt to the locate the associated json file to load the package and | ||
* check there. If the API item can not be found the method will return undefined. | ||
* {@inheritdoc ApiDocumentation.IReferenceResolver} | ||
*/ | ||
DocItemLoader.prototype.getItem = function (apiDefinitionRef, reportError) { | ||
DocItemLoader.prototype.resolve = function (apiDefinitionRef, reportError) { | ||
if (!apiDefinitionRef) { | ||
@@ -34,0 +31,0 @@ reportError('Expected reference within {@inheritdoc} tag'); |
@@ -19,3 +19,3 @@ /// <reference types="mocha" /> | ||
/* ts-lint:diasble:no-unused-variable */ | ||
var apiDocItem = docItemLoader.getItem(apiDefRef, console.log); | ||
var apiDocItem = docItemLoader.resolve(apiDefRef, console.log); | ||
JsonFile_1.default.saveJsonFile('./lib/inheritedDoc-output.json', JSON.stringify(apiDocItem)); | ||
@@ -22,0 +22,0 @@ TestFileComparer_1.default.assertFileMatchesExpected('./lib/inheritedDoc-output.json', './testInputs/inheritedDoc-output.json'); |
{ | ||
"name": "@microsoft/api-extractor", | ||
"version": "1.1.10", | ||
"version": "1.1.11", | ||
"description": "Validatation, documentation, and auditing for the exported API of a TypeScript package", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
554709
6683