utils/node_modules/@microsoft/tsdoc/lib/nodes/DocMemberReference.js.map
2024-02-07 01:33:07 -05:00

1 line
12 KiB
Plaintext

{"version":3,"file":"DocMemberReference.js","sourceRoot":"","sources":["../../src/nodes/DocMemberReference.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAgD,MAAM,WAAW,CAAC;AAK/F,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAuCvD;;;;;;;;GAQG;AACH;IAAwC,sCAAO;IAyB7C;;;OAGG;IACH,4BAAmB,UAA+E;QAAlG,YACE,kBAAM,UAAU,CAAC,SAsFlB;QApFC,IAAI,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE;YAC1C,KAAI,CAAC,OAAO,GAAG,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;YACvC,IAAI,UAAU,CAAC,UAAU,EAAE;gBACzB,KAAI,CAAC,WAAW,GAAG,IAAI,UAAU,CAAC;oBAChC,aAAa,EAAE,KAAI,CAAC,aAAa;oBACjC,WAAW,EAAE,WAAW,CAAC,mBAAmB;oBAC5C,OAAO,EAAE,UAAU,CAAC,UAAU;iBAC/B,CAAC,CAAC;aACJ;YACD,IAAI,UAAU,CAAC,sBAAsB,EAAE;gBACrC,KAAI,CAAC,uBAAuB,GAAG,IAAI,UAAU,CAAC;oBAC5C,aAAa,EAAE,KAAI,CAAC,aAAa;oBACjC,WAAW,EAAE,WAAW,CAAC,OAAO;oBAChC,OAAO,EAAE,UAAU,CAAC,sBAAsB;iBAC3C,CAAC,CAAC;aACJ;YAED,IAAI,UAAU,CAAC,sBAAsB,EAAE;gBACrC,KAAI,CAAC,uBAAuB,GAAG,IAAI,UAAU,CAAC;oBAC5C,aAAa,EAAE,KAAI,CAAC,aAAa;oBACjC,WAAW,EAAE,WAAW,CAAC,+BAA+B;oBACxD,OAAO,EAAE,UAAU,CAAC,sBAAsB;iBAC3C,CAAC,CAAC;a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,uBAAuB;YAC5B,IAAI,CAAC,mCAAmC;YAExC,IAAI,CAAC,iBAAiB;YACtB,IAAI,CAAC,aAAa;YAClB,IAAI,CAAC,0BAA0B;YAE/B,IAAI,CAAC,aAAa;YAClB,IAAI,CAAC,yBAAyB;YAE9B,IAAI,CAAC,SAAS;YACd,IAAI,CAAC,4BAA4B;YAEjC,IAAI,CAAC,wBAAwB;YAC7B,IAAI,CAAC,oCAAoC;SAC1C,CAAC;IACJ,CAAC;IACH,yBAAC;AAAD,CAAC,AArLD,CAAwC,OAAO,GAqL9C","sourcesContent":["import { DocNode, DocNodeKind, IDocNodeParameters, IDocNodeParsedParameters } from './DocNode';\r\nimport { DocMemberIdentifier } from './DocMemberIdentifier';\r\nimport { DocMemberSymbol } from './DocMemberSymbol';\r\nimport { DocMemberSelector } from './DocMemberSelector';\r\nimport { TokenSequence } from '../parser/TokenSequence';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\n\r\n/**\r\n * Constructor parameters for {@link DocMemberReference}.\r\n */\r\nexport interface IDocMemberReferenceParameters extends IDocNodeParameters {\r\n hasDot: boolean;\r\n\r\n memberIdentifier?: DocMemberIdentifier;\r\n memberSymbol?: DocMemberSymbol;\r\n\r\n selector?: DocMemberSelector;\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link DocMemberReference}.\r\n */\r\nexport interface IDocMemberReferenceParsedParameters extends IDocNodeParsedParameters {\r\n dotExcerpt?: TokenSequence;\r\n spacingAfterDotExcerpt?: TokenSequence;\r\n\r\n leftParenthesisExcerpt?: TokenSequence;\r\n spacingAfterLeftParenthesisExcerpt?: TokenSequence;\r\n\r\n memberIdentifier?: DocMemberIdentifier;\r\n memberSymbol?: DocMemberSymbol;\r\n\r\n spacingAfterMemberExcerpt?: TokenSequence;\r\n\r\n colonExcerpt?: TokenSequence;\r\n spacingAfterColonExcerpt?: TokenSequence;\r\n\r\n selector?: DocMemberSelector;\r\n spacingAfterSelectorExcerpt?: TokenSequence;\r\n\r\n rightParenthesisExcerpt?: TokenSequence;\r\n spacingAfterRightParenthesisExcerpt?: TokenSequence;\r\n}\r\n\r\n/**\r\n * A {@link DocDeclarationReference | declaration reference} includes a chain of\r\n * member references represented using `DocMemberReference` nodes.\r\n *\r\n * @remarks\r\n * For example, `example-library#ui.controls.Button.(render:static)` is a\r\n * declaration reference that contains three member references:\r\n * `ui`, `.controls`, and `.Button`, and `.(render:static)`.\r\n */\r\nexport class DocMemberReference extends DocNode {\r\n // The \".\" token if unless this was the member reference in the chain\r\n private readonly _hasDot: boolean;\r\n private readonly _dotExcerpt: DocExcerpt | undefined;\r\n private readonly _spacingAfterDotExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _leftParenthesisExcerpt: DocExcerpt | undefined;\r\n private readonly _spacingAfterLeftParenthesisExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _memberIdentifier: DocMemberIdentifier | undefined;\r\n\r\n private readonly _memberSymbol: DocMemberSymbol | undefined;\r\n\r\n private readonly _spacingAfterMemberExcerpt: DocExcerpt | undefined;\r\n\r\n // The \":\" token that separates the identifier and selector parts\r\n private readonly _colonExcerpt: DocExcerpt | undefined;\r\n private readonly _spacingAfterColonExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _selector: DocMemberSelector | undefined;\r\n private readonly _spacingAfterSelectorExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _rightParenthesisExcerpt: DocExcerpt | undefined;\r\n private readonly _spacingAfterRightParenthesisExcerpt: DocExcerpt | undefined;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocMemberReferenceParameters | IDocMemberReferenceParsedParameters) {\r\n super(parameters);\r\n\r\n if (DocNode.isParsedParameters(parameters)) {\r\n this._hasDot = !!parameters.dotExcerpt;\r\n if (parameters.dotExcerpt) {\r\n this._dotExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.MemberReference_Dot,\r\n content: parameters.dotExcerpt\r\n });\r\n }\r\n if (parameters.spacingAfterDotExcerpt) {\r\n this._spacingAfterDotExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterDotExcerpt\r\n });\r\n }\r\n\r\n if (parameters.leftParenthesisExcerpt) {\r\n this._leftParenthesisExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.MemberReference_LeftParenthesis,\r\n content: parameters.leftParenthesisExcerpt\r\n });\r\n }\r\n if (parameters.spacingAfterLeftParenthesisExcerpt) {\r\n this._spacingAfterLeftParenthesisExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterLeftParenthesisExcerpt\r\n });\r\n }\r\n\r\n if (parameters.spacingAfterMemberExcerpt) {\r\n this._spacingAfterMemberExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterMemberExcerpt\r\n });\r\n }\r\n\r\n if (parameters.colonExcerpt) {\r\n this._colonExcerpt = new DocExcerpt({\r\n excerptKind: ExcerptKind.MemberReference_Colon,\r\n configuration: this.configuration,\r\n content: parameters.colonExcerpt\r\n });\r\n }\r\n if (parameters.spacingAfterColonExcerpt) {\r\n this._spacingAfterColonExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterColonExcerpt\r\n });\r\n }\r\n\r\n if (parameters.spacingAfterSelectorExcerpt) {\r\n this._spacingAfterSelectorExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterSelectorExcerpt\r\n });\r\n }\r\n\r\n if (parameters.rightParenthesisExcerpt) {\r\n this._rightParenthesisExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.MemberReference_RightParenthesis,\r\n content: parameters.rightParenthesisExcerpt\r\n });\r\n }\r\n if (parameters.spacingAfterRightParenthesisExcerpt) {\r\n this._spacingAfterRightParenthesisExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterRightParenthesisExcerpt\r\n });\r\n }\r\n } else {\r\n this._hasDot = parameters.hasDot;\r\n }\r\n\r\n this._memberIdentifier = parameters.memberIdentifier;\r\n this._memberSymbol = parameters.memberSymbol;\r\n this._selector = parameters.selector;\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.MemberReference;\r\n }\r\n\r\n /**\r\n * True if this member reference is preceded by a dot (\".\") token.\r\n * It should be false only for the first member in the chain.\r\n */\r\n public get hasDot(): boolean {\r\n return this._hasDot;\r\n }\r\n\r\n /**\r\n * The identifier for the referenced member.\r\n * @remarks\r\n * Either `memberIdentifier` or `memberSymbol` may be specified, but not both.\r\n */\r\n public get memberIdentifier(): DocMemberIdentifier | undefined {\r\n return this._memberIdentifier;\r\n }\r\n\r\n /**\r\n * The ECMAScript 6 symbol expression, which may be used instead of an identifier\r\n * to indicate the referenced member.\r\n * @remarks\r\n * Either `memberIdentifier` or `memberSymbol` may be specified, but not both.\r\n */\r\n public get memberSymbol(): DocMemberSymbol | undefined {\r\n return this._memberSymbol;\r\n }\r\n\r\n /**\r\n * A TSDoc selector, which may be optionally when the identifier or symbol is insufficient\r\n * to unambiguously determine the referenced declaration.\r\n */\r\n public get selector(): DocMemberSelector | undefined {\r\n return this._selector;\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [\r\n this._dotExcerpt,\r\n this._spacingAfterDotExcerpt,\r\n\r\n this._leftParenthesisExcerpt,\r\n this._spacingAfterLeftParenthesisExcerpt,\r\n\r\n this._memberIdentifier,\r\n this._memberSymbol,\r\n this._spacingAfterMemberExcerpt,\r\n\r\n this._colonExcerpt,\r\n this._spacingAfterColonExcerpt,\r\n\r\n this._selector,\r\n this._spacingAfterSelectorExcerpt,\r\n\r\n this._rightParenthesisExcerpt,\r\n this._spacingAfterRightParenthesisExcerpt\r\n ];\r\n }\r\n}\r\n"]}