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YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAsC;QACzD,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAEhC,UAAU,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrF,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,aAAa,GAAc,2CAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,MAAM,UAAU,GAAe,IAAI,CAAC,UAAU,CAAC,CAAC,8BAAoB,CAAC,4BAAkB,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,qCAAmB,CAAC;IACpC,CAAC;CACF;AA5DD,oCA4DC","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';\nimport { ApiItemKind } from '../items/ApiItem';\nimport {\n ApiItemContainerMixin,\n type IApiItemContainerMixinOptions,\n type IApiItemContainerJson\n} from '../mixins/ApiItemContainerMixin';\nimport {\n ApiDeclaredItem,\n type IApiDeclaredItemOptions,\n type IApiDeclaredItemJson\n} from '../items/ApiDeclaredItem';\nimport {\n type IApiReleaseTagMixinOptions,\n ApiReleaseTagMixin,\n type IApiReleaseTagMixinJson\n} from '../mixins/ApiReleaseTagMixin';\nimport type { IExcerptTokenRange } from '../mixins/Excerpt';\nimport { HeritageType } from './HeritageType';\nimport { type IApiNameMixinOptions, ApiNameMixin, type IApiNameMixinJson } from '../mixins/ApiNameMixin';\nimport {\n type IApiTypeParameterListMixinOptions,\n type IApiTypeParameterListMixinJson,\n ApiTypeParameterListMixin\n} from '../mixins/ApiTypeParameterListMixin';\nimport type { DeserializerContext } from './DeserializerContext';\nimport {\n type IApiExportedMixinJson,\n type IApiExportedMixinOptions,\n ApiExportedMixin\n} from '../mixins/ApiExportedMixin';\n\n/**\n * Constructor options for {@link ApiInterface}.\n * @public\n */\nexport interface IApiInterfaceOptions\n extends IApiItemContainerMixinOptions,\n IApiNameMixinOptions,\n IApiTypeParameterListMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiDeclaredItemOptions,\n IApiExportedMixinOptions {\n extendsTokenRanges: IExcerptTokenRange[];\n}\n\nexport interface IApiInterfaceJson\n extends IApiItemContainerJson,\n IApiNameMixinJson,\n IApiTypeParameterListMixinJson,\n IApiReleaseTagMixinJson,\n IApiDeclaredItemJson,\n IApiExportedMixinJson {\n extendsTokenRanges: 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 * `ApiInterface` represents a TypeScript declaration such as this:\n *\n * ```ts\n * export interface X extends Y {\n * }\n * ```\n *\n * @public\n */\nexport class ApiInterface extends ApiItemContainerMixin(\n ApiNameMixin(ApiTypeParameterListMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem))))\n) {\n private readonly _extendsTypes: HeritageType[] = [];\n\n public constructor(options: IApiInterfaceOptions) {\n super(options);\n\n for (const extendsTokenRange of options.extendsTokenRanges) {\n this._extendsTypes.push(new HeritageType(this.buildExcerpt(extendsTokenRange)));\n }\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.Interface}`;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiInterfaceOptions>,\n context: DeserializerContext,\n jsonObject: IApiInterfaceJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.extendsTokenRanges = jsonObject.extendsTokenRanges;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Interface;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiInterface.getContainerKey(this.name);\n }\n\n /**\n * The list of base interfaces that this interface inherits from using the `extends` keyword.\n */\n public get extendsTypes(): ReadonlyArray<HeritageType> {\n return this._extendsTypes;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiInterfaceJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.extendsTokenRanges = this.extendsTypes.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.Interface);\n }\n}\n"]} |