UNPKG

tstosc

Version:

A transpiler that convert TypeScript to SuperCollider's SCLang.

17 lines (15 loc) 719 B
declare class Result<OkType, ErrType> { private whether_ok; private value; static createOk<ValueType, ErrType = never>(value: ValueType): Result<ValueType, ErrType>; static createErr<ValueType, OkType = never>(value: ValueType): Result<OkType, ValueType>; static fromOk<ValueType>(result: Result<ValueType, unknown>): Result<ValueType, never>; static fromErr<ValueType>(result: Result<unknown, ValueType>): Result<never, ValueType>; isOk(): this is Result<OkType, never>; isErr(): this is Result<never, ErrType>; unwrapOk(): OkType; unwrapErr(): ErrType; constructor(whether_ok: true, value: OkType); constructor(whether_ok: false, value: ErrType); } export { Result };