UNPKG

tstosc

Version:

A transpiler that convert TypeScript to SuperCollider's SCLang.

50 lines (47 loc) 1.9 kB
import ts from 'typescript'; declare abstract class TStoSCError extends Error { } declare abstract class UnsupportedError extends TStoSCError { protected readonly causing_file?: ts.SourceFile; protected readonly causing_offset_start?: number; protected readonly causing_offset_end?: number; tryGetErrorOrigin(): string; constructor(message: string, causing_file?: ts.SourceFile, causing_start?: number, causing_end?: number); } declare class UnsupportedTypeError extends UnsupportedError { /** * Generate error message (by default, `description` is `"node"`): * * ```ts * `The ${description} with syntax kind "${ts.SyntaxKind[n.kind]}" is not supported.` * ``` */ static forNodeWithSyntaxKind(n: ts.Node, description?: string): UnsupportedTypeError; /** * Generate error message (by default, `description` is `"provided syntax"`): * * ```ts * `The ${description} of syntax kind "${ts.SyntaxKind[k]}" is not supported.` * ``` */ static ofSyntaxKind(k: ts.SyntaxKind, description?: string, n?: ts.Node): UnsupportedTypeError; constructor(message: string, causing_file?: ts.SourceFile, causing_start?: number, causing_end?: number); } declare class UnsupportedSyntaxError extends UnsupportedError { } declare class SourceFileNotFoundError extends TStoSCError { static forFile(name_or_path_as_hint: string): SourceFileNotFoundError; } declare class RuntimeError extends TStoSCError { } declare class UserAbortionError extends RuntimeError { /** * Generate error message (by default, `description` is `"user choose not to proceed"`): * * ```ts * `Action aborted: ${reason}.` * ``` */ static for(reason?: string): UserAbortionError; } export { RuntimeError, SourceFileNotFoundError, TStoSCError, UnsupportedSyntaxError, UnsupportedTypeError, UserAbortionError };