Skip to content

fix: reexport Source, Range and DiagnosticMessage from compiler's index.d.ts #1688

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 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 11 additions & 30 deletions cli/asc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@
*/

import { OptionDescription } from "./util/options";
import { Source, Range, DiagnosticMessage } from "..";

export { OptionDescription };

/** Relevant subset of the Source class for diagnostic reporting. */
export { Source };

/** Relevant subset of the Range class for diagnostic reporting. */
export { Range };

/** Relevant subset of the DiagnosticMessage class for diagnostic reporting. */
export { DiagnosticMessage };

/** Ready promise resolved once/if the compiler is ready. */
export const ready: Promise<void>;

Expand Down Expand Up @@ -55,36 +66,6 @@ export interface MemoryStream extends OutputStream {
toString(): string;
}

/** Relevant subset of the Source class for diagnostic reporting. */
export interface Source {
/** Normalized path with file extension. */
normalizedPath: string;
}

/** Relevant subset of the Range class for diagnostic reporting. */
export interface Range {
/** Start offset within the source file. */
start: number;
/** End offset within the source file. */
end: number;
/** Respective source file. */
source: Source;
}

/** Relevant subset of the DiagnosticMessage class for diagnostic reporting. */
export interface DiagnosticMessage {
/** Message code. */
code: number;
/** Message category. */
category: number;
/** Message text. */
message: string;
/** Respective source range, if any. */
range: Range | null;
/** Related range, if any. */
relatedRange: Range | null;
}

/** A function handling diagnostic messages. */
type DiagnosticReporter = (diagnostic: DiagnosticMessage) => void;

Expand Down