@microsoft/api-extractor-model
Advanced tools
Comparing version 7.1.3 to 7.2.0
@@ -5,2 +5,19 @@ { | ||
{ | ||
"version": "7.2.0", | ||
"tag": "@microsoft/api-extractor-model_v7.2.0", | ||
"date": "Tue, 11 Jun 2019 00:48:06 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Improve the .api.json deserializer to validate the schema version and support backwards compatibility" | ||
} | ||
], | ||
"minor": [ | ||
{ | ||
"comment": "Add API support for type parameters and type alias types" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "7.1.3", | ||
@@ -7,0 +24,0 @@ "tag": "@microsoft/api-extractor-model_v7.1.3", |
# Change Log - @microsoft/api-extractor-model | ||
This log was last generated on Wed, 05 Jun 2019 19:12:34 GMT and should not be manually modified. | ||
This log was last generated on Tue, 11 Jun 2019 00:48:06 GMT and should not be manually modified. | ||
## 7.2.0 | ||
Tue, 11 Jun 2019 00:48:06 GMT | ||
### Minor changes | ||
- Add API support for type parameters and type alias types | ||
### Patches | ||
- Improve the .api.json deserializer to validate the schema version and support backwards compatibility | ||
## 7.1.3 | ||
@@ -6,0 +17,0 @@ Wed, 05 Jun 2019 19:12:34 GMT |
@@ -15,2 +15,3 @@ /** | ||
export { IApiParameterListMixinOptions, IApiParameterOptions, ApiParameterListMixin } from './mixins/ApiParameterListMixin'; | ||
export { IApiTypeParameterOptions, IApiTypeParameterListMixinOptions, ApiTypeParameterListMixin } from './mixins/ApiTypeParameterListMixin'; | ||
export { IApiItemContainerMixinOptions, ApiItemContainerMixin } from './mixins/ApiItemContainerMixin'; | ||
@@ -20,2 +21,3 @@ export { IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from './mixins/ApiReleaseTagMixin'; | ||
export { IApiStaticMixinOptions, ApiStaticMixin } from './mixins/ApiStaticMixin'; | ||
export { IApiNameMixinOptions, ApiNameMixin } from './mixins/ApiNameMixin'; | ||
export { ExcerptTokenKind, IExcerptTokenRange, IExcerptToken, ExcerptToken, Excerpt } from './mixins/Excerpt'; | ||
@@ -42,2 +44,3 @@ export { Constructor, PropertiesOf } from './mixins/Mixin'; | ||
export { IApiTypeAliasOptions, ApiTypeAlias } from './model/ApiTypeAlias'; | ||
export { ITypeParameterOptions, TypeParameter } from './model/TypeParameter'; | ||
export { IApiVariableOptions, ApiVariable } from './model/ApiVariable'; | ||
@@ -44,0 +47,0 @@ export { IResolveDeclarationReferenceResult } from './model/ModelReferenceResolver'; |
@@ -28,2 +28,4 @@ "use strict"; | ||
exports.ApiParameterListMixin = ApiParameterListMixin_1.ApiParameterListMixin; | ||
var ApiTypeParameterListMixin_1 = require("./mixins/ApiTypeParameterListMixin"); | ||
exports.ApiTypeParameterListMixin = ApiTypeParameterListMixin_1.ApiTypeParameterListMixin; | ||
var ApiItemContainerMixin_1 = require("./mixins/ApiItemContainerMixin"); | ||
@@ -37,2 +39,4 @@ exports.ApiItemContainerMixin = ApiItemContainerMixin_1.ApiItemContainerMixin; | ||
exports.ApiStaticMixin = ApiStaticMixin_1.ApiStaticMixin; | ||
var ApiNameMixin_1 = require("./mixins/ApiNameMixin"); | ||
exports.ApiNameMixin = ApiNameMixin_1.ApiNameMixin; | ||
var Excerpt_1 = require("./mixins/Excerpt"); | ||
@@ -80,2 +84,4 @@ exports.ExcerptToken = Excerpt_1.ExcerptToken; | ||
exports.ApiTypeAlias = ApiTypeAlias_1.ApiTypeAlias; | ||
var TypeParameter_1 = require("./model/TypeParameter"); | ||
exports.TypeParameter = TypeParameter_1.TypeParameter; | ||
var ApiVariable_1 = require("./model/ApiVariable"); | ||
@@ -82,0 +88,0 @@ exports.ApiVariable = ApiVariable_1.ApiVariable; |
import { ApiDocumentedItem, IApiDocumentedItemJson, IApiDocumentedItemOptions } from './ApiDocumentedItem'; | ||
import { Excerpt, ExcerptToken, IExcerptTokenRange, IExcerptToken } from '../mixins/Excerpt'; | ||
import { DeserializerContext } from '../model/DeserializerContext'; | ||
/** | ||
@@ -30,3 +31,3 @@ * Constructor options for {@link ApiDeclaredItem}. | ||
/** @override */ | ||
static onDeserializeInto(options: Partial<IApiDeclaredItemOptions>, jsonObject: IApiDeclaredItemJson): void; | ||
static onDeserializeInto(options: Partial<IApiDeclaredItemOptions>, context: DeserializerContext, jsonObject: IApiDeclaredItemJson): void; | ||
constructor(options: IApiDeclaredItemOptions); | ||
@@ -33,0 +34,0 @@ /** |
@@ -23,4 +23,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
super.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
super.onDeserializeInto(options, context, jsonObject); | ||
options.excerptTokens = jsonObject.excerptTokens; | ||
@@ -27,0 +27,0 @@ } |
import * as tsdoc from '@microsoft/tsdoc'; | ||
import { ApiItem, IApiItemOptions, IApiItemJson } from './ApiItem'; | ||
import { DeserializerContext } from '../model/DeserializerContext'; | ||
/** | ||
@@ -26,3 +27,3 @@ * Constructor options for {@link ApiDocumentedItem}. | ||
/** @override */ | ||
static onDeserializeInto(options: Partial<IApiDocumentedItemOptions>, jsonObject: IApiItemJson): void; | ||
static onDeserializeInto(options: Partial<IApiDocumentedItemOptions>, context: DeserializerContext, jsonObject: IApiItemJson): void; | ||
constructor(options: IApiDocumentedItemOptions); | ||
@@ -29,0 +30,0 @@ readonly tsdocComment: tsdoc.DocComment | undefined; |
@@ -20,4 +20,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
super.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
super.onDeserializeInto(options, context, jsonObject); | ||
const documentedJson = jsonObject; | ||
@@ -24,0 +24,0 @@ if (documentedJson.docComment) { |
import { Constructor, PropertiesOf } from '../mixins/Mixin'; | ||
import { ApiPackage } from '../model/ApiPackage'; | ||
import { DeserializerContext } from '../model/DeserializerContext'; | ||
/** | ||
@@ -56,5 +57,5 @@ * The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of | ||
[ApiItem_parent]: ApiItem | undefined; | ||
static deserialize(jsonObject: IApiItemJson): ApiItem; | ||
static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem; | ||
/** @virtual */ | ||
static onDeserializeInto(options: Partial<IApiItemOptions>, jsonObject: IApiItemJson): void; | ||
static onDeserializeInto(options: Partial<IApiItemOptions>, context: DeserializerContext, jsonObject: IApiItemJson): void; | ||
constructor(options: IApiItemOptions); | ||
@@ -61,0 +62,0 @@ /** @virtual */ |
@@ -24,10 +24,10 @@ "use strict"; | ||
} | ||
static deserialize(jsonObject) { | ||
static deserialize(jsonObject, context) { | ||
// The Deserializer class is coupled with a ton of other classes, so we delay loading it | ||
// to avoid ES5 circular imports. | ||
const deserializerModule = require('../model/Deserializer'); | ||
return deserializerModule.Deserializer.deserialize(jsonObject); | ||
return deserializerModule.Deserializer.deserialize(context, jsonObject); | ||
} | ||
/** @virtual */ | ||
static onDeserializeInto(options, jsonObject) { | ||
static onDeserializeInto(options, context, jsonObject) { | ||
// (implemented by subclasses) | ||
@@ -34,0 +34,0 @@ } |
@@ -5,2 +5,3 @@ import { Excerpt, IExcerptTokenRange } from '../mixins/Excerpt'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { DeserializerContext } from '../model/DeserializerContext'; | ||
/** | ||
@@ -28,3 +29,3 @@ * Constructor options for {@link ApiPropertyItem}. | ||
/** @override */ | ||
static onDeserializeInto(options: Partial<IApiPropertyItemOptions>, jsonObject: IApiPropertyItemJson): void; | ||
static onDeserializeInto(options: Partial<IApiPropertyItemOptions>, context: DeserializerContext, jsonObject: IApiPropertyItemJson): void; | ||
constructor(options: IApiPropertyItemOptions); | ||
@@ -31,0 +32,0 @@ /** |
@@ -15,4 +15,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
super.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
super.onDeserializeInto(options, context, jsonObject); | ||
options.propertyTypeTokenRange = jsonObject.propertyTypeTokenRange; | ||
@@ -19,0 +19,0 @@ } |
@@ -34,7 +34,7 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
baseClass.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
baseClass.onDeserializeInto(options, context, jsonObject); | ||
options.members = []; | ||
for (const memberObject of jsonObject.members) { | ||
options.members.push(ApiItem_1.ApiItem.deserialize(memberObject)); | ||
options.members.push(ApiItem_1.ApiItem.deserialize(memberObject, context)); | ||
} | ||
@@ -41,0 +41,0 @@ } |
@@ -23,4 +23,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
baseClass.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
baseClass.onDeserializeInto(options, context, jsonObject); | ||
options.name = jsonObject.name; | ||
@@ -27,0 +27,0 @@ } |
@@ -43,4 +43,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
baseClass.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
baseClass.onDeserializeInto(options, context, jsonObject); | ||
options.overloadIndex = jsonObject.overloadIndex; | ||
@@ -47,0 +47,0 @@ options.parameters = jsonObject.parameters || []; |
@@ -24,4 +24,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
baseClass.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
baseClass.onDeserializeInto(options, context, jsonObject); | ||
const deserializedReleaseTag = ReleaseTag_1.ReleaseTag[jsonObject.releaseTag]; | ||
@@ -28,0 +28,0 @@ if (deserializedReleaseTag === undefined) { |
@@ -30,4 +30,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
baseClass.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
baseClass.onDeserializeInto(options, context, jsonObject); | ||
options.returnTypeTokenRange = jsonObject.returnTypeTokenRange; | ||
@@ -34,0 +34,0 @@ } |
@@ -23,4 +23,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
baseClass.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
baseClass.onDeserializeInto(options, context, jsonObject); | ||
options.isStatic = jsonObject.isStatic; | ||
@@ -27,0 +27,0 @@ } |
@@ -47,3 +47,4 @@ /** @public */ | ||
readonly text: string; | ||
readonly isEmpty: boolean; | ||
} | ||
//# sourceMappingURL=Excerpt.d.ts.map |
@@ -56,4 +56,7 @@ "use strict"; | ||
} | ||
get isEmpty() { | ||
return this.tokenRange.startIndex === this.tokenRange.endIndex; | ||
} | ||
} | ||
exports.Excerpt = Excerpt; | ||
//# sourceMappingURL=Excerpt.js.map |
@@ -6,2 +6,3 @@ import { ApiItemKind } from '../items/ApiItem'; | ||
import { IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin'; | ||
import { IApiTypeParameterListMixinOptions, ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin'; | ||
/** | ||
@@ -11,5 +12,5 @@ * Constructor options for {@link ApiCallSignature}. | ||
*/ | ||
export interface IApiCallSignatureOptions extends IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { | ||
export interface IApiCallSignatureOptions extends IApiTypeParameterListMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { | ||
} | ||
declare const ApiCallSignature_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin); | ||
declare const ApiCallSignature_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin) & (new (...args: any[]) => ApiTypeParameterListMixin); | ||
/** | ||
@@ -16,0 +17,0 @@ * Represents a TypeScript function call signature. |
@@ -9,2 +9,3 @@ "use strict"; | ||
const ApiReturnTypeMixin_1 = require("../mixins/ApiReturnTypeMixin"); | ||
const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin"); | ||
/** | ||
@@ -39,3 +40,3 @@ * Represents a TypeScript function call signature. | ||
*/ | ||
class ApiCallSignature extends ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem))) { | ||
class ApiCallSignature extends ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem)))) { | ||
static getCanonicalReference(overloadIndex) { | ||
@@ -42,0 +43,0 @@ return `(:call,${overloadIndex})`; |
@@ -8,2 +8,4 @@ import { ApiItemKind } from '../items/ApiItem'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { ApiTypeParameterListMixin, IApiTypeParameterListMixinOptions, IApiTypeParameterListMixinJson } from '../mixins/ApiTypeParameterListMixin'; | ||
import { DeserializerContext } from './DeserializerContext'; | ||
/** | ||
@@ -13,11 +15,11 @@ * Constructor options for {@link ApiClass}. | ||
*/ | ||
export interface IApiClassOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions { | ||
export interface IApiClassOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions, IApiTypeParameterListMixinOptions { | ||
extendsTokenRange: IExcerptTokenRange | undefined; | ||
implementsTokenRanges: IExcerptTokenRange[]; | ||
} | ||
export interface IApiClassJson extends IApiDeclaredItemJson { | ||
export interface IApiClassJson extends IApiDeclaredItemJson, IApiTypeParameterListMixinJson { | ||
extendsTokenRange?: IExcerptTokenRange; | ||
implementsTokenRanges: IExcerptTokenRange[]; | ||
} | ||
declare const ApiClass_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin) & (new (...args: any[]) => ApiItemContainerMixin); | ||
declare const ApiClass_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiTypeParameterListMixin) & (new (...args: any[]) => ApiNameMixin) & (new (...args: any[]) => ApiItemContainerMixin); | ||
/** | ||
@@ -47,3 +49,3 @@ * Represents a TypeScript class declaration. | ||
/** @override */ | ||
static onDeserializeInto(options: Partial<IApiClassOptions>, jsonObject: IApiClassJson): void; | ||
static onDeserializeInto(options: Partial<IApiClassOptions>, context: DeserializerContext, jsonObject: IApiClassJson): void; | ||
constructor(options: IApiClassOptions); | ||
@@ -50,0 +52,0 @@ /** @override */ |
@@ -10,2 +10,3 @@ "use strict"; | ||
const ApiNameMixin_1 = require("../mixins/ApiNameMixin"); | ||
const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin"); | ||
/** | ||
@@ -27,3 +28,3 @@ * Represents a TypeScript class declaration. | ||
*/ | ||
class ApiClass extends ApiItemContainerMixin_1.ApiItemContainerMixin(ApiNameMixin_1.ApiNameMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiDeclaredItem_1.ApiDeclaredItem))) { | ||
class ApiClass extends ApiItemContainerMixin_1.ApiItemContainerMixin(ApiNameMixin_1.ApiNameMixin(ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiDeclaredItem_1.ApiDeclaredItem)))) { | ||
constructor(options) { | ||
@@ -46,4 +47,4 @@ super(options); | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
super.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
super.onDeserializeInto(options, context, jsonObject); | ||
options.extendsTokenRange = jsonObject.extendsTokenRange; | ||
@@ -50,0 +51,0 @@ options.implementsTokenRanges = jsonObject.implementsTokenRanges; |
@@ -6,2 +6,3 @@ import { ApiItemKind } from '../items/ApiItem'; | ||
import { IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin'; | ||
import { ApiTypeParameterListMixin, IApiTypeParameterListMixinOptions } from '../mixins/ApiTypeParameterListMixin'; | ||
/** | ||
@@ -11,5 +12,5 @@ * Constructor options for {@link ApiConstructor}. | ||
*/ | ||
export interface IApiConstructSignatureOptions extends IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { | ||
export interface IApiConstructSignatureOptions extends IApiTypeParameterListMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { | ||
} | ||
declare const ApiConstructSignature_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin); | ||
declare const ApiConstructSignature_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin) & (new (...args: any[]) => ApiTypeParameterListMixin); | ||
/** | ||
@@ -16,0 +17,0 @@ * Represents a TypeScript construct signature that belongs to an `ApiInterface`. |
@@ -9,2 +9,3 @@ "use strict"; | ||
const ApiReturnTypeMixin_1 = require("../mixins/ApiReturnTypeMixin"); | ||
const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin"); | ||
/** | ||
@@ -52,3 +53,3 @@ * Represents a TypeScript construct signature that belongs to an `ApiInterface`. | ||
*/ | ||
class ApiConstructSignature extends ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem))) { | ||
class ApiConstructSignature extends ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem)))) { | ||
static getCanonicalReference(overloadIndex) { | ||
@@ -55,0 +56,0 @@ return `(:new,${overloadIndex})`; |
@@ -6,2 +6,3 @@ import { ApiItemKind } from '../items/ApiItem'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { DeserializerContext } from './DeserializerContext'; | ||
/** | ||
@@ -45,3 +46,3 @@ * Constructor options for {@link ApiEnumMember}. | ||
/** @override */ | ||
static onDeserializeInto(options: Partial<IApiEnumMemberOptions>, jsonObject: IApiEnumMemberJson): void; | ||
static onDeserializeInto(options: Partial<IApiEnumMemberOptions>, context: DeserializerContext, jsonObject: IApiEnumMemberJson): void; | ||
constructor(options: IApiEnumMemberOptions); | ||
@@ -48,0 +49,0 @@ /** @override */ |
@@ -33,4 +33,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
super.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
super.onDeserializeInto(options, context, jsonObject); | ||
options.initializerTokenRange = jsonObject.initializerTokenRange; | ||
@@ -37,0 +37,0 @@ } |
@@ -7,2 +7,3 @@ import { ApiItemKind } from '../items/ApiItem'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { IApiTypeParameterListMixinOptions, ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin'; | ||
/** | ||
@@ -12,5 +13,5 @@ * Constructor options for {@link ApiFunction}. | ||
*/ | ||
export interface IApiFunctionOptions extends IApiNameMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { | ||
export interface IApiFunctionOptions extends IApiNameMixinOptions, IApiTypeParameterListMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { | ||
} | ||
declare const ApiFunction_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin) & (new (...args: any[]) => ApiNameMixin); | ||
declare const ApiFunction_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin) & (new (...args: any[]) => ApiTypeParameterListMixin) & (new (...args: any[]) => ApiNameMixin); | ||
/** | ||
@@ -17,0 +18,0 @@ * Represents a TypeScript function declaration. |
@@ -10,2 +10,3 @@ "use strict"; | ||
const ApiNameMixin_1 = require("../mixins/ApiNameMixin"); | ||
const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin"); | ||
/** | ||
@@ -32,3 +33,3 @@ * Represents a TypeScript function declaration. | ||
*/ | ||
class ApiFunction extends ApiNameMixin_1.ApiNameMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem)))) { | ||
class ApiFunction extends ApiNameMixin_1.ApiNameMixin(ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem))))) { | ||
static getCanonicalReference(name, overloadIndex) { | ||
@@ -35,0 +36,0 @@ return `(${name}:${overloadIndex})`; |
import { ApiItemKind } from '../items/ApiItem'; | ||
import { ApiItemContainerMixin, IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin'; | ||
import { ApiItemContainerMixin, IApiItemContainerMixinOptions, IApiItemContainerJson } from '../mixins/ApiItemContainerMixin'; | ||
import { ApiDeclaredItem, IApiDeclaredItemOptions, IApiDeclaredItemJson } from '../items/ApiDeclaredItem'; | ||
import { IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin'; | ||
import { IApiReleaseTagMixinOptions, ApiReleaseTagMixin, IApiReleaseTagMixinJson } from '../mixins/ApiReleaseTagMixin'; | ||
import { IExcerptTokenRange } from '../mixins/Excerpt'; | ||
import { HeritageType } from './HeritageType'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { IApiNameMixinOptions, ApiNameMixin, IApiNameMixinJson } from '../mixins/ApiNameMixin'; | ||
import { IApiTypeParameterListMixinOptions, IApiTypeParameterListMixinJson, ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin'; | ||
import { DeserializerContext } from './DeserializerContext'; | ||
/** | ||
@@ -12,9 +14,9 @@ * Constructor options for {@link ApiInterface}. | ||
*/ | ||
export interface IApiInterfaceOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions { | ||
export interface IApiInterfaceOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions, IApiTypeParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions { | ||
extendsTokenRanges: IExcerptTokenRange[]; | ||
} | ||
export interface IApiInterfaceJson extends IApiDeclaredItemJson { | ||
export interface IApiInterfaceJson extends IApiItemContainerJson, IApiNameMixinJson, IApiTypeParameterListMixinJson, IApiReleaseTagMixinJson, IApiDeclaredItemJson { | ||
extendsTokenRanges: IExcerptTokenRange[]; | ||
} | ||
declare const ApiInterface_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin) & (new (...args: any[]) => ApiItemContainerMixin); | ||
declare const ApiInterface_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiTypeParameterListMixin) & (new (...args: any[]) => ApiNameMixin) & (new (...args: any[]) => ApiItemContainerMixin); | ||
/** | ||
@@ -41,3 +43,3 @@ * Represents a TypeScript class declaration. | ||
/** @override */ | ||
static onDeserializeInto(options: Partial<IApiInterfaceOptions>, jsonObject: IApiInterfaceJson): void; | ||
static onDeserializeInto(options: Partial<IApiInterfaceOptions>, context: DeserializerContext, jsonObject: IApiInterfaceJson): void; | ||
constructor(options: IApiInterfaceOptions); | ||
@@ -44,0 +46,0 @@ /** @override */ |
@@ -10,2 +10,3 @@ "use strict"; | ||
const ApiNameMixin_1 = require("../mixins/ApiNameMixin"); | ||
const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin"); | ||
/** | ||
@@ -28,3 +29,3 @@ * Represents a TypeScript class declaration. | ||
*/ | ||
class ApiInterface extends ApiItemContainerMixin_1.ApiItemContainerMixin(ApiNameMixin_1.ApiNameMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiDeclaredItem_1.ApiDeclaredItem))) { | ||
class ApiInterface extends ApiItemContainerMixin_1.ApiItemContainerMixin(ApiNameMixin_1.ApiNameMixin(ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiDeclaredItem_1.ApiDeclaredItem)))) { | ||
constructor(options) { | ||
@@ -41,4 +42,4 @@ super(options); | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
super.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
super.onDeserializeInto(options, context, jsonObject); | ||
options.extendsTokenRanges = jsonObject.extendsTokenRanges; | ||
@@ -45,0 +46,0 @@ } |
@@ -8,2 +8,3 @@ import { ApiItemKind } from '../items/ApiItem'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { ApiTypeParameterListMixin, IApiTypeParameterListMixinOptions } from '../mixins/ApiTypeParameterListMixin'; | ||
/** | ||
@@ -13,5 +14,5 @@ * Constructor options for {@link ApiMethod}. | ||
*/ | ||
export interface IApiMethodOptions extends IApiNameMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiStaticMixinOptions, IApiDeclaredItemOptions { | ||
export interface IApiMethodOptions extends IApiNameMixinOptions, IApiTypeParameterListMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiStaticMixinOptions, IApiDeclaredItemOptions { | ||
} | ||
declare const ApiMethod_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiStaticMixin) & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin) & (new (...args: any[]) => ApiNameMixin); | ||
declare const ApiMethod_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiStaticMixin) & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin) & (new (...args: any[]) => ApiTypeParameterListMixin) & (new (...args: any[]) => ApiNameMixin); | ||
/** | ||
@@ -18,0 +19,0 @@ * Represents a TypeScript member function declaration that belongs to an `ApiClass`. |
@@ -11,2 +11,3 @@ "use strict"; | ||
const ApiNameMixin_1 = require("../mixins/ApiNameMixin"); | ||
const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin"); | ||
/** | ||
@@ -33,3 +34,3 @@ * Represents a TypeScript member function declaration that belongs to an `ApiClass`. | ||
*/ | ||
class ApiMethod extends ApiNameMixin_1.ApiNameMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiStaticMixin_1.ApiStaticMixin(ApiDeclaredItem_1.ApiDeclaredItem))))) { | ||
class ApiMethod extends ApiNameMixin_1.ApiNameMixin(ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiStaticMixin_1.ApiStaticMixin(ApiDeclaredItem_1.ApiDeclaredItem)))))) { | ||
static getCanonicalReference(name, isStatic, overloadIndex) { | ||
@@ -36,0 +37,0 @@ if (isStatic) { |
@@ -7,6 +7,7 @@ import { ApiItemKind } from '../items/ApiItem'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { IApiTypeParameterListMixinOptions, ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin'; | ||
/** @public */ | ||
export interface IApiMethodSignatureOptions extends IApiNameMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { | ||
export interface IApiMethodSignatureOptions extends IApiNameMixinOptions, IApiTypeParameterListMixinOptions, IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions { | ||
} | ||
declare const ApiMethodSignature_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin) & (new (...args: any[]) => ApiNameMixin); | ||
declare const ApiMethodSignature_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin) & (new (...args: any[]) => ApiTypeParameterListMixin) & (new (...args: any[]) => ApiNameMixin); | ||
/** | ||
@@ -13,0 +14,0 @@ * Represents a TypeScript member function declaration that belongs to an `ApiInterface`. |
@@ -10,2 +10,3 @@ "use strict"; | ||
const ApiNameMixin_1 = require("../mixins/ApiNameMixin"); | ||
const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin"); | ||
/** | ||
@@ -32,3 +33,3 @@ * Represents a TypeScript member function declaration that belongs to an `ApiInterface`. | ||
*/ | ||
class ApiMethodSignature extends ApiNameMixin_1.ApiNameMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem)))) { | ||
class ApiMethodSignature extends ApiNameMixin_1.ApiNameMixin(ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem))))) { | ||
static getCanonicalReference(name, overloadIndex) { | ||
@@ -35,0 +36,0 @@ return `(${name}:${overloadIndex})`; |
@@ -7,2 +7,3 @@ import { ApiItemKind, IApiItemJson } from '../items/ApiItem'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { ApiJsonSchemaVersion } from './DeserializerContext'; | ||
/** | ||
@@ -14,8 +15,2 @@ * Constructor options for {@link ApiPackage}. | ||
} | ||
export declare enum ApiJsonSchemaVersion { | ||
/** | ||
* The initial release. | ||
*/ | ||
V_1000 = 1000 | ||
} | ||
export interface IApiPackageMetadataJson { | ||
@@ -33,6 +28,21 @@ /** | ||
/** | ||
* The *.api.json schema version. Used for determining whether the file format is | ||
* The schema version for the .api.json file format. Used for determining whether the file format is | ||
* supported, and for backwards compatibility. | ||
*/ | ||
schemaVersion: ApiJsonSchemaVersion; | ||
/** | ||
* To support forwards compatibility, the `oldestForwardsCompatibleVersion` field tracks the oldest schema version | ||
* whose corresponding deserializer could safely load this file. | ||
* | ||
* @remarks | ||
* Normally api-extractor-model should refuse to load a schema version that is newer than the latest version | ||
* that its deserializer understands. However, sometimes a schema change may merely introduce some new fields | ||
* without modifying or removing any existing fields. In this case, an older api-extractor-model library can | ||
* safely deserialize the newer version (by ignoring the extra fields that it doesn't recognize). The newer | ||
* serializer can use this field to communicate that. | ||
* | ||
* If present, the `oldestForwardsCompatibleVersion` must be less than or equal to | ||
* `IApiPackageMetadataJson.schemaVersion`. | ||
*/ | ||
oldestForwardsCompatibleVersion?: ApiJsonSchemaVersion; | ||
} | ||
@@ -39,0 +49,0 @@ export interface IApiPackageJson extends IApiItemJson { |
@@ -10,9 +10,3 @@ "use strict"; | ||
const ApiNameMixin_1 = require("../mixins/ApiNameMixin"); | ||
var ApiJsonSchemaVersion; | ||
(function (ApiJsonSchemaVersion) { | ||
/** | ||
* The initial release. | ||
*/ | ||
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1000"] = 1000] = "V_1000"; | ||
})(ApiJsonSchemaVersion = exports.ApiJsonSchemaVersion || (exports.ApiJsonSchemaVersion = {})); | ||
const DeserializerContext_1 = require("./DeserializerContext"); | ||
/** | ||
@@ -31,3 +25,42 @@ * Represents an NPM package containing API declarations. | ||
const jsonObject = node_core_library_1.JsonFile.load(apiJsonFilename); | ||
return ApiItem_1.ApiItem.deserialize(jsonObject); | ||
if (!jsonObject | ||
|| !jsonObject.metadata | ||
|| typeof jsonObject.metadata.schemaVersion !== 'number') { | ||
throw new Error(`Error loading ${apiJsonFilename}:` | ||
+ `\nThe file format is not recognized; the "metadata.schemaVersion" field is missing or invalid`); | ||
} | ||
const schemaVersion = jsonObject.metadata.schemaVersion; | ||
if (schemaVersion < DeserializerContext_1.ApiJsonSchemaVersion.OLDEST_SUPPORTED) { | ||
throw new Error(`Error loading ${apiJsonFilename}:` | ||
+ `\nThe file format is version ${schemaVersion},` | ||
+ ` whereas ${DeserializerContext_1.ApiJsonSchemaVersion.OLDEST_SUPPORTED} is the oldest version supported by this tool`); | ||
} | ||
let oldestForwardsCompatibleVersion = schemaVersion; | ||
if (jsonObject.metadata.oldestForwardsCompatibleVersion) { | ||
// Sanity check | ||
if (jsonObject.metadata.oldestForwardsCompatibleVersion > schemaVersion) { | ||
throw new Error(`Error loading ${apiJsonFilename}:` | ||
+ `\nInvalid file format; "oldestForwardsCompatibleVersion" cannot be newer than "schemaVersion"`); | ||
} | ||
oldestForwardsCompatibleVersion = jsonObject.metadata.oldestForwardsCompatibleVersion; | ||
} | ||
let versionToDeserialize = schemaVersion; | ||
if (versionToDeserialize > DeserializerContext_1.ApiJsonSchemaVersion.LATEST) { | ||
// If the file format is too new, can we treat it as some earlier compatible version | ||
// as indicated by oldestForwardsCompatibleVersion? | ||
versionToDeserialize = Math.max(oldestForwardsCompatibleVersion, DeserializerContext_1.ApiJsonSchemaVersion.LATEST); | ||
if (versionToDeserialize > DeserializerContext_1.ApiJsonSchemaVersion.LATEST) { | ||
// Nope, still too new | ||
throw new Error(`Error loading ${apiJsonFilename}:` | ||
+ `\nThe file format version ${schemaVersion} was written by a newer release of` | ||
+ ` the api-extractor-model library; you may need to upgrade your software`); | ||
} | ||
} | ||
const context = new DeserializerContext_1.DeserializerContext({ | ||
apiJsonFilename, | ||
toolPackage: jsonObject.metadata.toolPackage, | ||
toolVersion: jsonObject.metadata.toolVersion, | ||
versionToDeserialize: versionToDeserialize | ||
}); | ||
return ApiItem_1.ApiItem.deserialize(jsonObject, context); | ||
} | ||
@@ -67,5 +100,6 @@ constructor(options) { | ||
// In test mode, we don't write the real version, since that would cause spurious diffs whenever | ||
// the verison is bumped. Instead we write a placeholder string. | ||
// the version is bumped. Instead we write a placeholder string. | ||
toolVersion: options.testMode ? '[test mode]' : options.toolVersion || packageJson.version, | ||
schemaVersion: ApiJsonSchemaVersion.V_1000 | ||
schemaVersion: DeserializerContext_1.ApiJsonSchemaVersion.LATEST, | ||
oldestForwardsCompatibleVersion: DeserializerContext_1.ApiJsonSchemaVersion.OLDEST_FORWARDS_COMPATIBLE | ||
} | ||
@@ -72,0 +106,0 @@ }; |
@@ -0,5 +1,8 @@ | ||
import { Excerpt, IExcerptTokenRange } from '../mixins/Excerpt'; | ||
import { ApiItemKind } from '../items/ApiItem'; | ||
import { ApiDeclaredItem, IApiDeclaredItemOptions } from '../items/ApiDeclaredItem'; | ||
import { ApiDeclaredItem, IApiDeclaredItemOptions, IApiDeclaredItemJson } from '../items/ApiDeclaredItem'; | ||
import { ApiReleaseTagMixin, IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin'; | ||
import { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin'; | ||
import { ApiTypeParameterListMixin, IApiTypeParameterListMixinOptions, IApiTypeParameterListMixinJson } from '../mixins/ApiTypeParameterListMixin'; | ||
import { DeserializerContext } from './DeserializerContext'; | ||
/** | ||
@@ -9,5 +12,9 @@ * Constructor options for {@link ApiTypeAlias}. | ||
*/ | ||
export interface IApiTypeAliasOptions extends IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions { | ||
export interface IApiTypeAliasOptions extends IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions, IApiTypeParameterListMixinOptions { | ||
typeTokenRange: IExcerptTokenRange; | ||
} | ||
declare const ApiTypeAlias_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin); | ||
export interface IApiTypeAliasJson extends IApiDeclaredItemJson, IApiTypeParameterListMixinJson { | ||
typeTokenRange: IExcerptTokenRange; | ||
} | ||
declare const ApiTypeAlias_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin) & (new (...args: any[]) => ApiTypeParameterListMixin); | ||
/** | ||
@@ -40,2 +47,16 @@ * Represents a TypeScript type alias declaration. | ||
export declare class ApiTypeAlias extends ApiTypeAlias_base { | ||
/** | ||
* An {@link Excerpt} that describes the type of the alias. | ||
* | ||
* @remarks | ||
* In the example below, the `typeExcerpt` would correspond to the subexpression | ||
* `T extends any[] ? BoxedArray<T[number]> : BoxedValue<T>;`: | ||
* | ||
* ```ts | ||
* export type Boxed<T> = T extends any[] ? BoxedArray<T[number]> : BoxedValue<T>; | ||
* ``` | ||
*/ | ||
readonly typeExcerpt: Excerpt; | ||
/** @override */ | ||
static onDeserializeInto(options: Partial<IApiTypeAliasOptions>, context: DeserializerContext, jsonObject: IApiTypeAliasJson): void; | ||
static getCanonicalReference(name: string): string; | ||
@@ -47,4 +68,6 @@ constructor(options: IApiTypeAliasOptions); | ||
readonly canonicalReference: string; | ||
/** @override */ | ||
serializeInto(jsonObject: Partial<IApiTypeAliasJson>): void; | ||
} | ||
export {}; | ||
//# sourceMappingURL=ApiTypeAlias.d.ts.map |
@@ -8,2 +8,3 @@ "use strict"; | ||
const ApiNameMixin_1 = require("../mixins/ApiNameMixin"); | ||
const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin"); | ||
/** | ||
@@ -35,3 +36,8 @@ * Represents a TypeScript type alias declaration. | ||
*/ | ||
class ApiTypeAlias extends ApiNameMixin_1.ApiNameMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiDeclaredItem_1.ApiDeclaredItem)) { | ||
class ApiTypeAlias extends ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiNameMixin_1.ApiNameMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiDeclaredItem_1.ApiDeclaredItem))) { | ||
/** @override */ | ||
static onDeserializeInto(options, context, jsonObject) { | ||
super.onDeserializeInto(options, context, jsonObject); | ||
options.typeTokenRange = jsonObject.typeTokenRange; | ||
} | ||
static getCanonicalReference(name) { | ||
@@ -42,2 +48,3 @@ return name; | ||
super(options); | ||
this.typeExcerpt = this.buildExcerpt(options.typeTokenRange); | ||
} | ||
@@ -52,4 +59,9 @@ /** @override */ | ||
} | ||
/** @override */ | ||
serializeInto(jsonObject) { | ||
super.serializeInto(jsonObject); | ||
jsonObject.typeTokenRange = this.typeExcerpt.tokenRange; | ||
} | ||
} | ||
exports.ApiTypeAlias = ApiTypeAlias; | ||
//# sourceMappingURL=ApiTypeAlias.js.map |
@@ -6,2 +6,3 @@ import { ApiItemKind } from '../items/ApiItem'; | ||
import { IExcerptTokenRange, Excerpt } from '../mixins/Excerpt'; | ||
import { DeserializerContext } from './DeserializerContext'; | ||
/** | ||
@@ -44,3 +45,3 @@ * Constructor options for {@link ApiVariable}. | ||
/** @override */ | ||
static onDeserializeInto(options: Partial<IApiVariableOptions>, jsonObject: IApiVariableJson): void; | ||
static onDeserializeInto(options: Partial<IApiVariableOptions>, context: DeserializerContext, jsonObject: IApiVariableJson): void; | ||
static getCanonicalReference(name: string): string; | ||
@@ -47,0 +48,0 @@ constructor(options: IApiVariableOptions); |
@@ -30,4 +30,4 @@ "use strict"; | ||
/** @override */ | ||
static onDeserializeInto(options, jsonObject) { | ||
super.onDeserializeInto(options, jsonObject); | ||
static onDeserializeInto(options, context, jsonObject) { | ||
super.onDeserializeInto(options, context, jsonObject); | ||
options.variableTypeTokenRange = jsonObject.variableTypeTokenRange; | ||
@@ -34,0 +34,0 @@ } |
import { IApiItemJson, ApiItem } from '../items/ApiItem'; | ||
import { DeserializerContext } from './DeserializerContext'; | ||
export declare class Deserializer { | ||
static deserialize(jsonObject: IApiItemJson): ApiItem; | ||
static deserialize(context: DeserializerContext, jsonObject: IApiItemJson): ApiItem; | ||
} | ||
//# sourceMappingURL=Deserializer.d.ts.map |
@@ -25,40 +25,40 @@ "use strict"; | ||
class Deserializer { | ||
static deserialize(jsonObject) { | ||
static deserialize(context, jsonObject) { | ||
const options = {}; | ||
switch (jsonObject.kind) { | ||
case "Class" /* Class */: | ||
ApiClass_1.ApiClass.onDeserializeInto(options, jsonObject); | ||
ApiClass_1.ApiClass.onDeserializeInto(options, context, jsonObject); | ||
return new ApiClass_1.ApiClass(options); | ||
case "CallSignature" /* CallSignature */: | ||
ApiCallSignature_1.ApiCallSignature.onDeserializeInto(options, jsonObject); | ||
ApiCallSignature_1.ApiCallSignature.onDeserializeInto(options, context, jsonObject); | ||
return new ApiCallSignature_1.ApiCallSignature(options); | ||
case "Constructor" /* Constructor */: | ||
ApiConstructor_1.ApiConstructor.onDeserializeInto(options, jsonObject); | ||
ApiConstructor_1.ApiConstructor.onDeserializeInto(options, context, jsonObject); | ||
return new ApiConstructor_1.ApiConstructor(options); | ||
case "ConstructSignature" /* ConstructSignature */: | ||
ApiConstructSignature_1.ApiConstructSignature.onDeserializeInto(options, jsonObject); | ||
ApiConstructSignature_1.ApiConstructSignature.onDeserializeInto(options, context, jsonObject); | ||
return new ApiConstructSignature_1.ApiConstructSignature(options); | ||
case "EntryPoint" /* EntryPoint */: | ||
ApiEntryPoint_1.ApiEntryPoint.onDeserializeInto(options, jsonObject); | ||
ApiEntryPoint_1.ApiEntryPoint.onDeserializeInto(options, context, jsonObject); | ||
return new ApiEntryPoint_1.ApiEntryPoint(options); | ||
case "Enum" /* Enum */: | ||
ApiEnum_1.ApiEnum.onDeserializeInto(options, jsonObject); | ||
ApiEnum_1.ApiEnum.onDeserializeInto(options, context, jsonObject); | ||
return new ApiEnum_1.ApiEnum(options); | ||
case "EnumMember" /* EnumMember */: | ||
ApiEnumMember_1.ApiEnumMember.onDeserializeInto(options, jsonObject); | ||
ApiEnumMember_1.ApiEnumMember.onDeserializeInto(options, context, jsonObject); | ||
return new ApiEnumMember_1.ApiEnumMember(options); | ||
case "Function" /* Function */: | ||
ApiFunction_1.ApiFunction.onDeserializeInto(options, jsonObject); | ||
ApiFunction_1.ApiFunction.onDeserializeInto(options, context, jsonObject); | ||
return new ApiFunction_1.ApiFunction(options); | ||
case "IndexSignature" /* IndexSignature */: | ||
ApiIndexSignature_1.ApiIndexSignature.onDeserializeInto(options, jsonObject); | ||
ApiIndexSignature_1.ApiIndexSignature.onDeserializeInto(options, context, jsonObject); | ||
return new ApiIndexSignature_1.ApiIndexSignature(options); | ||
case "Interface" /* Interface */: | ||
ApiInterface_1.ApiInterface.onDeserializeInto(options, jsonObject); | ||
ApiInterface_1.ApiInterface.onDeserializeInto(options, context, jsonObject); | ||
return new ApiInterface_1.ApiInterface(options); | ||
case "Method" /* Method */: | ||
ApiMethod_1.ApiMethod.onDeserializeInto(options, jsonObject); | ||
ApiMethod_1.ApiMethod.onDeserializeInto(options, context, jsonObject); | ||
return new ApiMethod_1.ApiMethod(options); | ||
case "MethodSignature" /* MethodSignature */: | ||
ApiMethodSignature_1.ApiMethodSignature.onDeserializeInto(options, jsonObject); | ||
ApiMethodSignature_1.ApiMethodSignature.onDeserializeInto(options, context, jsonObject); | ||
return new ApiMethodSignature_1.ApiMethodSignature(options); | ||
@@ -68,18 +68,18 @@ case "Model" /* Model */: | ||
case "Namespace" /* Namespace */: | ||
ApiNamespace_1.ApiNamespace.onDeserializeInto(options, jsonObject); | ||
ApiNamespace_1.ApiNamespace.onDeserializeInto(options, context, jsonObject); | ||
return new ApiNamespace_1.ApiNamespace(options); | ||
case "Package" /* Package */: | ||
ApiPackage_1.ApiPackage.onDeserializeInto(options, jsonObject); | ||
ApiPackage_1.ApiPackage.onDeserializeInto(options, context, jsonObject); | ||
return new ApiPackage_1.ApiPackage(options); | ||
case "Property" /* Property */: | ||
ApiProperty_1.ApiProperty.onDeserializeInto(options, jsonObject); | ||
ApiProperty_1.ApiProperty.onDeserializeInto(options, context, jsonObject); | ||
return new ApiProperty_1.ApiProperty(options); | ||
case "PropertySignature" /* PropertySignature */: | ||
ApiPropertySignature_1.ApiPropertySignature.onDeserializeInto(options, jsonObject); | ||
ApiPropertySignature_1.ApiPropertySignature.onDeserializeInto(options, context, jsonObject); | ||
return new ApiPropertySignature_1.ApiPropertySignature(options); | ||
case "TypeAlias" /* TypeAlias */: | ||
ApiTypeAlias_1.ApiTypeAlias.onDeserializeInto(options, jsonObject); | ||
ApiTypeAlias_1.ApiTypeAlias.onDeserializeInto(options, context, jsonObject); | ||
return new ApiTypeAlias_1.ApiTypeAlias(options); | ||
case "Variable" /* Variable */: | ||
ApiVariable_1.ApiVariable.onDeserializeInto(options, jsonObject); | ||
ApiVariable_1.ApiVariable.onDeserializeInto(options, context, jsonObject); | ||
return new ApiVariable_1.ApiVariable(options); | ||
@@ -86,0 +86,0 @@ default: |
{ | ||
"name": "@microsoft/api-extractor-model", | ||
"version": "7.1.3", | ||
"version": "7.2.0", | ||
"description": "A helper library for loading and saving the .api.json files created by API Extractor", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
522564
171
6925