Skip to content

Commit

Permalink
Revert "Begin remove break_eternity.js module augmentation"
Browse files Browse the repository at this point in the history
This reverts commit 88173d8.
  • Loading branch information
xShadowBlade committed Apr 24, 2024
1 parent 88173d8 commit bd74602
Show file tree
Hide file tree
Showing 65 changed files with 42,960 additions and 26,100 deletions.
8,491 changes: 4,423 additions & 4,068 deletions dist/game/eMath.game.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/game/eMath.game.min.js

Large diffs are not rendered by default.

8,497 changes: 4,426 additions & 4,071 deletions dist/game/eMath.game.mjs

Large diffs are not rendered by default.

8,293 changes: 4,326 additions & 3,967 deletions dist/main/eMath.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main/eMath.min.js

Large diffs are not rendered by default.

8,281 changes: 4,320 additions & 3,961 deletions dist/main/eMath.mjs

Large diffs are not rendered by default.

8,485 changes: 4,420 additions & 4,065 deletions dist/pixiGame/eMath.pixiGame.js

Large diffs are not rendered by default.

8,485 changes: 4,420 additions & 4,065 deletions dist/pixiGame/eMath.pixiGame.mjs

Large diffs are not rendered by default.

4,838 changes: 4,838 additions & 0 deletions dist/presets/eMath.presets.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/presets/eMath.presets.min.js

Large diffs are not rendered by default.

4,819 changes: 4,819 additions & 0 deletions dist/presets/eMath.presets.mjs

Large diffs are not rendered by default.

