@stringsync/vexml
Version:
MusicXML to Vexflow
23 lines (22 loc) • 789 B
TypeScript
import { Enum, EnumValues } from './enum';
/**
* Value is a wrapper around any arbitrary value that adds functionality to default.
*/
export declare class Value<T> {
private value;
private defaultValue;
private constructor();
static of(value: string | null): Value<null>;
/** Returns a new attr with a different default value. */
withDefault<T>(defaultValue: T): Value<T>;
/** Parses the attribute into a string. */
str(): string | T;
/** Parses the attribute into a boolean. */
bool(): boolean | T;
/** Parses the attribute into an integer. */
int(): number | T;
/** Parses the attribute into a float. */
float(): number | T;
/** Parses the attribute into an enum. */
enum<E extends Enum<any>>(e: E): T | EnumValues<E>;
}