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AAC;YACD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC/F,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IACjE,CAAC;CACF;AApDD,0BAoDC","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 type { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { Text } from '@rushstack/node-core-library';\n\n/** @public */\nexport enum ExcerptTokenKind {\n /**\n * Generic text without any special properties\n */\n Content = 'Content',\n\n /**\n * A reference to an API declaration\n */\n Reference = 'Reference'\n}\n\n/**\n * Used by {@link Excerpt} to indicate a range of indexes within an array of `ExcerptToken` objects.\n *\n * @public\n */\nexport interface IExcerptTokenRange {\n /**\n * The starting index of the span.\n */\n startIndex: number;\n\n /**\n * The index of the last member of the span, plus one.\n *\n * @remarks\n *\n * If `startIndex` and `endIndex` are the same number, then the span is empty.\n */\n endIndex: number;\n}\n\n/** @public */\nexport interface IExcerptToken {\n readonly kind: ExcerptTokenKind;\n text: string;\n canonicalReference?: string;\n}\n\n/**\n * Represents a fragment of text belonging to an {@link Excerpt} object.\n *\n * @public\n */\nexport class ExcerptToken {\n private readonly _kind: ExcerptTokenKind;\n private readonly _text: string;\n private readonly _canonicalReference: DeclarationReference | undefined;\n\n public constructor(kind: ExcerptTokenKind, text: string, canonicalReference?: DeclarationReference) {\n this._kind = kind;\n\n // Standardize the newlines across operating systems. Even though this may deviate from the actual\n // input source file that was parsed, it's useful because the newline gets serialized inside\n // a string literal in .api.json, which cannot be automatically normalized by Git.\n this._text = Text.convertToLf(text);\n this._canonicalReference = canonicalReference;\n }\n\n /**\n * Indicates the kind of token.\n */\n public get kind(): ExcerptTokenKind {\n return this._kind;\n }\n\n /**\n * The text fragment.\n */\n public get text(): string {\n return this._text;\n }\n\n /**\n * The hyperlink target for a token whose type is `ExcerptTokenKind.Reference`. For other token types,\n * this property will be `undefined`.\n */\n public get canonicalReference(): DeclarationReference | undefined {\n return this._canonicalReference;\n }\n}\n\n/**\n * The `Excerpt` class is used by {@link ApiDeclaredItem} to represent a TypeScript code fragment that may be\n * annotated with hyperlinks to declared types (and in the future, source code locations).\n *\n * @remarks\n * API Extractor's .api.json file format stores excerpts compactly as a start/end indexes into an array of tokens.\n * Every `ApiDeclaredItem` has a \"main excerpt\" corresponding to the full list of tokens. The declaration may\n * also have have \"captured\" excerpts that correspond to subranges of tokens.\n *\n * For example, if the main excerpt is:\n *\n * ```\n * function parse(s: string): Vector | undefined;\n * ```\n *\n * ...then this entire signature is the \"main excerpt\", whereas the function's return type `Vector | undefined` is a\n * captured excerpt. The `Vector` token might be a hyperlink to that API item.\n *\n * An excerpt may be empty (i.e. a token range containing zero tokens). For example, if a function's return value\n * is not explicitly declared, then the returnTypeExcerpt will be empty. By contrast, a class constructor cannot\n * have a return value, so ApiConstructor has no returnTypeExcerpt property at all.\n *\n * @public\n */\nexport class Excerpt {\n /**\n * The complete list of tokens for the source code fragment that this excerpt is based upon.\n * If this object is the main excerpt, then it will span all of the tokens; otherwise, it will correspond to\n * a range within the array.\n */\n public readonly tokens: ReadonlyArray<ExcerptToken>;\n\n /**\n * Specifies the excerpt's range within the `tokens` array.\n */\n public readonly tokenRange: Readonly<IExcerptTokenRange>;\n\n /**\n * The tokens spanned by this excerpt. It is the range of the `tokens` array as specified by the `tokenRange`\n * property.\n */\n public readonly spannedTokens: ReadonlyArray<ExcerptToken>;\n\n private _text: string | undefined;\n\n public constructor(tokens: ReadonlyArray<ExcerptToken>, tokenRange: IExcerptTokenRange) {\n this.tokens = tokens;\n this.tokenRange = tokenRange;\n\n if (\n this.tokenRange.startIndex < 0 ||\n this.tokenRange.endIndex > this.tokens.length ||\n this.tokenRange.startIndex > this.tokenRange.endIndex\n ) {\n throw new Error('Invalid token range');\n }\n\n this.spannedTokens = this.tokens.slice(this.tokenRange.startIndex, this.tokenRange.endIndex);\n }\n\n /**\n * The excerpted text, formed by concatenating the text of the `spannedTokens` strings.\n */\n public get text(): string {\n if (this._text === undefined) {\n this._text = this.spannedTokens.map((x) => x.text).join('');\n }\n return this._text;\n }\n\n /**\n * Returns true if the excerpt is an empty range.\n */\n public get isEmpty(): boolean {\n return this.tokenRange.startIndex === this.tokenRange.endIndex;\n }\n}\n"]}
{"version":3,"file":"IFindApiItemsResult.js","sourceRoot":"","sources":["../../src/mixins/IFindApiItemsResult.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AA2C3D;;;GAGG;AACH,IAAY,qBAoBX;AApBD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,sFAA6D,CAAA;IAE7D;;OAEG;IACH,2FAAkE,CAAA;IAElE;;OAEG;IACH,yEAAgD,CAAA;IAEhD;;OAEG;IACH,6DAAoC,CAAA;AACtC,CAAC,EApBW,qBAAqB,qCAArB,qBAAqB,QAoBhC","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 type { ApiItem } from '../items/ApiItem';\n\n/**\n * Generic result object for finding API items used by different kinds of find operations.\n * @public\n */\nexport interface IFindApiItemsResult {\n /**\n * The API items that were found. Not guaranteed to be complete, see `maybeIncompleteResult`.\n */\n items: ApiItem[];\n\n /**\n * Diagnostic messages regarding the find operation.\n */\n messages: IFindApiItemsMessage[];\n\n /**\n * Indicates whether the result is potentially incomplete due to errors during the find operation.\n * If true, the `messages` explain the errors in more detail.\n */\n maybeIncompleteResult: boolean;\n}\n\n/**\n * This object is used for messages returned as part of `IFindApiItemsResult`.\n * @public\n */\nexport interface IFindApiItemsMessage {\n /**\n * Unique identifier for the message.\n * @beta\n */\n messageId: FindApiItemsMessageId;\n\n /**\n * Text description of the message.\n */\n text: string;\n}\n\n/**\n * Unique identifiers for messages returned as part of `IFindApiItemsResult`.\n * @public\n */\nexport enum FindApiItemsMessageId {\n /**\n * \"Unable to resolve declaration reference within API item ___: ___\"\n */\n DeclarationResolutionFailed = 'declaration-resolution-failed',\n\n /**\n * \"Unable to analyze extends clause ___ of API item ___ because no canonical reference was found.\"\n */\n ExtendsClauseMissingReference = 'extends-clause-missing-reference',\n\n /**\n * \"Unable to analyze references of API item ___ because it is not associated with an ApiModel\"\n */\n NoAssociatedApiModel = 'no-associated-api-model',\n\n /**\n * \"Unable to analyze references of API item ___ because it is of unsupported kind ___\"\n */\n UnsupportedKind = 'unsupported-kind'\n}\n"]}
{"version":3,"file":"Mixin.js","sourceRoot":"","sources":["../../src/mixins/Mixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","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 * This abstraction is used by the mixin pattern.\n * It describes a class constructor.\n * @public\n */\nexport type Constructor<T = {}> = new (...args: any[]) => T; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n/**\n * This abstraction is used by the mixin pattern.\n * It describes the \"static side\" of a class.\n *\n * @public\n */\nexport type PropertiesOf<T> = { [K in keyof T]: T[K] };\n"]}
{"version":3,"file":"ApiCallSignature.js","sourceRoot":"","sources":["../../src/model/ApiCallSignature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAIiE;AAEjE,8CAA+C;AAC/C,8DAAyF;AACzF,2EAA4G;AAC5G,qEAAmG;AACnG,qEAAmG;AACnG,mFAG6C;AAa7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAa,gBAAiB,SAAQ,IAAA,qDAAyB,EAC7D,IAAA,6CAAqB,EAAC,IAAA,uCAAkB,EAAC,IAAA,uCAAkB,EAAC,iCAAe,CAAC,CAAC,CAAC,CAC/E;IACC,YAAmB,OAAiC;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,aAAqB;QACjD,OAAO,IAAI,qBAAW,CAAC,aAAa,IAAI,aAAa,EAAE,CAAC;IAC1D,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,aAAa,CAAC;IACnC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9D,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,MAAM,GAAyB,IAAI,CAAC,MAAM;YAC9C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB;YAChC,CAAC,CAAC,iDAAiD;gBACjD,2CAAoB,CAAC,KAAK,EAAE,CAAC,iBAAiB,CAAC,iCAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACnF,OAAO,MAAM,CAAC,WAAW,CAAC,8BAAO,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACzF,CAAC;CACF;AA7BD,4CA6BC","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 {\n DeclarationReference,\n Meaning,\n Navigation\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport { ApiItemKind } from '../items/ApiItem';\nimport { type IApiDeclaredItemOptions, ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport { type IApiParameterListMixinOptions, ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport { type IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';\nimport { type IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';\nimport {\n type IApiTypeParameterListMixinOptions,\n ApiTypeParameterListMixin\n} from '../mixins/ApiTypeParameterListMixin';\n\n/**\n * Constructor options for {@link ApiCallSignature}.\n * @public\n */\nexport interface IApiCallSignatureOptions\n extends IApiTypeParameterListMixinOptions,\n IApiParameterListMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiReturnTypeMixinOptions,\n IApiDeclaredItemOptions {}\n\n/**\n * Represents a TypeScript function call signature.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiCallSignature` represents a TypeScript declaration such as `(x: number, y: number): number`\n * in this example:\n *\n * ```ts\n * export interface IChooser {\n * // A call signature:\n * (x: number, y: number): number;\n *\n * // Another overload for this call signature:\n * (x: string, y: string): string;\n * }\n *\n * function chooseFirst<T>(x: T, y: T): T {\n * return x;\n * }\n *\n * let chooser: IChooser = chooseFirst;\n * ```\n *\n * @public\n */\nexport class ApiCallSignature extends ApiTypeParameterListMixin(\n ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiDeclaredItem)))\n) {\n public constructor(options: IApiCallSignatureOptions) {\n super(options);\n }\n\n public static getContainerKey(overloadIndex: number): string {\n return `|${ApiItemKind.CallSignature}|${overloadIndex}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.CallSignature;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiCallSignature.getContainerKey(this.overloadIndex);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const parent: DeclarationReference = this.parent\n ? this.parent.canonicalReference\n : // .withMeaning() requires some kind of component\n DeclarationReference.empty().addNavigationStep(Navigation.Members, '(parent)');\n return parent.withMeaning(Meaning.CallSignature).withOverloadIndex(this.overloadIndex);\n }\n}\n"]}
{"version":3,"file":"ApiClass.js","sourceRoot":"","sources":["../../src/model/ApiClass.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAKiE;AAEjE,8CAA+C;AAC/C,8DAIkC;AAClC,2EAA4G;AAC5G,qEAAmG;AAEnG,iDAA8C;AAC9C,yDAAiF;AACjF,mFAI6C;AAE7C,iEAIoC;AACpC,iEAIoC;AA2BpC;;;;;;;;;;;;;;;GAeG;AACH,MAAa,QAAS,SAAQ,IAAA,6CAAqB,EACjD,IAAA,2BAAY,EACV,IAAA,mCAAgB,EAAC,IAAA,qDAAyB,EAAC,IAAA,uCAAkB,EAAC,IAAA,mCAAgB,EAAC,iCAAe,CAAC,CAAC,CAAC,CAAC,CACnG,CACF;IAQC,YAAmB,OAAyB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QAHA,qBAAgB,GAAmB,EAAE,CAAC;QAKrD,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;YAC9B,IAAI,CAAC,WAAW,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACpF,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC/B,CAAC;QAED,KAAK,MAAM,oBAAoB,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;YACjE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;QACxF,C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AAC,CAAC,iCAAU,CAAC,OAAO,CAAC,CAAC,CAAC,iCAAU,CAAC,MAAM,CAAC;QACxF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,2CAAoB,CAAC,KAAK,EAAE,CAAC;aACjF,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC;aAC5C,WAAW,CAAC,8BAAO,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACF;AA/ED,4BA+EC","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 {\n DeclarationReference,\n Meaning,\n Navigation,\n type Component\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport { ApiItemKind } from '../items/ApiItem';\nimport {\n ApiDeclaredItem,\n type IApiDeclaredItemOptions,\n type IApiDeclaredItemJson\n} from '../items/ApiDeclaredItem';\nimport { ApiItemContainerMixin, type IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin';\nimport { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport type { IExcerptTokenRange } from '../mixins/Excerpt';\nimport { HeritageType } from './HeritageType';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport {\n ApiTypeParameterListMixin,\n type IApiTypeParameterListMixinOptions,\n type IApiTypeParameterListMixinJson\n} from '../mixins/ApiTypeParameterListMixin';\nimport type { DeserializerContext } from './DeserializerContext';\nimport {\n type IApiExportedMixinJson,\n type IApiExportedMixinOptions,\n ApiExportedMixin\n} from '../mixins/ApiExportedMixin';\nimport {\n ApiAbstractMixin,\n type IApiAbstractMixinJson,\n type IApiAbstractMixinOptions\n} from '../mixins/ApiAbstractMixin';\n\n/**\n * Constructor options for {@link ApiClass}.\n * @public\n */\nexport interface IApiClassOptions\n extends IApiItemContainerMixinOptions,\n IApiNameMixinOptions,\n IApiAbstractMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiDeclaredItemOptions,\n IApiTypeParameterListMixinOptions,\n IApiExportedMixinOptions {\n extendsTokenRange: IExcerptTokenRange | undefined;\n implementsTokenRanges: IExcerptTokenRange[];\n}\n\nexport interface IApiClassJson\n extends IApiDeclaredItemJson,\n IApiAbstractMixinJson,\n IApiTypeParameterListMixinJson,\n IApiExportedMixinJson {\n extendsTokenRange?: IExcerptTokenRange;\n implementsTokenRanges: IExcerptTokenRange[];\n}\n\n/**\n * Represents a TypeScript class declaration.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiClass` represents a TypeScript declaration such as this:\n *\n * ```ts\n * export class X { }\n * ```\n *\n * @public\n */\nexport class ApiClass extends ApiItemContainerMixin(\n ApiNameMixin(\n ApiAbstractMixin(ApiTypeParameterListMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem))))\n )\n) {\n /**\n * The base class that this class inherits from (using the `extends` keyword), or undefined if there is no base class.\n */\n public readonly extendsType: HeritageType | undefined;\n\n private readonly _implementsTypes: HeritageType[] = [];\n\n public constructor(options: IApiClassOptions) {\n super(options);\n\n if (options.extendsTokenRange) {\n this.extendsType = new HeritageType(this.buildExcerpt(options.extendsTokenRange));\n } else {\n this.extendsType = undefined;\n }\n\n for (const implementsTokenRange of options.implementsTokenRanges) {\n this._implementsTypes.push(new HeritageType(this.buildExcerpt(implementsTokenRange)));\n }\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.Class}`;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiClassOptions>,\n context: DeserializerContext,\n jsonObject: IApiClassJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.extendsTokenRange = jsonObject.extendsTokenRange;\n options.implementsTokenRanges = jsonObject.implementsTokenRanges;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Class;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiClass.getContainerKey(this.name);\n }\n\n /**\n * The list of interfaces that this class implements using the `implements` keyword.\n */\n public get implementsTypes(): ReadonlyArray<HeritageType> {\n return this._implementsTypes;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiClassJson>): void {\n super.serializeInto(jsonObject);\n\n // Note that JSON does not support the \"undefined\" value, so we simply omit the field entirely if it is undefined\n if (this.extendsType) {\n jsonObject.extendsTokenRange = this.extendsType.excerpt.tokenRange;\n }\n\n jsonObject.implementsTokenRanges = this.implementsTypes.map((x) => x.excerpt.tokenRange);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\n const navigation: Navigation = this.isExported ? Navigation.Exports : Navigation.Locals;\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\n .addNavigationStep(navigation, nameComponent)\n .withMeaning(Meaning.Class);\n }\n}\n"]}