-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Clean up public API a bit #58076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up public API a bit #58076
Conversation
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
@@ -4167,6 +4169,7 @@ export interface FlowReduceLabel extends FlowNodeBase { | |||
antecedent: FlowNode; | |||
} | |||
|
|||
/** @internal */ | |||
export type FlowType = Type | IncompleteType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably I should have noticed this in #58036, but we already make public all of the other types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1236,6 +1238,7 @@ export interface ReferencedSymbolEntry extends ReferenceEntry { | |||
isDefinition?: boolean; | |||
} | |||
|
|||
/** @internal */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to revert this one; it's used :( https://github.com/search?q=%2Fts%5C.SymbolDisplayPartKind%2F&type=code
@@ -1275,6 +1278,7 @@ export interface SymbolDisplayPart { | |||
kind: string; | |||
} | |||
|
|||
/** @internal */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -896,6 +896,7 @@ export const enum ModifierFlags { | |||
Modifier = All & ~Decorator, | |||
} | |||
|
|||
/** @internal */ | |||
export const enum JsxFlags { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used once, but I feel like this shouldn't be exported: https://github.com/search?q=%2F%5Cbts%5C.JsxFlags%2F+%28language%3ATypeScript+OR+language%3AJavaScript%29&type=code
@@ -3787,6 +3788,7 @@ export interface FileReference extends TextRange { | |||
preserve?: boolean; | |||
} | |||
|
|||
/** @internal */ | |||
export interface CheckJsDirective extends TextRange { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -4812,21 +4815,6 @@ export interface EmitTransformers { | |||
declarationTransformers: readonly TransformerFactory<SourceFile | Bundle>[]; | |||
} | |||
|
|||
export interface SourceMapSpan { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looked bad but these are all forks of ourselves: https://github.com/search?q=%2F%5Cbts%5C.SourceMapSpan%2F+%28language%3ATypeScript+OR+language%3AJavaScript%29&type=code
@@ -6774,6 +6762,7 @@ export type TypeMapper = | |||
| { kind: TypeMapKind.Function; func: (t: Type) => Type; debugInfo?: () => string; } | |||
| { kind: TypeMapKind.Composite | TypeMapKind.Merged; mapper1: TypeMapper; mapper2: TypeMapper; }; | |||
|
|||
/** @internal */ | |||
// dprint-ignore | |||
export const enum InferencePriority { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -509,7 +509,7 @@ export function convertUserPreferences(preferences: protocol.UserPreferences): U | |||
return userPreferences; | |||
} | |||
|
|||
export interface HostConfiguration { | |||
interface HostConfiguration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -298,7 +298,7 @@ export function formatDiagnosticToProtocol(diag: Diagnostic, includeFileName: bo | |||
: common; | |||
} | |||
|
|||
export interface PendingErrorCheck { | |||
interface PendingErrorCheck { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -6,12 +6,6 @@ import { | |||
WatchOptions, | |||
} from "./_namespaces/ts"; | |||
|
|||
export interface CompressedData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing a full search, it seems like a lot of this is somehow used externally :(
@@ -293,6 +293,7 @@ export const enum PackageJsonAutoImportPreference { | |||
Auto, | |||
} | |||
|
|||
/** @internal */ | |||
export interface PerformanceEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -304,6 +305,7 @@ export enum LanguageServiceMode { | |||
Syntactic, | |||
} | |||
|
|||
/** @internal */ | |||
export interface IncompleteCompletionsCache { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1585,12 +1589,6 @@ export const enum OutliningSpanKind { | |||
Imports = "imports", | |||
} | |||
|
|||
export const enum OutputFileType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used but by a very, very old project https://github.com/search?q=%2F%5Cbts%5C.OutputFileType%2F+%28language%3ATypeScript+OR+language%3AJavaScript%29&type=code
@@ -1771,6 +1769,7 @@ export const enum ScriptElementKind { | |||
linkText = "link text", | |||
} | |||
|
|||
/** @internal */ | |||
export const enum ScriptElementKindModifier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1907,6 +1906,7 @@ export interface RefactorContext extends textChanges.TextChangesContext { | |||
kind?: string; | |||
} | |||
|
|||
/** @internal */ | |||
export interface InlayHintsContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following #58036, I made a script to process our public API and find elements which are unreferenced.
There's a lot more than this, including:
I can also make some of that internal (not the server protocol of course), if that's desirable.