mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 16:17:58 +00:00
removing unused types
This commit is contained in:
parent
87ae677a59
commit
7d23ae7bad
1 changed files with 1 additions and 62 deletions
|
@ -143,7 +143,7 @@ export type BarsBeatsSixteenths = string;
|
|||
* Audio is typically sampled 44100 times per second.
|
||||
* @category Unit
|
||||
*/
|
||||
export type Samples = number | "samples";
|
||||
export type Samples = number;
|
||||
|
||||
/**
|
||||
* Hertz are a frequency representation defined as one cycle per second.
|
||||
|
@ -203,64 +203,3 @@ export type Unit = UnitMap[keyof UnitMap];
|
|||
* @category Unit
|
||||
*/
|
||||
export type UnitName = keyof UnitMap;
|
||||
|
||||
/**
|
||||
* Convert the unit name into the type
|
||||
*/
|
||||
export type UnitTypeFromName<Name extends UnitName> = UnitMap[Name];
|
||||
|
||||
export type UnitTypeValue = {
|
||||
units: "number";
|
||||
value: number;
|
||||
} | {
|
||||
units: "decibels";
|
||||
value: Decibels;
|
||||
} | {
|
||||
units: "normalRange";
|
||||
value: NormalRange;
|
||||
} | {
|
||||
units: "audioRange";
|
||||
value: AudioRange;
|
||||
} | {
|
||||
units: "gain";
|
||||
value: GainFactor;
|
||||
} | {
|
||||
units: "positive";
|
||||
value: Positive;
|
||||
} | {
|
||||
units: "time";
|
||||
value: Time;
|
||||
} | {
|
||||
units: "frequency";
|
||||
value: Frequency;
|
||||
} | {
|
||||
units: "transportTime";
|
||||
value: TransportTime;
|
||||
} | {
|
||||
units: "ticks";
|
||||
value: Ticks;
|
||||
} | {
|
||||
units: "bpm";
|
||||
value: BPM;
|
||||
} | {
|
||||
units: "degrees";
|
||||
value: Degrees;
|
||||
} | {
|
||||
units: "radians";
|
||||
value: Radians;
|
||||
} | {
|
||||
units: "samples";
|
||||
value: Samples;
|
||||
} | {
|
||||
units: "hertz";
|
||||
value: Hertz;
|
||||
} | {
|
||||
units: "cents";
|
||||
value: Cents;
|
||||
}
|
||||
|
||||
export type UnitNameFromType<Type extends UnitTypeValue["value"]> = Extract<UnitTypeValue, { value: Type }>["units"]
|
||||
|
||||
export type GetNameAndType<Type extends UnitTypeValue["value"]> = Extract<UnitTypeValue, { value: Type }>
|
||||
|
||||
export type ValidUnitType<Type extends UnitTypeValue["value"]> = Extract<UnitTypeValue, { value: Type }>["value"];
|
||||
|
|
Loading…
Reference in a new issue