33 changes: 13 additions & 20 deletions dist/types/E/e.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1187,13 +1187,13 @@ declare class Decimal {
*/
static smoothDamp(current: DecimalSource, target: DecimalSource, smoothing: DecimalSource, deltaTime: DecimalSource): Decimal;
/**
* Creates a clone of the Decimal instance.
* Creates a clone of the E instance.
* @deprecated
* @returns A EClone instance that is a clone of the original.
*/
clone(): Decimal;
/**
* Creates a clone of the Decimal instance. Helps with a webpack(?) bug
* Creates a clone of the E instance. Helps with a webpack(?) bug
* @alias Decimal.normalizeFromComponents
* @param x - The number to clone
* @returns - The cloned number
Expand All @@ -1220,33 +1220,33 @@ declare class Decimal {
scale(s: DecimalSource, p: DecimalSource, mode: string | number, rev?: boolean): Decimal;
static scale(value: DecimalSource, s: DecimalSource, p: DecimalSource, mode: string | number, rev?: boolean): Decimal;
/**
* Formats the Decimal instance with a specified accuracy and maximum decimal places.
* Formats the E instance with a specified accuracy and maximum decimal places.
* @param [acc] - The desired accuracy (number of significant figures), defaults to `2`.
* @param [max] - The maximum number of decimal places to display, defaults to `9`.
* @param [type] - The type of format, defaults to `"mixed_sc"`.
* @returns A string representing the formatted Decimal value.
* @returns A string representing the formatted E value.
*/
format(acc?: number, max?: number, type?: FormatType): string;
/**
* Formats the Decimal instance with a specified accuracy and maximum decimal places.
* @param e - The Decimal instance to format.
* Formats the E instance with a specified accuracy and maximum decimal places.
* @param e - The E instance to format.
* @param [acc] - The desired accuracy (number of significant figures), defaults to `2`.
* @param [max] - The maximum number of decimal places to display, defaults to `9`.
* @param [type] - The type of format, defaults to `"mixed_sc"`.
* @returns A string representing the formatted Decimal value.
* @returns A string representing the formatted E value.
*/
static format(e: DecimalSource, acc?: number, max?: number, type?: FormatType): string;
/**
* Formats the Decimal instance in standard leter notation with a specified accuracy and maximum decimal places.
* Formats the E instance in standard leter notation with a specified accuracy and maximum decimal places.
* @param [acc] - The desired accuracy (number of significant figures).
* @param [max] - The maximum number of decimal places to display.
* @param [type] - The type of format (default standard)
* @returns A string representing the formatted Decimal value.
* @returns A string representing the formatted E value.
*/
formatST(acc?: number, max?: number, type?: FormatType): string;
static formatST(value: DecimalSource, acc?: number, max?: number, type?: FormatType): string;
/**
* Formats the gain rate using the Decimal instance.
* Formats the gain rate using the E instance.
* @param gain - The gain value to compare
* @param [type] - The type of format (default mixed scientific)
* @param [acc] - The desired accuracy (number of significant figures).
Expand All @@ -1261,10 +1261,10 @@ declare class Decimal {
formatGain(gain: DecimalSource, type?: FormatType, acc?: number, max?: number): string;
static formatGain(value: DecimalSource, gain: DecimalSource, type?: FormatType, acc?: number, max?: number): string;
/**
* Converts the Decimal instance to a Roman numeral representation.
* Converts the E instance to a Roman numeral representation.
* @param [max] - Max before it returns the original
* @returns A string representing the Roman numeral equivalent of the Decimal value,
* or the original Decimal instance if it is greater than or equal to 5000 or less than 1.
* @returns A string representing the Roman numeral equivalent of the E value,
* or the original E instance if it is greater than or equal to 5000 or less than 1.
*/
toRoman(max?: DecimalSource): string | Decimal;
static toRoman(value: DecimalSource, max: DecimalSource): string | Decimal;
Expand Down Expand Up @@ -1299,13 +1299,6 @@ declare const formats: {
formatReduction: (ex: DecimalSource) => string;
formatPercent: (ex: DecimalSource) => string;
formatMult: (ex: DecimalSource, acc?: number) => string;
/**
* Returns true if 'value' is greater than or equal to 'other'.
* However, the two Decimals are considered equal if they're approximately equal up to a certain tolerance.
* Tolerance is a relative tolerance, multiplied by the greater of the magnitudes of the two arguments.
* For example, if you put in 1e-9, then any number closer to the
* larger number than (larger number)*1e-9 will be considered equal.
*/
expMult: (a: DecimalSource, b: DecimalSource, base?: number) => Decimal;
metric: (num: DecimalSource, type?: 0 | 1 | 2 | 3) => string;
ev: (num: DecimalSource, c2?: boolean) => string;
Expand Down
8 changes: 4 additions & 4 deletions dist/types/E/eMain.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file The main file for the Decimal library.
* @file The main file for the E library.
*/
import { Decimal } from "./e";
import type { DecimalSource } from "./e";
Expand All @@ -8,8 +8,8 @@ import type { DecimalSource } from "./e";
* @param x - The value to convert to a Decimal instance.
* @returns - The Decimal instance.
*/
declare const Decimal: ((x?: DecimalSource) => Decimal) & typeof Decimal;
type Decimal = Decimal;
export { Decimal, DecimalSource };
declare const E: ((x?: DecimalSource) => Decimal) & typeof Decimal;
type E = Decimal;
export { E, DecimalSource as ESource };
export { FORMATS, FormatTypeList } from "./e";
export type { FormatType } from "./e";
4 changes: 2 additions & 2 deletions dist/types/E/format.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file Declares a generator function for formats for the Decimal library.
* @file Declares a generator function for formats for the E library.
*/
import type { Decimal as DecimalType, DecimalSource } from "./e";
type Decimal = DecimalType;
Expand All @@ -8,7 +8,7 @@ type FormatType = "st" | "sc" | "scientific" | "omega" | "omega_short" | "elemen
declare const ST_NAMES: string[][][];
declare const FormatTypeList: FormatType[];
/**
* Generates a format function for the Decimal library.
* Generates a format function for the E library.
* @param Decimal - The Decimal constructor to use.
* @returns - The format function.
*/
Expand Down
56 changes: 28 additions & 28 deletions dist/types/E/new/eMain.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ interface DecimalAddedMethodsInterface {
*/
scale(this: Decimal, s: DecimalSource, p: DecimalSource, mode: string | number, rev?: boolean): Decimal;
/**
* Formats the Decimal instance with a specified accuracy and maximum Decimal places.
* Formats the E instance with a specified accuracy and maximum Decimal places.
* @param [acc] - The desired accuracy (number of significant figures), defaults to `2`.
* @param [max] - The maximum number of Decimal places to display, defaults to `9`.
* @param [type] - The type of format, defaults to `"mixed_sc"`.
* @returns A string representing the formatted Decimal value.
* @returns A string representing the formatted E value.
*/
format(this: Decimal, acc?: number, max?: number, type?: FormatType): string;
/**
* Formats the Decimal instance in standard leter notation with a specified accuracy and maximum Decimal places.
* Formats the E instance in standard leter notation with a specified accuracy and maximum Decimal places.
* @param [acc] - The desired accuracy (number of significant figures).
* @param [max] - The maximum number of Decimal places to display.
* @param [type] - The type of format (default standard)
* @returns A string representing the formatted Decimal value.
* @returns A string representing the formatted E value.
*/
formatST(this: Decimal, acc?: number, max?: number, type?: FormatType): string;
/**
* Formats the gain rate using the Decimal instance.
* Formats the gain rate using the E instance.
* @param gain - The gain value to compare
* @param [type] - The type of format (default mixed scientific)
* @param [acc] - The desired accuracy (number of significant figures).
Expand All @@ -63,16 +63,16 @@ interface DecimalAddedMethodsInterface {
*/
formatGain(gain: DecimalSource, type: FormatType, acc?: number, max?: number): string;
/**
* Converts the Decimal instance to a Roman numeral representation.
* Converts the E instance to a Roman numeral representation.
* @param [max] - Max before it returns the original
* @returns A string representing the Roman numeral equivalent of the Decimal value,
* or the original Decimal instance if it is greater than or equal to 5000 or less than 1.
* @returns A string representing the Roman numeral equivalent of the E value,
* or the original E instance if it is greater than or equal to 5000 or less than 1.
*/
toRoman(this: Decimal, max?: DecimalSource): string | Decimal;
}
declare module "./declare" {
/**
* @deprecated If you are using `emath.js`, use {@link Decimal} instead
* @deprecated If you are using `emath.js`, use {@link E} instead
*/
interface Decimal extends DecimalAddedMethodsInterface {
}
Expand All @@ -88,14 +88,14 @@ declare const DecimalAddedStaticMethods: {
* @param deltaTime - The time elapsed since the last frame in seconds.
* @returns - The interpolated value between `current` and `target`.
*/
smoothDamp(current: DecimalSource, target: DecimalSource, smoothing: DecimalSource, deltaTime: DecimalSource): any;
smoothDamp(current: DecimalSource, target: DecimalSource, smoothing: DecimalSource, deltaTime: DecimalSource): Decimal;
/**
* Creates a clone of the Decimal instance. Helps with a webpack(?) bug
* Creates a clone of the E instance. Helps with a webpack(?) bug
* @alias Decimal.normalizeFromComponents
* @param x - The number to clone
* @returns - The cloned number
*/
clone(x: any): any;
clone(x: Decimal): Decimal;
/**
* Applies a soft cap to a Decimal value using a specified soft cap function.
* See {@link DecimalAddedMethods.softcap} for more details.
Expand All @@ -106,7 +106,7 @@ declare const DecimalAddedStaticMethods: {
* or "exp" for exponential soft cap.
* @returns The Decimal value after applying the soft cap.
*/
softcap(value: DecimalSource, start: DecimalSource, power: number, mode: string): any;
softcap(value: DecimalSource, start: DecimalSource, power: number, mode: string): Decimal;
/**
* Scales a currency value using a specified scaling function.
* See {@link DecimalAddedMethods.scale} for more details.
Expand All @@ -117,29 +117,29 @@ declare const DecimalAddedStaticMethods: {
* @param rev - Whether to reverse the scaling operation
* @returns The scaled currency value.
*/
scale(value: DecimalSource, s: DecimalSource, p: DecimalSource, mode: string | number, rev?: boolean): any;
scale(value: DecimalSource, s: DecimalSource, p: DecimalSource, mode: string | number, rev?: boolean): Decimal;
/**
* Formats the Decimal instance with a specified accuracy and maximum Decimal places.
* Formats the E instance with a specified accuracy and maximum Decimal places.
* See {@link DecimalAddedMethods.format} for more details.
* @param e - The Decimal instance to format.
* @param e - The E instance to format.
* @param [acc] - The desired accuracy (number of significant figures), defaults to `2`.
* @param [max] - The maximum number of Decimal places to display, defaults to `9`.
* @param [type] - The type of format, defaults to `"mixed_sc"`.
* @returns A string representing the formatted Decimal value.
* @returns A string representing the formatted E value.
*/
format(e: DecimalSource, acc?: number, max?: number, type?: FormatType): string;
/**
* Formats the Decimal instance in standard leter notation with a specified accuracy and maximum Decimal places.
* Formats the E instance in standard leter notation with a specified accuracy and maximum Decimal places.
* See {@link DecimalAddedMethods.formatST} for more details.
* @param value - The value to format.
* @param [acc] - The desired accuracy (number of significant figures).
* @param [max] - The maximum number of Decimal places to display.
* @param [type] - The type of format (default standard)
* @returns A string representing the formatted Decimal value.
* @returns A string representing the formatted E value.
*/
formatST(value: DecimalSource, acc?: number, max?: number, type?: FormatType): string;
/**
* Formats the gain rate using the Decimal instance.
* Formats the gain rate using the E instance.
* See {@link DecimalAddedMethods.formatGain} for more details.
* @param value - The value to compare
* @param gain - The gain value to compare
Expand All @@ -150,12 +150,12 @@ declare const DecimalAddedStaticMethods: {
*/
formatGain(value: DecimalSource, gain: DecimalSource, type?: FormatType, acc?: number, max?: number): string;
/**
* Converts the Decimal instance to a Roman numeral representation.
* Converts the E instance to a Roman numeral representation.
* See {@link DecimalAddedMethods.toRoman} for more details.
* @param value - The value to convert to a Roman numeral.
* @param [max] - Max before it returns the original
* @returns A string representing the Roman numeral equivalent of the Decimal value,
* or the original Decimal instance if it is greater than or equal to 5000 or less than 1.
* @returns A string representing the Roman numeral equivalent of the E value,
* or the original E instance if it is greater than or equal to 5000 or less than 1.
*/
toRoman(value: DecimalSource, max: DecimalSource): string | Decimal;
/**
Expand All @@ -165,7 +165,7 @@ declare const DecimalAddedStaticMethods: {
* @param [max] - The maximum value, defaults to `1`.
* @returns A random Decimal value between the minimum and maximum values.
*/
random(min?: DecimalSource, max?: DecimalSource): any;
random(min?: DecimalSource, max?: DecimalSource): Decimal;
/**
* Returns a random boolean value based on the specified probability.
* @param rng - The probability of returning `true`. Must be between `0` and `1`.
Expand All @@ -183,10 +183,10 @@ declare const DecimalAddedStaticMethods: {
* @param x - The value to convert to a Decimal instance.
* @returns - The Decimal instance.
*/
declare const Decimal: ((x?: DecimalSource) => Decimal) & typeof Decimal & typeof DecimalAddedStaticMethods & {
declare const E: ((x?: DecimalSource) => Decimal) & typeof Decimal & typeof DecimalAddedStaticMethods & {
formats: typeof formats;
};
type Decimal = Decimal;
type E = Decimal;
declare const formats: {
toSubscript: (value: number) => string;
toSuperscript: (value: number) => string;
Expand Down Expand Up @@ -257,9 +257,9 @@ declare const formats: {
};
export { ST_NAMES, FormatTypeList } from "../format";
export type { FormatType } from "../format";
export { Decimal };
export { E };
export type { CompareResult, DecimalSource as ESource };
/**
* @deprecated Use {@link Decimal} instead
* @deprecated Use {@link E} instead
*/
export { Decimal };
14 changes: 7 additions & 7 deletions dist/types/classes/Attribute.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file Declares the attribute and attributeStatic classes.
*/
import "reflect-metadata";
import Decimal, { DecimalSource } from "break_eternity.js";
import { E, ESource } from "../E/eMain";
import { Boost } from "./Boost";
import type { Pointer } from "../game/Game";
/**
Expand All @@ -11,12 +11,12 @@ import type { Pointer } from "../game/Game";
*/
declare class Attribute {
/** The current value of the attribute. */
value: Decimal;
value: E;
/**
* Constructs a static attribute with an initial effect.
* @param initial - The inital value of the attribute.
*/
constructor(initial?: DecimalSource);
constructor(initial?: ESource);
}
/**
* Represents a static attribute, which is number that can affected by boosts.
Expand All @@ -36,7 +36,7 @@ declare class AttributeStatic<B extends boolean = true> {
/** @returns The data for the attribute. */
get pointer(): Attribute;
/** The initial value of the attribute. */
readonly initial: Decimal;
readonly initial: E;
/**
* The boost of the attribute.
* NOTE: This will not be used if the boost is disabled.
Expand All @@ -48,7 +48,7 @@ declare class AttributeStatic<B extends boolean = true> {
* @param useBoost - Indicates whether to use boost for the attribute. Defaults to true. (hint: if you don't use boost, don't use this class and use Decimal directly)
* @param initial - The initial value of the attribute. Defaults to 0.
*/
constructor(pointer?: Pointer<Attribute>, useBoost?: B, initial?: DecimalSource);
constructor(pointer?: Pointer<Attribute>, useBoost?: B, initial?: ESource);
/**
* Updates the value of the attribute.
* NOTE: This method must be called every time the boost is updated, else the value stored will not be updated.
Expand All @@ -60,12 +60,12 @@ declare class AttributeStatic<B extends boolean = true> {
* NOTE: This getter must be called every time the boost is updated, else the value stored will not be updated.
* @returns The calculated value of the attribute.
*/
get value(): Decimal;
get value(): E;
/**
* Sets the value of the attribute.
* NOTE: This setter should not be used when boost is enabled.
* @param value - The value to set the attribute to.
*/
set value(value: Decimal);
set value(value: E);
}
export { Attribute, AttributeStatic };
Loading

0 comments on commit bd74602

Please sign in to comment.