mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
build: package api-extractor and -model (#9920)
* fix(ExceptText): don't display import("d..-types/v10"). in return type
* Squashed 'packages/api-extractor-model/' content from commit 39ecb196c
git-subtree-dir: packages/api-extractor-model
git-subtree-split: 39ecb196ca210bdf84ba6c9cadb1bb93571849d7
* Squashed 'packages/api-extractor/' content from commit 341ad6c51
git-subtree-dir: packages/api-extractor
git-subtree-split: 341ad6c51b01656d4f73b74ad4bdb3095f9262c4
* feat(api-extractor): add api-extractor and -model
* fix: package.json docs script
* fix(SourcLink): use <> instead of function syntax
* fix: make packages private
* fix: rest params showing in docs, added labels
* fix: missed two files
* fix: cpy-cli & pnpm-lock
* fix: increase icon size
* fix: icon size again
This commit is contained in:
46
packages/api-extractor/src/analyzer/AstEntity.ts
Normal file
46
packages/api-extractor/src/analyzer/AstEntity.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
|
||||
/**
|
||||
* `AstEntity` is the abstract base class for analyzer objects that can become a `CollectorEntity`.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* The subclasses are:
|
||||
* ```
|
||||
* - AstEntity
|
||||
* - AstSymbol
|
||||
* - AstSyntheticEntity
|
||||
* - AstImport
|
||||
* - AstNamespaceImport
|
||||
* ```
|
||||
*/
|
||||
export abstract class AstEntity {
|
||||
/**
|
||||
* The original name of the symbol, as exported from the module (i.e. source file)
|
||||
* containing the original TypeScript definition. Constructs such as
|
||||
* `import { X as Y } from` may introduce other names that differ from the local name.
|
||||
*
|
||||
* @remarks
|
||||
* For the most part, `localName` corresponds to `followedSymbol.name`, but there
|
||||
* are some edge cases. For example, the ts.Symbol.name for `export default class X { }`
|
||||
* is actually `"default"`, not `"X"`.
|
||||
*/
|
||||
public abstract readonly localName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* `AstSyntheticEntity` is the abstract base class for analyzer objects whose emitted declarations
|
||||
* are not text transformations performed by the `Span` helper.
|
||||
*
|
||||
* @remarks
|
||||
* Most of API Extractor's output is produced by using the using the `Span` utility to regurgitate strings from
|
||||
* the input .d.ts files. If we need to rename an identifier, the `Span` visitor can pick out an interesting
|
||||
* node and rewrite its string, but otherwise the transformation operates on dumb text and not compiler concepts.
|
||||
* (Historically we did this because the compiler's emitter was an internal API, but it still has some advantages,
|
||||
* for example preserving syntaxes generated by an older compiler to avoid incompatibilities.)
|
||||
*
|
||||
* This strategy does not work for cases where the output looks very different from the input. Today these
|
||||
* cases are always kinds of `import` statements, but that may change in the future.
|
||||
*/
|
||||
export abstract class AstSyntheticEntity extends AstEntity {}
|
||||
Reference in New Issue
Block a user