| | |
| | | } |
| | | |
| | | interface BaseNode { |
| | | leadingComments: ReadonlyArray<Comment> | null; |
| | | innerComments: ReadonlyArray<Comment> | null; |
| | | trailingComments: ReadonlyArray<Comment> | null; |
| | | start: number | null; |
| | | end: number | null; |
| | | loc: SourceLocation | null; |
| | | type: Node["type"]; |
| | | leadingComments?: ReadonlyArray<Comment> | null; |
| | | innerComments?: ReadonlyArray<Comment> | null; |
| | | trailingComments?: ReadonlyArray<Comment> | null; |
| | | start?: number | null; |
| | | end?: number | null; |
| | | loc?: SourceLocation | null; |
| | | range?: [number, number]; |
| | | extra?: Record<string, unknown>; |
| | | } |
| | | |
| | | export type CommentTypeShorthand = "leading" | "inner" | "trailing"; |
| | | |
| | | export type Node = ${t.TYPES.sort().join(" | ")};\n\n`; |
| | | export type Node = ${t.TYPES.filter(k => !t.FLIPPED_ALIAS_KEYS[k]) |
| | | .sort() |
| | | .join(" | ")};\n\n`; |
| | | |
| | | const deprecatedAlias = {}; |
| | | for (const type in t.DEPRECATED_KEYS) { |
| | |
| | | code += ` ${type}: ${type};\n`; |
| | | } |
| | | code += "}\n\n"; |
| | | code += `export type DeprecatedAliases = ${Object.keys( |
| | | t.DEPRECATED_KEYS |
| | | ).join(" | ")}\n\n`; |
| | | |
| | | return code; |
| | | } |