@lin-lang/lin
Version:
A JS wrapper for the programming language Lin.
47 lines • 1.23 kB
TypeScript
type Nullable<T> = T | null | undefined
export class CompiledSnippet {
private constructor();
toBytes(): Int8Array;
toHex(): string;
toBase64(): string;
run(): ExecutionReport;
}
export class ExecutionReport {
private constructor();
readonly result: TimedResult<ExecutionResult>;
readonly consoleLines: Array<string>;
}
export class ExecutionResult {
private constructor();
readonly isSuccess: boolean;
readonly isFailure: boolean;
getOrNull(): string;
getOrThrow(): string;
thrownOrNull(): string;
}
export const Lin: {
parse(source: string, name: string): TimedResult<ParsedSnippet>;
};
export class ParsedSnippet {
private constructor();
validate(): ValidationReport;
compile(): TimedResult<CompiledSnippet>;
}
export class ValidationReport {
private constructor();
readonly isValid: boolean;
toString(): string;
}
export class TimedResult<T> {
private constructor();
readonly duration: Duration;
readonly isSuccess: boolean;
readonly isFailure: boolean;
getOrNull(): Nullable<T>;
exceptionOrNull(): Nullable<Error>;
}
export class Duration {
private constructor();
toString(): string;
}
export as namespace lin;