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":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (IApiStaticMixinOptions:interface)}.\n * @public\n */\nexport interface IApiStaticMixinOptions extends IApiItemOptions {\n isStatic: boolean;\n}\n\nexport interface IApiStaticMixinJson extends IApiItemJson {\n isStatic: boolean;\n}\n\nconst _isStatic: unique symbol = Symbol('ApiStaticMixin._isStatic');\n\n/**\n * The mixin base class for API items that can have the TypeScript `static` keyword applied to them.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiStaticMixin extends ApiItem {\n /**\n * Whether the declaration has the TypeScript `static` keyword.\n */\n readonly isStatic: boolean;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiStaticMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiStaticMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiStaticMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiStaticMixin) {\n class MixedClass extends baseClass implements ApiStaticMixin {\n public [_isStatic]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiStaticMixinOptions = args[0];\n this[_isStatic] = options.isStatic;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiStaticMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiStaticMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isStatic = jsonObject.isStatic;\n }\n\n public get isStatic(): boolean {\n return this[_isStatic];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiStaticMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isStatic = this.isStatic;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiStaticMixin:interface)}.\n * @public\n */\nexport namespace ApiStaticMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiStaticMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiStaticMixin {\n return apiItem.hasOwnProperty(_isStatic);\n }\n}\n"]}
{"version":3,"file":"ApiTypeParameterListMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiTypeParameterListMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAsE3D,8DAwEC;AA5ID,oDAAoD;AAEpD,oEAA6D;AAI7D,0DAAuD;AACvD,8DAA2D;AAyB3D,MAAM,eAAe,GAAkB,MAAM,CAAC,2CAA2C,CAAC,CAAC;AA2B3F;;;;;;;;GAQG;AACH,SAAgB,yBAAyB,CACvC,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,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YAEhC,MAAM,oBAAoB,GAA+B,EAAE,CAAC;YAC5D,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBAChD,oBAAoB,CAAC,IAAI,CAAC;oBACxB,iBAAiB,EAAE,aAAa,CAAC,IAAI;oBACrC,oBAAoB,EAAE,aAAa,CAAC,iBAAiB,CAAC,UAAU;oBAChE,qBAAqB,EAAE,aAAa,CAAC,kBAAkB,CAAC,UAAU;iBACnE,CAAC,CAAC;YACL,CAAC;YAED,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,UAAU,CAAC,cAAc,GAAG,oBAAoB,CAAC;YACnD,CAAC;QACH,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,yBAAyB;IACxC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IACjD,CAAC;IAFe,uCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,yBAAyB,yCAAzB,yBAAyB,QAazC","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/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport { InternalError } from '@rushstack/node-core-library';\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { Excerpt, IExcerptTokenRange } from './Excerpt';\nimport { TypeParameter } from '../model/TypeParameter';\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Represents parameter information that is part of {@link IApiTypeParameterListMixinOptions}\n * @public\n */\nexport interface IApiTypeParameterOptions {\n typeParameterName: string;\n constraintTokenRange: IExcerptTokenRange;\n defaultTypeTokenRange: IExcerptTokenRange;\n}\n\n/**\n * Constructor options for {@link (ApiTypeParameterListMixin:interface)}.\n * @public\n */\nexport interface IApiTypeParameterListMixinOptions extends IApiItemOptions {\n typeParameters: IApiTypeParameterOptions[];\n}\n\nexport interface IApiTypeParameterListMixinJson extends IApiItemJson {\n typeParameters: IApiTypeParameterOptions[];\n}\n\nconst _typeParameters: unique symbol = Symbol('ApiTypeParameterListMixin._typeParameters');\n\n/**\n * The mixin base class for API items that can have type parameters.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiTypeParameterListMixin extends ApiItem {\n /**\n * The type parameters.\n */\n readonly typeParameters: ReadonlyArray<TypeParameter>;\n\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiTypeParameterListMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiTypeParameterListMixin:interface)}\n * functionality.\n *\n * @public\n */\nexport function ApiTypeParameterListMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiTypeParameterListMixin) {\n class MixedClass extends baseClass implements ApiTypeParameterListMixin {\n public readonly [_typeParameters]: TypeParameter[];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiTypeParameterListMixinOptions = args[0];\n\n this[_typeParameters] = [];\n\n if (this instanceof ApiDeclaredItem) {\n if (options.typeParameters) {\n for (const typeParameterOptions of options.typeParameters) {\n const defaultTypeExcerpt: Excerpt = this.buildExcerpt(typeParameterOptions.defaultTypeTokenRange);\n const typeParameter: TypeParameter = new TypeParameter({\n name: typeParameterOptions.typeParameterName,\n constraintExcerpt: this.buildExcerpt(typeParameterOptions.constraintTokenRange),\n defaultTypeExcerpt,\n isOptional: !defaultTypeExcerpt.isEmpty,\n parent: this\n });\n\n this[_typeParameters].push(typeParameter);\n }\n }\n } else {\n throw new InternalError(\n 'ApiTypeParameterListMixin expects a base class that inherits from ApiDeclaredItem'\n );\n }\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiTypeParameterListMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiTypeParameterListMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.typeParameters = jsonObject.typeParameters || [];\n }\n\n public get typeParameters(): ReadonlyArray<TypeParameter> {\n return this[_typeParameters];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiTypeParameterListMixinJson>): void {\n super.serializeInto(jsonObject);\n\n const typeParameterObjects: IApiTypeParameterOptions[] = [];\n for (const typeParameter of this.typeParameters) {\n typeParameterObjects.push({\n typeParameterName: typeParameter.name,\n constraintTokenRange: typeParameter.constraintExcerpt.tokenRange,\n defaultTypeTokenRange: typeParameter.defaultTypeExcerpt.tokenRange\n });\n }\n\n if (typeParameterObjects.length > 0) {\n jsonObject.typeParameters = typeParameterObjects;\n }\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiTypeParameterListMixin:interface)}.\n * @public\n */\nexport namespace ApiTypeParameterListMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiParameterListMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiTypeParameterListMixin {\n return apiItem.hasOwnProperty(_typeParameters);\n }\n}\n"]}
{"version":3,"file":"Excerpt.js","sourceRoot":"","sources":["../../src/mixins/Excerpt.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,oEAAoD;AAEpD,cAAc;AACd,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,uCAAmB,CAAA;IAEnB;;OAEG;IACH,2CAAuB,CAAA;AACzB,CAAC,EAVW,gBAAgB,gCAAhB,gBAAgB,QAU3B;AA8BD;;;;GAIG;AACH,MAAa,YAAY;IAKvB,YAAmB,IAAsB,EAAE,IAAY,EAAE,kBAAyC;QAChG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,kGAAkG;QAClG,4FAA4F;QAC5F,kFAAkF;QAClF,IAAI,CAAC,KAAK,GAAG,wBAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;CACF;AApCD,oCAoCC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,OAAO;IAqBlB,YAAmB,MAAmC,EAAE,UAA8B;QACpF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IACE,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC;YAC9B,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM;YAC7C,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EACrD,CAAC;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"]}