@microsoft/api-extractor-model 7.18.2 → 7.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rollup.d.ts +137 -21
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/items/ApiItem.d.ts +11 -1
- package/lib/items/ApiItem.d.ts.map +1 -1
- package/lib/items/ApiItem.js +11 -1
- package/lib/items/ApiItem.js.map +1 -1
- package/lib/mixins/ApiInitializerMixin.d.ts +61 -0
- package/lib/mixins/ApiInitializerMixin.d.ts.map +1 -0
- package/lib/mixins/ApiInitializerMixin.js +73 -0
- package/lib/mixins/ApiInitializerMixin.js.map +1 -0
- package/lib/mixins/ApiItemContainerMixin.d.ts +16 -0
- package/lib/mixins/ApiItemContainerMixin.d.ts.map +1 -1
- package/lib/mixins/ApiItemContainerMixin.js +10 -1
- package/lib/mixins/ApiItemContainerMixin.js.map +1 -1
- package/lib/model/ApiEnumMember.d.ts +29 -16
- package/lib/model/ApiEnumMember.d.ts.map +1 -1
- package/lib/model/ApiEnumMember.js +30 -13
- package/lib/model/ApiEnumMember.js.map +1 -1
- package/lib/model/ApiProperty.d.ts +3 -2
- package/lib/model/ApiProperty.d.ts.map +1 -1
- package/lib/model/ApiProperty.js +2 -1
- package/lib/model/ApiProperty.js.map +1 -1
- package/lib/model/ApiVariable.d.ts +3 -2
- package/lib/model/ApiVariable.d.ts.map +1 -1
- package/lib/model/ApiVariable.js +2 -1
- package/lib/model/ApiVariable.js.map +1 -1
- package/lib/model/Deserializer.js.map +1 -1
- package/lib/model/DeserializerContext.d.ts +14 -1
- package/lib/model/DeserializerContext.d.ts.map +1 -1
- package/lib/model/DeserializerContext.js +14 -1
- package/lib/model/DeserializerContext.js.map +1 -1
- package/package.json +2 -2
package/dist/rollup.d.ts
CHANGED
|
@@ -375,25 +375,17 @@ declare const ApiEnum_base: typeof ApiDeclaredItem & (new (...args: any[]) => Ap
|
|
|
375
375
|
* @public
|
|
376
376
|
*/
|
|
377
377
|
export declare class ApiEnumMember extends ApiEnumMember_base {
|
|
378
|
-
/**
|
|
379
|
-
* An {@link Excerpt} that describes the value of the enum member.
|
|
380
|
-
*/
|
|
381
|
-
readonly initializerExcerpt: Excerpt;
|
|
382
378
|
constructor(options: IApiEnumMemberOptions);
|
|
383
379
|
static getContainerKey(name: string): string;
|
|
384
380
|
/** @override */
|
|
385
|
-
static onDeserializeInto(options: Partial<IApiEnumMemberOptions>, context: DeserializerContext, jsonObject: IApiEnumMemberJson): void;
|
|
386
|
-
/** @override */
|
|
387
381
|
get kind(): ApiItemKind;
|
|
388
382
|
/** @override */
|
|
389
383
|
get containerKey(): string;
|
|
390
|
-
/** @override */
|
|
391
|
-
serializeInto(jsonObject: Partial<IApiEnumMemberJson>): void;
|
|
392
384
|
/** @beta @override */
|
|
393
385
|
buildCanonicalReference(): DeclarationReference;
|
|
394
386
|
}
|
|
395
387
|
|
|
396
|
-
declare const ApiEnumMember_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin);
|
|
388
|
+
declare const ApiEnumMember_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiInitializerMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin);
|
|
397
389
|
|
|
398
390
|
/**
|
|
399
391
|
* Represents a TypeScript function declaration.
|
|
@@ -464,6 +456,57 @@ export declare class ApiIndexSignature extends ApiIndexSignature_base {
|
|
|
464
456
|
|
|
465
457
|
declare const ApiIndexSignature_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReturnTypeMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiParameterListMixin);
|
|
466
458
|
|
|
459
|
+
/**
|
|
460
|
+
* Mixin function for {@link (ApiInitializerMixin:interface)}.
|
|
461
|
+
*
|
|
462
|
+
* @param baseClass - The base class to be extended
|
|
463
|
+
* @returns A child class that extends baseClass, adding the {@link (ApiInitializerMixin:interface)} functionality.
|
|
464
|
+
*
|
|
465
|
+
* @public
|
|
466
|
+
*/
|
|
467
|
+
export declare function ApiInitializerMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiInitializerMixin);
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* The mixin base class for API items that can have an initializer.
|
|
471
|
+
*
|
|
472
|
+
* @remarks
|
|
473
|
+
*
|
|
474
|
+
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
|
|
475
|
+
* API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use
|
|
476
|
+
* TypeScript "mixin" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various
|
|
477
|
+
* features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class
|
|
478
|
+
* to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components:
|
|
479
|
+
* the function that generates a subclass, an interface that describes the members of the subclass, and
|
|
480
|
+
* a namespace containing static members of the class.
|
|
481
|
+
*
|
|
482
|
+
* @public
|
|
483
|
+
*/
|
|
484
|
+
export declare interface ApiInitializerMixin extends ApiItem {
|
|
485
|
+
/**
|
|
486
|
+
* An {@link Excerpt} that describes the item's initializer.
|
|
487
|
+
*/
|
|
488
|
+
readonly initializerExcerpt?: Excerpt;
|
|
489
|
+
/** @override */
|
|
490
|
+
serializeInto(jsonObject: Partial<IApiInitializerMixinJson>): void;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Static members for {@link (ApiInitializerMixin:interface)}.
|
|
495
|
+
* @public
|
|
496
|
+
*/
|
|
497
|
+
export declare namespace ApiInitializerMixin {
|
|
498
|
+
/**
|
|
499
|
+
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiInitializerMixin` mixin.
|
|
500
|
+
*
|
|
501
|
+
* @remarks
|
|
502
|
+
*
|
|
503
|
+
* The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
|
|
504
|
+
* the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
|
|
505
|
+
* the TypeScript type system cannot invoke a runtime test.)
|
|
506
|
+
*/
|
|
507
|
+
export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiInitializerMixin;
|
|
508
|
+
}
|
|
509
|
+
|
|
467
510
|
/**
|
|
468
511
|
* Represents a TypeScript class declaration.
|
|
469
512
|
*
|
|
@@ -598,7 +641,17 @@ export declare class ApiItem {
|
|
|
598
641
|
* Otherwise undefined is returned.
|
|
599
642
|
*/
|
|
600
643
|
getAssociatedPackage(): ApiPackage | undefined;
|
|
601
|
-
/**
|
|
644
|
+
/**
|
|
645
|
+
* A text string whose value determines the sort order that is automatically applied by the
|
|
646
|
+
* {@link (ApiItemContainerMixin:interface)} class.
|
|
647
|
+
*
|
|
648
|
+
* @remarks
|
|
649
|
+
* The value of this string is undocumented and may change at any time.
|
|
650
|
+
* If {@link (ApiItemContainerMixin:interface).preserveMemberOrder} is enabled for the `ApiItem`'s parent,
|
|
651
|
+
* then no sorting is performed, and this key is not used.
|
|
652
|
+
*
|
|
653
|
+
* @virtual
|
|
654
|
+
*/
|
|
602
655
|
getSortKey(): string;
|
|
603
656
|
/**
|
|
604
657
|
* PRIVATE
|
|
@@ -649,6 +702,20 @@ export declare function ApiItemContainerMixin<TBaseClass extends IApiItemConstru
|
|
|
649
702
|
* @public
|
|
650
703
|
*/
|
|
651
704
|
export declare interface ApiItemContainerMixin extends ApiItem {
|
|
705
|
+
/**
|
|
706
|
+
* Disables automatic sorting of {@link ApiItem.members}.
|
|
707
|
+
*
|
|
708
|
+
* @remarks
|
|
709
|
+
* By default `ApiItemContainerMixin` will automatically sort its members according to their
|
|
710
|
+
* {@link ApiItem.getSortKey} string, which provides a standardized mostly alphabetical ordering
|
|
711
|
+
* that is appropriate for most API items. When loading older .api.json files the automatic sorting
|
|
712
|
+
* is reapplied and may update the ordering.
|
|
713
|
+
*
|
|
714
|
+
* Set `preserveMemberOrder` to true to disable automatic sorting for this container; instead, the
|
|
715
|
+
* members will retain whatever ordering appeared in the {@link IApiItemContainerMixinOptions.members} array.
|
|
716
|
+
* The `preserveMemberOrder` option is saved in the .api.json file.
|
|
717
|
+
*/
|
|
718
|
+
readonly preserveMemberOrder: boolean;
|
|
652
719
|
/**
|
|
653
720
|
* Adds a new member to the container.
|
|
654
721
|
*
|
|
@@ -768,13 +835,26 @@ declare enum ApiJsonSchemaVersion {
|
|
|
768
835
|
* When loading older JSON files, the values default to `false`.
|
|
769
836
|
*/
|
|
770
837
|
V_1006 = 1006,
|
|
838
|
+
/**
|
|
839
|
+
* Add `ApiItemContainerMixin.preserveMemberOrder` to support enums that preserve their original sort order.
|
|
840
|
+
*
|
|
841
|
+
* When loading older JSON files, the value default to `false`.
|
|
842
|
+
*/
|
|
843
|
+
V_1007 = 1007,
|
|
844
|
+
/**
|
|
845
|
+
* Add an `initializerTokenRange` field to `ApiProperty` and `ApiVariable` to track the item's
|
|
846
|
+
* initializer.
|
|
847
|
+
*
|
|
848
|
+
* When loading older JSON files, this range is empty.
|
|
849
|
+
*/
|
|
850
|
+
V_1008 = 1008,
|
|
771
851
|
/**
|
|
772
852
|
* The current latest .api.json schema version.
|
|
773
853
|
*
|
|
774
854
|
* IMPORTANT: When incrementing this number, consider whether `OLDEST_SUPPORTED` or `OLDEST_FORWARDS_COMPATIBLE`
|
|
775
855
|
* should be updated.
|
|
776
856
|
*/
|
|
777
|
-
LATEST =
|
|
857
|
+
LATEST = 1008,
|
|
778
858
|
/**
|
|
779
859
|
* The oldest .api.json schema version that is still supported for backwards compatibility.
|
|
780
860
|
*
|
|
@@ -1242,7 +1322,7 @@ export declare class ApiProperty extends ApiProperty_base {
|
|
|
1242
1322
|
buildCanonicalReference(): DeclarationReference;
|
|
1243
1323
|
}
|
|
1244
1324
|
|
|
1245
|
-
declare const ApiProperty_base: typeof ApiPropertyItem & (new (...args: any[]) => ApiStaticMixin) & (new (...args: any[]) => ApiProtectedMixin);
|
|
1325
|
+
declare const ApiProperty_base: typeof ApiPropertyItem & (new (...args: any[]) => ApiInitializerMixin) & (new (...args: any[]) => ApiStaticMixin) & (new (...args: any[]) => ApiProtectedMixin);
|
|
1246
1326
|
|
|
1247
1327
|
/**
|
|
1248
1328
|
* The abstract base class for {@link ApiProperty} and {@link ApiPropertySignature}.
|
|
@@ -1734,7 +1814,7 @@ export declare class ApiVariable extends ApiVariable_base {
|
|
|
1734
1814
|
buildCanonicalReference(): DeclarationReference;
|
|
1735
1815
|
}
|
|
1736
1816
|
|
|
1737
|
-
declare const ApiVariable_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReadonlyMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin);
|
|
1817
|
+
declare const ApiVariable_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiInitializerMixin) & (new (...args: any[]) => ApiReadonlyMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin);
|
|
1738
1818
|
|
|
1739
1819
|
/**
|
|
1740
1820
|
* This abstraction is used by the mixin pattern.
|
|
@@ -1767,6 +1847,33 @@ declare class DeserializerContext {
|
|
|
1767
1847
|
constructor(options: DeserializerContext);
|
|
1768
1848
|
}
|
|
1769
1849
|
|
|
1850
|
+
/**
|
|
1851
|
+
* Options for customizing the sort order of {@link ApiEnum} members.
|
|
1852
|
+
*
|
|
1853
|
+
* @privateRemarks
|
|
1854
|
+
* This enum is currently only used by the `@microsoft/api-extractor` package; it is declared here
|
|
1855
|
+
* because we anticipate that if more options are added in the future, their sorting will be implemented
|
|
1856
|
+
* by the `@microsoft/api-extractor-model` package.
|
|
1857
|
+
*
|
|
1858
|
+
* See https://github.com/microsoft/rushstack/issues/918 for details.
|
|
1859
|
+
*
|
|
1860
|
+
* @public
|
|
1861
|
+
*/
|
|
1862
|
+
export declare enum EnumMemberOrder {
|
|
1863
|
+
/**
|
|
1864
|
+
* `ApiEnumMember` items are sorted according to their {@link ApiItem.getSortKey}. The order is
|
|
1865
|
+
* basically alphabetical by identifier name, but otherwise unspecified to allow for cosmetic improvements.
|
|
1866
|
+
*
|
|
1867
|
+
* This is the default behavior.
|
|
1868
|
+
*/
|
|
1869
|
+
ByName = "by-name",
|
|
1870
|
+
/**
|
|
1871
|
+
* `ApiEnumMember` items preserve the original order of the declarations in the source file.
|
|
1872
|
+
* (This disables the automatic sorting that is normally applied based on {@link ApiItem.getSortKey}.)
|
|
1873
|
+
*/
|
|
1874
|
+
Preserve = "preserve"
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1770
1877
|
/**
|
|
1771
1878
|
* The `Excerpt` class is used by {@link ApiDeclaredItem} to represent a TypeScript code fragment that may be
|
|
1772
1879
|
* annotated with hyperlinks to declared types (and in the future, source code locations).
|
|
@@ -1956,16 +2063,11 @@ export declare interface IApiDocumentedItemOptions extends IApiItemOptions {
|
|
|
1956
2063
|
export declare interface IApiEntryPointOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions {
|
|
1957
2064
|
}
|
|
1958
2065
|
|
|
1959
|
-
declare interface IApiEnumMemberJson extends IApiDeclaredItemJson {
|
|
1960
|
-
initializerTokenRange: IExcerptTokenRange;
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
2066
|
/**
|
|
1964
2067
|
* Constructor options for {@link ApiEnumMember}.
|
|
1965
2068
|
* @public
|
|
1966
2069
|
*/
|
|
1967
|
-
export declare interface IApiEnumMemberOptions extends IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions {
|
|
1968
|
-
initializerTokenRange: IExcerptTokenRange;
|
|
2070
|
+
export declare interface IApiEnumMemberOptions extends IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiDeclaredItemOptions, IApiInitializerMixinOptions {
|
|
1969
2071
|
}
|
|
1970
2072
|
|
|
1971
2073
|
/**
|
|
@@ -1989,6 +2091,18 @@ export declare interface IApiFunctionOptions extends IApiNameMixinOptions, IApiT
|
|
|
1989
2091
|
export declare interface IApiIndexSignatureOptions extends IApiParameterListMixinOptions, IApiReleaseTagMixinOptions, IApiReturnTypeMixinOptions, IApiDeclaredItemOptions {
|
|
1990
2092
|
}
|
|
1991
2093
|
|
|
2094
|
+
declare interface IApiInitializerMixinJson extends IApiItemJson {
|
|
2095
|
+
initializerTokenRange?: IExcerptTokenRange;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
/**
|
|
2099
|
+
* Constructor options for {@link (IApiInitializerMixinOptions:interface)}.
|
|
2100
|
+
* @public
|
|
2101
|
+
*/
|
|
2102
|
+
export declare interface IApiInitializerMixinOptions extends IApiItemOptions {
|
|
2103
|
+
initializerTokenRange?: IExcerptTokenRange;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
1992
2106
|
declare interface IApiInterfaceJson extends IApiItemContainerJson, IApiNameMixinJson, IApiTypeParameterListMixinJson, IApiReleaseTagMixinJson, IApiDeclaredItemJson {
|
|
1993
2107
|
extendsTokenRanges: IExcerptTokenRange[];
|
|
1994
2108
|
}
|
|
@@ -2011,6 +2125,7 @@ export declare interface IApiItemConstructor extends Constructor<ApiItem>, Prope
|
|
|
2011
2125
|
}
|
|
2012
2126
|
|
|
2013
2127
|
declare interface IApiItemContainerJson extends IApiItemJson {
|
|
2128
|
+
preserveMemberOrder?: boolean;
|
|
2014
2129
|
members: IApiItemJson[];
|
|
2015
2130
|
}
|
|
2016
2131
|
|
|
@@ -2019,6 +2134,7 @@ declare interface IApiItemContainerJson extends IApiItemJson {
|
|
|
2019
2134
|
* @public
|
|
2020
2135
|
*/
|
|
2021
2136
|
export declare interface IApiItemContainerMixinOptions extends IApiItemOptions {
|
|
2137
|
+
preserveMemberOrder?: boolean;
|
|
2022
2138
|
members?: ApiItem[];
|
|
2023
2139
|
}
|
|
2024
2140
|
|
|
@@ -2140,7 +2256,7 @@ export declare interface IApiPropertyItemOptions extends IApiNameMixinOptions, I
|
|
|
2140
2256
|
* Constructor options for {@link ApiProperty}.
|
|
2141
2257
|
* @public
|
|
2142
2258
|
*/
|
|
2143
|
-
export declare interface IApiPropertyOptions extends IApiPropertyItemOptions, IApiProtectedMixinOptions, IApiStaticMixinOptions {
|
|
2259
|
+
export declare interface IApiPropertyOptions extends IApiPropertyItemOptions, IApiProtectedMixinOptions, IApiStaticMixinOptions, IApiInitializerMixinOptions {
|
|
2144
2260
|
}
|
|
2145
2261
|
|
|
2146
2262
|
/**
|
|
@@ -2240,7 +2356,7 @@ declare interface IApiVariableJson extends IApiDeclaredItemJson {
|
|
|
2240
2356
|
* Constructor options for {@link ApiVariable}.
|
|
2241
2357
|
* @public
|
|
2242
2358
|
*/
|
|
2243
|
-
export declare interface IApiVariableOptions extends IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiReadonlyMixinOptions, IApiDeclaredItemOptions {
|
|
2359
|
+
export declare interface IApiVariableOptions extends IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiReadonlyMixinOptions, IApiDeclaredItemOptions, IApiInitializerMixinOptions {
|
|
2244
2360
|
variableTypeTokenRange: IExcerptTokenRange;
|
|
2245
2361
|
}
|
|
2246
2362
|
|
package/lib/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { IApiStaticMixinOptions, ApiStaticMixin } from './mixins/ApiStaticMixin'
|
|
|
22
22
|
export { IApiNameMixinOptions, ApiNameMixin } from './mixins/ApiNameMixin';
|
|
23
23
|
export { IApiOptionalMixinOptions, ApiOptionalMixin } from './mixins/ApiOptionalMixin';
|
|
24
24
|
export { IApiReadonlyMixinOptions, ApiReadonlyMixin } from './mixins/ApiReadonlyMixin';
|
|
25
|
+
export { IApiInitializerMixinOptions, ApiInitializerMixin } from './mixins/ApiInitializerMixin';
|
|
25
26
|
export { ExcerptTokenKind, IExcerptTokenRange, IExcerptToken, ExcerptToken, Excerpt } from './mixins/Excerpt';
|
|
26
27
|
export { Constructor, PropertiesOf } from './mixins/Mixin';
|
|
27
28
|
export { IApiCallSignatureOptions, ApiCallSignature } from './model/ApiCallSignature';
|
|
@@ -30,7 +31,7 @@ export { IApiConstructorOptions, ApiConstructor } from './model/ApiConstructor';
|
|
|
30
31
|
export { IApiConstructSignatureOptions, ApiConstructSignature } from './model/ApiConstructSignature';
|
|
31
32
|
export { IApiEntryPointOptions, ApiEntryPoint } from './model/ApiEntryPoint';
|
|
32
33
|
export { IApiEnumOptions, ApiEnum } from './model/ApiEnum';
|
|
33
|
-
export { IApiEnumMemberOptions, ApiEnumMember } from './model/ApiEnumMember';
|
|
34
|
+
export { IApiEnumMemberOptions, ApiEnumMember, EnumMemberOrder } from './model/ApiEnumMember';
|
|
34
35
|
export { IApiFunctionOptions, ApiFunction } from './model/ApiFunction';
|
|
35
36
|
export { IApiIndexSignatureOptions, ApiIndexSignature } from './model/ApiIndexSignature';
|
|
36
37
|
export { IApiInterfaceOptions, ApiInterface } from './model/ApiInterface';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAGnF,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AACx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AAqB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,kCAAkC,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
3
|
// See LICENSE in the project root for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.HeritageType = exports.ApiVariable = exports.TypeParameter = exports.ApiTypeAlias = exports.ApiPropertySignature = exports.ApiProperty = exports.Parameter = exports.ApiPackage = exports.ApiNamespace = exports.ApiModel = exports.ApiMethodSignature = exports.ApiMethod = exports.ApiInterface = exports.ApiIndexSignature = exports.ApiFunction = exports.ApiEnumMember = exports.ApiEnum = exports.ApiEntryPoint = exports.ApiConstructSignature = exports.ApiConstructor = exports.ApiClass = exports.ApiCallSignature = exports.Excerpt = exports.ExcerptToken = exports.ExcerptTokenKind = exports.ApiReadonlyMixin = exports.ApiOptionalMixin = exports.ApiNameMixin = exports.ApiStaticMixin = exports.ApiReturnTypeMixin = exports.ApiReleaseTagMixin = exports.ApiProtectedMixin = exports.ApiItemContainerMixin = exports.ApiTypeParameterListMixin = exports.ApiParameterListMixin = exports.ApiPropertyItem = exports.ApiItem = exports.ApiItemKind = exports.ApiDocumentedItem = exports.ApiDeclaredItem = exports.ReleaseTag = exports.AedocDefinitions = void 0;
|
|
5
|
+
exports.HeritageType = exports.ApiVariable = exports.TypeParameter = exports.ApiTypeAlias = exports.ApiPropertySignature = exports.ApiProperty = exports.Parameter = exports.ApiPackage = exports.ApiNamespace = exports.ApiModel = exports.ApiMethodSignature = exports.ApiMethod = exports.ApiInterface = exports.ApiIndexSignature = exports.ApiFunction = exports.EnumMemberOrder = exports.ApiEnumMember = exports.ApiEnum = exports.ApiEntryPoint = exports.ApiConstructSignature = exports.ApiConstructor = exports.ApiClass = exports.ApiCallSignature = exports.Excerpt = exports.ExcerptToken = exports.ExcerptTokenKind = exports.ApiInitializerMixin = exports.ApiReadonlyMixin = exports.ApiOptionalMixin = exports.ApiNameMixin = exports.ApiStaticMixin = exports.ApiReturnTypeMixin = exports.ApiReleaseTagMixin = exports.ApiProtectedMixin = exports.ApiItemContainerMixin = exports.ApiTypeParameterListMixin = exports.ApiParameterListMixin = exports.ApiPropertyItem = exports.ApiItem = exports.ApiItemKind = exports.ApiDocumentedItem = exports.ApiDeclaredItem = exports.ReleaseTag = exports.AedocDefinitions = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Use this library to read and write *.api.json files as defined by the
|
|
8
8
|
* {@link https://api-extractor.com/ | API Extractor} tool. These files are used to generate a documentation
|
|
@@ -46,6 +46,8 @@ var ApiOptionalMixin_1 = require("./mixins/ApiOptionalMixin");
|
|
|
46
46
|
Object.defineProperty(exports, "ApiOptionalMixin", { enumerable: true, get: function () { return ApiOptionalMixin_1.ApiOptionalMixin; } });
|
|
47
47
|
var ApiReadonlyMixin_1 = require("./mixins/ApiReadonlyMixin");
|
|
48
48
|
Object.defineProperty(exports, "ApiReadonlyMixin", { enumerable: true, get: function () { return ApiReadonlyMixin_1.ApiReadonlyMixin; } });
|
|
49
|
+
var ApiInitializerMixin_1 = require("./mixins/ApiInitializerMixin");
|
|
50
|
+
Object.defineProperty(exports, "ApiInitializerMixin", { enumerable: true, get: function () { return ApiInitializerMixin_1.ApiInitializerMixin; } });
|
|
49
51
|
var Excerpt_1 = require("./mixins/Excerpt");
|
|
50
52
|
Object.defineProperty(exports, "ExcerptTokenKind", { enumerable: true, get: function () { return Excerpt_1.ExcerptTokenKind; } });
|
|
51
53
|
Object.defineProperty(exports, "ExcerptToken", { enumerable: true, get: function () { return Excerpt_1.ExcerptToken; } });
|
|
@@ -65,6 +67,7 @@ var ApiEnum_1 = require("./model/ApiEnum");
|
|
|
65
67
|
Object.defineProperty(exports, "ApiEnum", { enumerable: true, get: function () { return ApiEnum_1.ApiEnum; } });
|
|
66
68
|
var ApiEnumMember_1 = require("./model/ApiEnumMember");
|
|
67
69
|
Object.defineProperty(exports, "ApiEnumMember", { enumerable: true, get: function () { return ApiEnumMember_1.ApiEnumMember; } });
|
|
70
|
+
Object.defineProperty(exports, "EnumMemberOrder", { enumerable: true, get: function () { return ApiEnumMember_1.EnumMemberOrder; } });
|
|
68
71
|
var ApiFunction_1 = require("./model/ApiFunction");
|
|
69
72
|
Object.defineProperty(exports, "ApiFunction", { enumerable: true, get: function () { return ApiFunction_1.ApiFunction; } });
|
|
70
73
|
var ApiIndexSignature_1 = require("./model/ApiIndexSignature");
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;GAOG;AAEH,6DAA4D;AAAnD,oHAAA,gBAAgB,OAAA;AACzB,iDAAgD;AAAvC,wGAAA,UAAU,OAAA;AAEnB,QAAQ;AACR,2DAAmF;AAAjD,kHAAA,eAAe,OAAA;AACjD,+DAAyF;AAArD,sHAAA,iBAAiB,OAAA;AACrD,2CAA6F;AAApF,sGAAA,WAAW,OAAA;AAAmB,kGAAA,OAAO,OAAA;AAC9C,2DAAmF;AAAjD,kHAAA,eAAe,OAAA;AAEjD,SAAS;AACT,wEAIwC;AADtC,8HAAA,qBAAqB,OAAA;AAEvB,gFAI4C;AAD1C,sIAAA,yBAAyB,OAAA;AAE3B,wEAAsG;AAA9D,8HAAA,qBAAqB,OAAA;AAC7D,gEAA0F;AAAtD,sHAAA,iBAAiB,OAAA;AACrD,kEAA6F;AAAxD,wHAAA,kBAAkB,OAAA;AACvD,kEAA6F;AAAxD,wHAAA,kBAAkB,OAAA;AACvD,0DAAiF;AAAhD,gHAAA,cAAc,OAAA;AAC/C,sDAA2E;AAA5C,4GAAA,YAAY,OAAA;AAC3C,8DAAuF;AAApD,oHAAA,gBAAgB,OAAA;AACnD,8DAAuF;AAApD,oHAAA,gBAAgB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;GAOG;AAEH,6DAA4D;AAAnD,oHAAA,gBAAgB,OAAA;AACzB,iDAAgD;AAAvC,wGAAA,UAAU,OAAA;AAEnB,QAAQ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;AAC3C,+CAAiE;AAArC,sGAAA,SAAS,OAAA;AACrC,iEAA4F;AAAvD,wHAAA,kBAAkB,OAAA;AACvD,6CAA4C;AAAnC,oGAAA,QAAQ,OAAA;AACjB,qDAA0E;AAA3C,4GAAA,YAAY,OAAA;AAC3C,iDAA4F;AAA/D,wGAAA,UAAU,OAAA;AACvC,+CAAiE;AAArC,sGAAA,SAAS,OAAA;AACrC,mDAAuE;AAAzC,0GAAA,WAAW,OAAA;AACzC,qEAAkG;AAA3D,4HAAA,oBAAoB,OAAA;AAC3D,qDAA0E;AAA3C,4GAAA,YAAY,OAAA;AAC3C,uDAA6E;AAA7C,8GAAA,aAAa,OAAA;AAC7C,mDAAuE;AAAzC,0GAAA,WAAW,OAAA;AAEzC,qDAAoD;AAA3C,4GAAA,YAAY,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * Use this library to read and write *.api.json files as defined by the\n * {@link https://api-extractor.com/ | API Extractor} tool. These files are used to generate a documentation\n * website for your TypeScript package. The files store the API signatures and doc comments that were extracted\n * from your package.\n *\n * @packageDocumentation\n */\n\nexport { AedocDefinitions } from './aedoc/AedocDefinitions';\nexport { ReleaseTag } from './aedoc/ReleaseTag';\n\n// items\nexport { IApiDeclaredItemOptions, ApiDeclaredItem } from './items/ApiDeclaredItem';\nexport { IApiDocumentedItemOptions, ApiDocumentedItem } from './items/ApiDocumentedItem';\nexport { ApiItemKind, IApiItemOptions, ApiItem, IApiItemConstructor } from './items/ApiItem';\nexport { IApiPropertyItemOptions, ApiPropertyItem } from './items/ApiPropertyItem';\n\n// mixins\nexport {\n IApiParameterListMixinOptions,\n IApiParameterOptions,\n ApiParameterListMixin\n} from './mixins/ApiParameterListMixin';\nexport {\n IApiTypeParameterOptions,\n IApiTypeParameterListMixinOptions,\n ApiTypeParameterListMixin\n} from './mixins/ApiTypeParameterListMixin';\nexport { IApiItemContainerMixinOptions, ApiItemContainerMixin } from './mixins/ApiItemContainerMixin';\nexport { IApiProtectedMixinOptions, ApiProtectedMixin } from './mixins/ApiProtectedMixin';\nexport { IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from './mixins/ApiReleaseTagMixin';\nexport { IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from './mixins/ApiReturnTypeMixin';\nexport { IApiStaticMixinOptions, ApiStaticMixin } from './mixins/ApiStaticMixin';\nexport { IApiNameMixinOptions, ApiNameMixin } from './mixins/ApiNameMixin';\nexport { IApiOptionalMixinOptions, ApiOptionalMixin } from './mixins/ApiOptionalMixin';\nexport { IApiReadonlyMixinOptions, ApiReadonlyMixin } from './mixins/ApiReadonlyMixin';\nexport { IApiInitializerMixinOptions, ApiInitializerMixin } from './mixins/ApiInitializerMixin';\n\nexport { ExcerptTokenKind, IExcerptTokenRange, IExcerptToken, ExcerptToken, Excerpt } from './mixins/Excerpt';\nexport { Constructor, PropertiesOf } from './mixins/Mixin';\n\n// model\nexport { IApiCallSignatureOptions, ApiCallSignature } from './model/ApiCallSignature';\nexport { IApiClassOptions, ApiClass } from './model/ApiClass';\nexport { IApiConstructorOptions, ApiConstructor } from './model/ApiConstructor';\nexport { IApiConstructSignatureOptions, ApiConstructSignature } from './model/ApiConstructSignature';\nexport { IApiEntryPointOptions, ApiEntryPoint } from './model/ApiEntryPoint';\nexport { IApiEnumOptions, ApiEnum } from './model/ApiEnum';\nexport { IApiEnumMemberOptions, ApiEnumMember, EnumMemberOrder } from './model/ApiEnumMember';\nexport { IApiFunctionOptions, ApiFunction } from './model/ApiFunction';\nexport { IApiIndexSignatureOptions, ApiIndexSignature } from './model/ApiIndexSignature';\nexport { IApiInterfaceOptions, ApiInterface } from './model/ApiInterface';\nexport { IApiMethodOptions, ApiMethod } from './model/ApiMethod';\nexport { IApiMethodSignatureOptions, ApiMethodSignature } from './model/ApiMethodSignature';\nexport { ApiModel } from './model/ApiModel';\nexport { IApiNamespaceOptions, ApiNamespace } from './model/ApiNamespace';\nexport { IApiPackageOptions, ApiPackage, IApiPackageSaveOptions } from './model/ApiPackage';\nexport { IParameterOptions, Parameter } from './model/Parameter';\nexport { IApiPropertyOptions, ApiProperty } from './model/ApiProperty';\nexport { IApiPropertySignatureOptions, ApiPropertySignature } from './model/ApiPropertySignature';\nexport { IApiTypeAliasOptions, ApiTypeAlias } from './model/ApiTypeAlias';\nexport { ITypeParameterOptions, TypeParameter } from './model/TypeParameter';\nexport { IApiVariableOptions, ApiVariable } from './model/ApiVariable';\nexport { IResolveDeclarationReferenceResult } from './model/ModelReferenceResolver';\nexport { HeritageType } from './model/HeritageType';\n"]}
|
package/lib/items/ApiItem.d.ts
CHANGED
|
@@ -136,7 +136,17 @@ export declare class ApiItem {
|
|
|
136
136
|
* Otherwise undefined is returned.
|
|
137
137
|
*/
|
|
138
138
|
getAssociatedPackage(): ApiPackage | undefined;
|
|
139
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* A text string whose value determines the sort order that is automatically applied by the
|
|
141
|
+
* {@link (ApiItemContainerMixin:interface)} class.
|
|
142
|
+
*
|
|
143
|
+
* @remarks
|
|
144
|
+
* The value of this string is undocumented and may change at any time.
|
|
145
|
+
* If {@link (ApiItemContainerMixin:interface).preserveMemberOrder} is enabled for the `ApiItem`'s parent,
|
|
146
|
+
* then no sorting is performed, and this key is not used.
|
|
147
|
+
*
|
|
148
|
+
* @virtual
|
|
149
|
+
*/
|
|
140
150
|
getSortKey(): string;
|
|
141
151
|
/**
|
|
142
152
|
* PRIVATE
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiItem.d.ts","sourceRoot":"","sources":["../../src/items/ApiItem.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,mBA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AGG;IACH,SAAS,CAAC,uBAAuB,IAAI,oBAAoB;CAG1D;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,OAAO,CAAC;CAAG"}
|
package/lib/items/ApiItem.js
CHANGED
|
@@ -224,7 +224,17 @@ class ApiItem {
|
|
|
224
224
|
}
|
|
225
225
|
return undefined;
|
|
226
226
|
}
|
|
227
|
-
/**
|
|
227
|
+
/**
|
|
228
|
+
* A text string whose value determines the sort order that is automatically applied by the
|
|
229
|
+
* {@link (ApiItemContainerMixin:interface)} class.
|
|
230
|
+
*
|
|
231
|
+
* @remarks
|
|
232
|
+
* The value of this string is undocumented and may change at any time.
|
|
233
|
+
* If {@link (ApiItemContainerMixin:interface).preserveMemberOrder} is enabled for the `ApiItem`'s parent,
|
|
234
|
+
* then no sorting is performed, and this key is not used.
|
|
235
|
+
*
|
|
236
|
+
* @virtual
|
|
237
|
+
*/
|
|
228
238
|
getSortKey() {
|
|
229
239
|
return this.containerKey;
|
|
230
240
|
}
|
package/lib/items/ApiItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiItem.js","sourceRoot":"","sources":["../../src/items/ApiItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAK3D,2EAAwE;AAExE,oEAA6D;AAC7D,2EAAwE;AAExE;;;;;GAKG;AACH,IAAY,WAqBX;AArBD,WAAY,WAAW;IACrB,8CAA+B,CAAA;IAC/B,8BAAe,CAAA;IACf,0CAA2B,CAAA;IAC3B,wDAAyC,CAAA;IACzC,wCAAyB,CAAA;IACzB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,kDAAmC,CAAA;IACnC,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,kCAAmB,C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,CAAC,OAAO,EAAE;gBACxC,OAAO,OAAqB,CAAC;aAC9B;SACF;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,eAAe;IACR,UAAU;QACf,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;;;;;;OAOG;IACI,CAAC,+BAAuB,CAAC,CAAC,MAA2B;QAC1D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;IACvC,CAAC;IAED;;;OAGG;IACO,uBAAuB;QAC/B,MAAM,IAAI,iCAAa,CAAC,mEAAmE,CAAC,CAAC;IAC/F,CAAC;CACF;AAlOD,0BAkOC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { Constructor, PropertiesOf } from '../mixins/Mixin';\nimport { ApiPackage } from '../model/ApiPackage';\nimport { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport { DeserializerContext } from '../model/DeserializerContext';\nimport { InternalError } from '@rushstack/node-core-library';\nimport { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';\n\n/**\n * The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of\n * {@link ApiItem}.\n *\n * @public\n */\nexport enum ApiItemKind {\n CallSignature = 'CallSignature',\n Class = 'Class',\n Constructor = 'Constructor',\n ConstructSignature = 'ConstructSignature',\n EntryPoint = 'EntryPoint',\n Enum = 'Enum',\n EnumMember = 'EnumMember',\n Function = 'Function',\n IndexSignature = 'IndexSignature',\n Interface = 'Interface',\n Method = 'Method',\n MethodSignature = 'MethodSignature',\n Model = 'Model',\n Namespace = 'Namespace',\n Package = 'Package',\n Property = 'Property',\n PropertySignature = 'PropertySignature',\n TypeAlias = 'TypeAlias',\n Variable = 'Variable',\n None = 'None'\n}\n\n/**\n * Constructor options for {@link ApiItem}.\n * @public\n */\nexport interface IApiItemOptions {}\n\nexport interface IApiItemJson {\n kind: ApiItemKind;\n canonicalReference: string;\n}\n\n// PRIVATE - Allows ApiItemContainerMixin to assign the parent.\n//\nexport const apiItem_onParentChanged: unique symbol = Symbol('ApiItem._onAddToContainer');\n\n/**\n * The abstract base class for all members of an `ApiModel` object.\n *\n * @remarks\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n * @public\n */\nexport class ApiItem {\n private _canonicalReference: DeclarationReference | undefined;\n private _parent: ApiItem | undefined;\n\n public constructor(options: IApiItemOptions) {\n // (\"options\" is not used here, but part of the inheritance pattern)\n }\n\n public static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem {\n // The Deserializer class is coupled with a ton of other classes, so we delay loading it\n // to avoid ES5 circular imports.\n const deserializerModule: typeof import('../model/Deserializer') = require('../model/Deserializer');\n return deserializerModule.Deserializer.deserialize(context, jsonObject);\n }\n\n /** @virtual */\n public static onDeserializeInto(\n options: Partial<IApiItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiItemJson\n ): void {\n // (implemented by subclasses)\n }\n\n /** @virtual */\n public serializeInto(jsonObject: Partial<IApiItemJson>): void {\n jsonObject.kind = this.kind;\n jsonObject.canonicalReference = this.canonicalReference.toString();\n }\n\n /**\n * Identifies the subclass of the `ApiItem` base class.\n * @virtual\n */\n public get kind(): ApiItemKind {\n throw new Error('ApiItem.kind was not implemented by the child class');\n }\n\n /**\n * Warning: This API is used internally by API extractor but is not yet ready for general usage.\n *\n * @remarks\n *\n * Returns a `DeclarationReference` object using the experimental new declaration reference notation.\n *\n * @beta\n */\n public get canonicalReference(): DeclarationReference {\n if (!this._canonicalReference) {\n try {\n this._canonicalReference = this.buildCanonicalReference();\n } catch (e) {\n const name: string = this.getScopedNameWithinPackage() || this.displayName;\n throw new InternalError(`Error building canonical reference for ${name}:\\n` + (e as Error).message);\n }\n }\n return this._canonicalReference;\n }\n\n /**\n * Returns a string key that can be used to efficiently retrieve an `ApiItem` from an `ApiItemContainerMixin`.\n * The key is unique within the container. Its format is undocumented and may change at any time.\n *\n * @remarks\n * Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation\n * of this function, according to the aspects that are important for identifying it.\n *\n * @virtual\n */\n public get containerKey(): string {\n throw new InternalError('ApiItem.containerKey was not implemented by the child class');\n }\n\n /**\n * Returns a name for this object that can be used in diagnostic messages, for example.\n *\n * @remarks\n * For an object that inherits ApiNameMixin, this will return the declared name (e.g. the name of a TypeScript\n * function). Otherwise, it will return a string such as \"(call signature)\" or \"(model)\".\n *\n * @virtual\n */\n public get displayName(): string {\n switch (this.kind) {\n case ApiItemKind.CallSignature:\n return '(call)';\n case ApiItemKind.Constructor:\n return '(constructor)';\n case ApiItemKind.ConstructSignature:\n return '(new)';\n case ApiItemKind.IndexSignature:\n return '(indexer)';\n case ApiItemKind.Model:\n return '(model)';\n }\n return '(???)'; // All other types should inherit ApiNameMixin which will override this property\n }\n\n /**\n * If this item was added to a ApiItemContainerMixin item, then this returns the container item.\n * If this is an Parameter that was added to a method or function, then this returns the function item.\n * Otherwise, it returns undefined.\n * @virtual\n */\n public get parent(): ApiItem | undefined {\n return this._parent;\n }\n\n /**\n * This property supports a visitor pattern for walking the tree.\n * For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically.\n * Otherwise it returns an empty array.\n * @virtual\n */\n public get members(): ReadonlyArray<ApiItem> {\n return [];\n }\n\n /**\n * If this item has a name (i.e. extends `ApiNameMixin`), then return all items that have the same parent\n * and the same name. Otherwise, return all items that have the same parent and the same `ApiItemKind`.\n *\n * @remarks\n * Examples: For a function, this would return all overloads for the function. For a constructor, this would\n * return all overloads for the constructor. For a merged declaration (e.g. a `namespace` and `enum` with the\n * same name), this would return both declarations. If this item does not have a parent, or if it is the only\n * item of its name/kind, then the result is an array containing only this item.\n */\n public getMergedSiblings(): ReadonlyArray<ApiItem> {\n const parent: ApiItem | undefined = this._parent;\n if (parent && ApiItemContainerMixin.isBaseClassOf(parent)) {\n return parent._getMergedSiblingsForMember(this);\n }\n return [];\n }\n\n /**\n * Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.\n */\n public getHierarchy(): ReadonlyArray<ApiItem> {\n const hierarchy: ApiItem[] = [];\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n hierarchy.push(current);\n }\n hierarchy.reverse();\n return hierarchy;\n }\n\n /**\n * This returns a scoped name such as `\"Namespace1.Namespace2.MyClass.myMember()\"`. It does not include the\n * package name or entry point.\n *\n * @remarks\n * If called on an ApiEntrypoint, ApiPackage, or ApiModel item, the result is an empty string.\n */\n public getScopedNameWithinPackage(): string {\n const reversedParts: string[] = [];\n\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (\n current.kind === ApiItemKind.Model ||\n current.kind === ApiItemKind.Package ||\n current.kind === ApiItemKind.EntryPoint\n ) {\n break;\n }\n if (reversedParts.length !== 0) {\n reversedParts.push('.');\n } else {\n switch (current.kind) {\n case ApiItemKind.CallSignature:\n case ApiItemKind.ConstructSignature:\n case ApiItemKind.Constructor:\n case ApiItemKind.IndexSignature:\n // These functional forms don't have a proper name, so we don't append the \"()\" suffix\n break;\n default:\n if (ApiParameterListMixin.isBaseClassOf(current)) {\n reversedParts.push('()');\n }\n }\n }\n reversedParts.push(current.displayName);\n }\n\n return reversedParts.reverse().join('');\n }\n\n /**\n * If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned.\n * Otherwise undefined is returned.\n */\n public getAssociatedPackage(): ApiPackage | undefined {\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (current.kind === ApiItemKind.Package) {\n return current as ApiPackage;\n }\n }\n return undefined;\n }\n\n /** @virtual */\n public getSortKey(): string {\n return this.containerKey;\n }\n\n /**\n * PRIVATE\n *\n * @privateRemarks\n * Allows ApiItemContainerMixin to assign the parent when the item is added to a container.\n *\n * @internal\n */\n public [apiItem_onParentChanged](parent: ApiItem | undefined): void {\n this._parent = parent;\n this._canonicalReference = undefined;\n }\n\n /**\n * Builds the cached object used by the `canonicalReference` property.\n * @virtual\n */\n protected buildCanonicalReference(): DeclarationReference {\n throw new InternalError('ApiItem.canonicalReference was not implemented by the child class');\n }\n}\n\n/**\n * This abstraction is used by the mixin pattern.\n * It describes a class type that inherits from {@link ApiItem}.\n *\n * @public\n */\nexport interface IApiItemConstructor extends Constructor<ApiItem>, PropertiesOf<typeof ApiItem> {}\n"]}
|
|
1
|
+
{"version":3,"file":"ApiItem.js","sourceRoot":"","sources":["../../src/items/ApiItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAK3D,2EAAwE;AAExE,oEAA6D;AAC7D,2EAAwE;AAExE;;;;;GAKG;AACH,IAAY,WAqBX;AArBD,WAAY,WAAW;IACrB,8CAA+B,CAAA;IAC/B,8BAAe,CAAA;IACf,0CAA2B,CAAA;IAC3B,wDAAyC,CAAA;IACzC,wCAAyB,CAAA;IACzB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,kDAAmC,CAAA;IACnC,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,sDAAuC,CAAA;IACvC,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;AACf,CAAC,EArBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAqBtB;AAaD,+DAA+D;AAC/D,EAAE;AACW,QAAA,uBAAuB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAa,OAAO;IAIlB,YAAmB,OAAwB;QACzC,oEAAoE;IACtE,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAwB,EAAE,OAA4B;QAC9E,yFAAyF;QACzF,iCAAiC;QACjC,MAAM,kBAAkB,GA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OC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { Constructor, PropertiesOf } from '../mixins/Mixin';\nimport { ApiPackage } from '../model/ApiPackage';\nimport { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport { DeserializerContext } from '../model/DeserializerContext';\nimport { InternalError } from '@rushstack/node-core-library';\nimport { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';\n\n/**\n * The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of\n * {@link ApiItem}.\n *\n * @public\n */\nexport enum ApiItemKind {\n CallSignature = 'CallSignature',\n Class = 'Class',\n Constructor = 'Constructor',\n ConstructSignature = 'ConstructSignature',\n EntryPoint = 'EntryPoint',\n Enum = 'Enum',\n EnumMember = 'EnumMember',\n Function = 'Function',\n IndexSignature = 'IndexSignature',\n Interface = 'Interface',\n Method = 'Method',\n MethodSignature = 'MethodSignature',\n Model = 'Model',\n Namespace = 'Namespace',\n Package = 'Package',\n Property = 'Property',\n PropertySignature = 'PropertySignature',\n TypeAlias = 'TypeAlias',\n Variable = 'Variable',\n None = 'None'\n}\n\n/**\n * Constructor options for {@link ApiItem}.\n * @public\n */\nexport interface IApiItemOptions {}\n\nexport interface IApiItemJson {\n kind: ApiItemKind;\n canonicalReference: string;\n}\n\n// PRIVATE - Allows ApiItemContainerMixin to assign the parent.\n//\nexport const apiItem_onParentChanged: unique symbol = Symbol('ApiItem._onAddToContainer');\n\n/**\n * The abstract base class for all members of an `ApiModel` object.\n *\n * @remarks\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n * @public\n */\nexport class ApiItem {\n private _canonicalReference: DeclarationReference | undefined;\n private _parent: ApiItem | undefined;\n\n public constructor(options: IApiItemOptions) {\n // (\"options\" is not used here, but part of the inheritance pattern)\n }\n\n public static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem {\n // The Deserializer class is coupled with a ton of other classes, so we delay loading it\n // to avoid ES5 circular imports.\n const deserializerModule: typeof import('../model/Deserializer') = require('../model/Deserializer');\n return deserializerModule.Deserializer.deserialize(context, jsonObject);\n }\n\n /** @virtual */\n public static onDeserializeInto(\n options: Partial<IApiItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiItemJson\n ): void {\n // (implemented by subclasses)\n }\n\n /** @virtual */\n public serializeInto(jsonObject: Partial<IApiItemJson>): void {\n jsonObject.kind = this.kind;\n jsonObject.canonicalReference = this.canonicalReference.toString();\n }\n\n /**\n * Identifies the subclass of the `ApiItem` base class.\n * @virtual\n */\n public get kind(): ApiItemKind {\n throw new Error('ApiItem.kind was not implemented by the child class');\n }\n\n /**\n * Warning: This API is used internally by API extractor but is not yet ready for general usage.\n *\n * @remarks\n *\n * Returns a `DeclarationReference` object using the experimental new declaration reference notation.\n *\n * @beta\n */\n public get canonicalReference(): DeclarationReference {\n if (!this._canonicalReference) {\n try {\n this._canonicalReference = this.buildCanonicalReference();\n } catch (e) {\n const name: string = this.getScopedNameWithinPackage() || this.displayName;\n throw new InternalError(`Error building canonical reference for ${name}:\\n` + (e as Error).message);\n }\n }\n return this._canonicalReference;\n }\n\n /**\n * Returns a string key that can be used to efficiently retrieve an `ApiItem` from an `ApiItemContainerMixin`.\n * The key is unique within the container. Its format is undocumented and may change at any time.\n *\n * @remarks\n * Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation\n * of this function, according to the aspects that are important for identifying it.\n *\n * @virtual\n */\n public get containerKey(): string {\n throw new InternalError('ApiItem.containerKey was not implemented by the child class');\n }\n\n /**\n * Returns a name for this object that can be used in diagnostic messages, for example.\n *\n * @remarks\n * For an object that inherits ApiNameMixin, this will return the declared name (e.g. the name of a TypeScript\n * function). Otherwise, it will return a string such as \"(call signature)\" or \"(model)\".\n *\n * @virtual\n */\n public get displayName(): string {\n switch (this.kind) {\n case ApiItemKind.CallSignature:\n return '(call)';\n case ApiItemKind.Constructor:\n return '(constructor)';\n case ApiItemKind.ConstructSignature:\n return '(new)';\n case ApiItemKind.IndexSignature:\n return '(indexer)';\n case ApiItemKind.Model:\n return '(model)';\n }\n return '(???)'; // All other types should inherit ApiNameMixin which will override this property\n }\n\n /**\n * If this item was added to a ApiItemContainerMixin item, then this returns the container item.\n * If this is an Parameter that was added to a method or function, then this returns the function item.\n * Otherwise, it returns undefined.\n * @virtual\n */\n public get parent(): ApiItem | undefined {\n return this._parent;\n }\n\n /**\n * This property supports a visitor pattern for walking the tree.\n * For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically.\n * Otherwise it returns an empty array.\n * @virtual\n */\n public get members(): ReadonlyArray<ApiItem> {\n return [];\n }\n\n /**\n * If this item has a name (i.e. extends `ApiNameMixin`), then return all items that have the same parent\n * and the same name. Otherwise, return all items that have the same parent and the same `ApiItemKind`.\n *\n * @remarks\n * Examples: For a function, this would return all overloads for the function. For a constructor, this would\n * return all overloads for the constructor. For a merged declaration (e.g. a `namespace` and `enum` with the\n * same name), this would return both declarations. If this item does not have a parent, or if it is the only\n * item of its name/kind, then the result is an array containing only this item.\n */\n public getMergedSiblings(): ReadonlyArray<ApiItem> {\n const parent: ApiItem | undefined = this._parent;\n if (parent && ApiItemContainerMixin.isBaseClassOf(parent)) {\n return parent._getMergedSiblingsForMember(this);\n }\n return [];\n }\n\n /**\n * Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.\n */\n public getHierarchy(): ReadonlyArray<ApiItem> {\n const hierarchy: ApiItem[] = [];\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n hierarchy.push(current);\n }\n hierarchy.reverse();\n return hierarchy;\n }\n\n /**\n * This returns a scoped name such as `\"Namespace1.Namespace2.MyClass.myMember()\"`. It does not include the\n * package name or entry point.\n *\n * @remarks\n * If called on an ApiEntrypoint, ApiPackage, or ApiModel item, the result is an empty string.\n */\n public getScopedNameWithinPackage(): string {\n const reversedParts: string[] = [];\n\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (\n current.kind === ApiItemKind.Model ||\n current.kind === ApiItemKind.Package ||\n current.kind === ApiItemKind.EntryPoint\n ) {\n break;\n }\n if (reversedParts.length !== 0) {\n reversedParts.push('.');\n } else {\n switch (current.kind) {\n case ApiItemKind.CallSignature:\n case ApiItemKind.ConstructSignature:\n case ApiItemKind.Constructor:\n case ApiItemKind.IndexSignature:\n // These functional forms don't have a proper name, so we don't append the \"()\" suffix\n break;\n default:\n if (ApiParameterListMixin.isBaseClassOf(current)) {\n reversedParts.push('()');\n }\n }\n }\n reversedParts.push(current.displayName);\n }\n\n return reversedParts.reverse().join('');\n }\n\n /**\n * If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned.\n * Otherwise undefined is returned.\n */\n public getAssociatedPackage(): ApiPackage | undefined {\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (current.kind === ApiItemKind.Package) {\n return current as ApiPackage;\n }\n }\n return undefined;\n }\n\n /**\n * A text string whose value determines the sort order that is automatically applied by the\n * {@link (ApiItemContainerMixin:interface)} class.\n *\n * @remarks\n * The value of this string is undocumented and may change at any time.\n * If {@link (ApiItemContainerMixin:interface).preserveMemberOrder} is enabled for the `ApiItem`'s parent,\n * then no sorting is performed, and this key is not used.\n *\n * @virtual\n */\n public getSortKey(): string {\n return this.containerKey;\n }\n\n /**\n * PRIVATE\n *\n * @privateRemarks\n * Allows ApiItemContainerMixin to assign the parent when the item is added to a container.\n *\n * @internal\n */\n public [apiItem_onParentChanged](parent: ApiItem | undefined): void {\n this._parent = parent;\n this._canonicalReference = undefined;\n }\n\n /**\n * Builds the cached object used by the `canonicalReference` property.\n * @virtual\n */\n protected buildCanonicalReference(): DeclarationReference {\n throw new InternalError('ApiItem.canonicalReference was not implemented by the child class');\n }\n}\n\n/**\n * This abstraction is used by the mixin pattern.\n * It describes a class type that inherits from {@link ApiItem}.\n *\n * @public\n */\nexport interface IApiItemConstructor extends Constructor<ApiItem>, PropertiesOf<typeof ApiItem> {}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
|
|
2
|
+
import { IExcerptTokenRange, Excerpt } from './Excerpt';
|
|
3
|
+
/**
|
|
4
|
+
* Constructor options for {@link (IApiInitializerMixinOptions:interface)}.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IApiInitializerMixinOptions extends IApiItemOptions {
|
|
8
|
+
initializerTokenRange?: IExcerptTokenRange;
|
|
9
|
+
}
|
|
10
|
+
export interface IApiInitializerMixinJson extends IApiItemJson {
|
|
11
|
+
initializerTokenRange?: IExcerptTokenRange;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The mixin base class for API items that can have an initializer.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*
|
|
18
|
+
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
|
|
19
|
+
* API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use
|
|
20
|
+
* TypeScript "mixin" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various
|
|
21
|
+
* features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class
|
|
22
|
+
* to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components:
|
|
23
|
+
* the function that generates a subclass, an interface that describes the members of the subclass, and
|
|
24
|
+
* a namespace containing static members of the class.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export interface ApiInitializerMixin extends ApiItem {
|
|
29
|
+
/**
|
|
30
|
+
* An {@link Excerpt} that describes the item's initializer.
|
|
31
|
+
*/
|
|
32
|
+
readonly initializerExcerpt?: Excerpt;
|
|
33
|
+
/** @override */
|
|
34
|
+
serializeInto(jsonObject: Partial<IApiInitializerMixinJson>): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Mixin function for {@link (ApiInitializerMixin:interface)}.
|
|
38
|
+
*
|
|
39
|
+
* @param baseClass - The base class to be extended
|
|
40
|
+
* @returns A child class that extends baseClass, adding the {@link (ApiInitializerMixin:interface)} functionality.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare function ApiInitializerMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiInitializerMixin);
|
|
45
|
+
/**
|
|
46
|
+
* Static members for {@link (ApiInitializerMixin:interface)}.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export declare namespace ApiInitializerMixin {
|
|
50
|
+
/**
|
|
51
|
+
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiInitializerMixin` mixin.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
*
|
|
55
|
+
* The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
|
|
56
|
+
* the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
|
|
57
|
+
* the TypeScript type system cannot invoke a runtime test.)
|
|
58
|
+
*/
|
|
59
|
+
function isBaseClassOf(apiItem: ApiItem): apiItem is ApiInitializerMixin;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=ApiInitializerMixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiInitializerMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiInitializerMixin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKxD;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,eAAe;IAClE,qBAAqB,CAAC,EAAE,kBAAkB,CAAC;CAC5C;AAED,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,qBAAqB,CAAC,EAAE,kBAAkB,CAAC;CAC5C;AAID;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,mBAAoB,SAAQ,OAAO;IAClD;;OAEG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAEtC,gBAAgB;IAChB,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC;CACpE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,SAAS,mBAAmB,EACxE,SAAS,EAAE,UAAU,GAEpB,UAAU,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,mBAAmB,CAAC,CAgD5D;AAED;;;GAGG;AACH,yBAAiB,mBAAmB,CAAC;IACnC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,mBAAmB,CAE9E;CACF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
|
+
// See LICENSE in the project root for license information.s
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.ApiInitializerMixin = void 0;
|
|
6
|
+
const ApiDeclaredItem_1 = require("../items/ApiDeclaredItem");
|
|
7
|
+
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
8
|
+
const _initializerExcerpt = Symbol('ApiInitializerMixin._initializerExcerpt');
|
|
9
|
+
/**
|
|
10
|
+
* Mixin function for {@link (ApiInitializerMixin:interface)}.
|
|
11
|
+
*
|
|
12
|
+
* @param baseClass - The base class to be extended
|
|
13
|
+
* @returns A child class that extends baseClass, adding the {@link (ApiInitializerMixin:interface)} functionality.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
function ApiInitializerMixin(baseClass
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
) {
|
|
20
|
+
class MixedClass extends baseClass {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
constructor(...args) {
|
|
23
|
+
super(...args);
|
|
24
|
+
const options = args[0];
|
|
25
|
+
if (this instanceof ApiDeclaredItem_1.ApiDeclaredItem) {
|
|
26
|
+
if (options.initializerTokenRange) {
|
|
27
|
+
this[_initializerExcerpt] = this.buildExcerpt(options.initializerTokenRange);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw new node_core_library_1.InternalError('ApiInitializerMixin expects a base class that inherits from ApiDeclaredItem');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** @override */
|
|
35
|
+
static onDeserializeInto(options, context, jsonObject) {
|
|
36
|
+
baseClass.onDeserializeInto(options, context, jsonObject);
|
|
37
|
+
options.initializerTokenRange = jsonObject.initializerTokenRange;
|
|
38
|
+
}
|
|
39
|
+
get initializerExcerpt() {
|
|
40
|
+
return this[_initializerExcerpt];
|
|
41
|
+
}
|
|
42
|
+
/** @override */
|
|
43
|
+
serializeInto(jsonObject) {
|
|
44
|
+
super.serializeInto(jsonObject);
|
|
45
|
+
// Note that JSON does not support the "undefined" value, so we simply omit the field entirely if it is undefined
|
|
46
|
+
if (this.initializerExcerpt) {
|
|
47
|
+
jsonObject.initializerTokenRange = this.initializerExcerpt.tokenRange;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return MixedClass;
|
|
52
|
+
}
|
|
53
|
+
exports.ApiInitializerMixin = ApiInitializerMixin;
|
|
54
|
+
/**
|
|
55
|
+
* Static members for {@link (ApiInitializerMixin:interface)}.
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
(function (ApiInitializerMixin) {
|
|
59
|
+
/**
|
|
60
|
+
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiInitializerMixin` mixin.
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
*
|
|
64
|
+
* The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
|
|
65
|
+
* the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
|
|
66
|
+
* the TypeScript type system cannot invoke a runtime test.)
|
|
67
|
+
*/
|
|
68
|
+
function isBaseClassOf(apiItem) {
|
|
69
|
+
return apiItem.hasOwnProperty(_initializerExcerpt);
|
|
70
|
+
}
|
|
71
|
+
ApiInitializerMixin.isBaseClassOf = isBaseClassOf;
|
|
72
|
+
})(ApiInitializerMixin = exports.ApiInitializerMixin || (exports.ApiInitializerMixin = {}));
|
|
73
|
+
//# sourceMappingURL=ApiInitializerMixin.js.map
|