Notably, this gets us `@actions/github` 6.0.1, which is necessary for `github.context.runAttempt` (so I have also updated `package.json` accordingly). On that note... great job following semver, GitHub! Between this and the non-breaking major version change on `@actions/cache`, I'm starting to feel like nobody on the Actions team understands how software versioning works.
51 lines
1.9 KiB
TypeScript
51 lines
1.9 KiB
TypeScript
import * as ts from "typescript";
|
|
import { AnyDesc } from "@bufbuild/protobuf";
|
|
export declare class CommentGenerator {
|
|
constructor();
|
|
/**
|
|
* Adds comments from the .proto as a JSDoc block.
|
|
*
|
|
* Looks up comments for the given descriptor in
|
|
* the source code info.
|
|
*
|
|
* Adds `@deprecated` tag if the element is
|
|
* marked deprecated. Also adds @deprecated if
|
|
* the descriptor is a type (enum, message) and
|
|
* the entire .proto file is marked deprecated.
|
|
*
|
|
* Adds `@generated` tag with source code
|
|
* information.
|
|
*
|
|
* Leading detached comments are added as line
|
|
* comments in front of the JSDoc block.
|
|
*
|
|
* Trailing comments are a bit weird. For .proto
|
|
* enums and messages, they sit between open
|
|
* bracket and first member. A message seems to
|
|
* only ever have a trailing comment if it is
|
|
* empty. For a simple solution, trailing
|
|
* comments on enums and messages should simply
|
|
* be appended to the leading block so that the
|
|
* information is not discarded.
|
|
*/
|
|
addCommentsForDescriptor(node: ts.Node, descriptor: AnyDesc, trailingCommentsMode: 'appendToLeadingBlock' | 'trailingLines'): void;
|
|
private getComments;
|
|
private stripTrailingNewlines;
|
|
/**
|
|
* Returns a block of source comments (no leading detached!),
|
|
* with @generated tags and @deprecated tag (if applicable).
|
|
*/
|
|
getCommentBlock(descriptor: AnyDesc, appendTrailingComments?: boolean): string;
|
|
/**
|
|
* Creates string like "@generated from protobuf field: string foo = 1;"
|
|
*/
|
|
makeGeneratedTag(desc: AnyDesc): string;
|
|
/**
|
|
* Returns "@deprecated\n" if explicitly deprecated.
|
|
* For top level types, also returns "@deprecated\n" if entire file is deprecated.
|
|
* Otherwise, returns "".
|
|
*/
|
|
makeDeprecatedTag(desc: AnyDesc): "" | "@deprecated\n";
|
|
private static isDeprecated;
|
|
}
|