Skip to content

Clean up public API a bit#58076

Closed
jakebailey wants to merge 1 commit into
microsoft:mainfrom
jakebailey:clean-up-api
Closed

Clean up public API a bit#58076
jakebailey wants to merge 1 commit into
microsoft:mainfrom
jakebailey:clean-up-api

Conversation

@jakebailey

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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.

Comment thread src/compiler/types.ts
}

/** @internal */
export type FlowType = Type | IncompleteType;

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

Choose a reason for hiding this comment

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

Comment thread src/services/types.ts
isDefinition?: boolean;
}

/** @internal */

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/services/types.ts
kind: string;
}

/** @internal */

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/compiler/types.ts
}

/** @internal */
export const enum JsxFlags {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/compiler/types.ts
}

/** @internal */
export interface CheckJsDirective extends TextRange {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/compiler/types.ts
declarationTransformers: readonly TransformerFactory<SourceFile | Bundle>[];
}

export interface SourceMapSpan {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/compiler/types.ts

/** @internal */
// dprint-ignore
export const enum InferencePriority {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

}

export interface HostConfiguration {
interface HostConfiguration {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/server/session.ts
}

export interface PendingErrorCheck {
interface PendingErrorCheck {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/server/types.ts
WatchOptions,
} from "./_namespaces/ts";

export interface CompressedData {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@jakebailey jakebailey left a comment

Copy link
Copy Markdown
Member Author

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 :(

Comment thread src/services/types.ts
}

/** @internal */
export interface PerformanceEvent {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/services/types.ts
}

/** @internal */
export interface IncompleteCompletionsCache {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/services/types.ts
Imports = "imports",
}

export const enum OutputFileType {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/services/types.ts
}

/** @internal */
export const enum ScriptElementKindModifier {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/services/types.ts
}

/** @internal */
export interface InlayHintsContext {

Copy link
Copy Markdown
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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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