Skip to content

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

Closed
wants to merge 1 commit into from
Closed

Conversation

jakebailey
Copy link
Member

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:

  • Type aliases for unions of different Nodes, which we may use internally for helpers but have exported for some reason.
  • The server protocol namespace
  • The typings installer protocol stuff
  • All of our Type interfaces, which are not connected to anything as they require casting

I can also make some of that internal (not the server protocol of course), if that's desirable.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Apr 4, 2024
@typescript-bot
Copy link
Collaborator

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;
Copy link
Member Author

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.

Copy link
Member Author

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 */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1275,6 +1278,7 @@ export interface SymbolDisplayPart {
kind: string;
}

/** @internal */
Copy link
Member Author

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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -3787,6 +3788,7 @@ export interface FileReference extends TextRange {
preserve?: boolean;
}

/** @internal */
export interface CheckJsDirective extends TextRange {
Copy link
Member Author

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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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 {
Copy link
Member Author

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 {
Copy link
Member Author

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 {
Copy link
Member Author

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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@jakebailey jakebailey left a 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 {
Copy link
Member Author

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 {
Copy link
Member Author

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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1771,6 +1769,7 @@ export const enum ScriptElementKind {
linkText = "link text",
}

/** @internal */
export const enum ScriptElementKindModifier {
Copy link
Member Author

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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakebailey jakebailey marked this pull request as draft April 11, 2024 00:05
@jakebailey jakebailey closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants