interface AccuracyInformation { /** * The amount of objects in the beatmap. */ nobjects?: number; /** * The accuracy achieved. */ percent?: number; /** * The amount of 300s achieved. */ n300?: number; /** * The amount of 100s achieved. */ n100?: number; /** * The amount of 50s achieved. */ n50?: number; /** * The amount of misses achieved. */ nmiss?: number; } /** * An accuracy calculator that calculates accuracy based on given parameters. */ declare class Accuracy implements AccuracyInformation { n300: number; n100: number; n50: number; nmiss: number; /** * Calculates accuracy based on given parameters. * * If `percent` and `nobjects` are specified, `n300`, `n100`, and `n50` will * be automatically calculated to be the closest to the given * acc percent. * * @param values Function parameters. */ constructor(values: AccuracyInformation); /** * Calculates the accuracy value (0.0 - 1.0). * * @param nobjects The amount of objects in the beatmap. If `n300` was not specified in the constructor, this is required. */ value(nobjects?: number): number; } /** * General enum to specify an "anchor" or "origin" point from the standard 9 points on a rectangle. */ declare enum Anchor { topLeft = "TopLeft", center = "Centre", centerLeft = "CentreLeft", topRight = "TopRight", bottomCenter = "BottomCentre", topCenter = "TopCentre", /** * The user is manually updating the outcome, so we shouldn't. */ custom = "Custom", centerRight = "CentreRight", bottomLeft = "BottomLeft", bottomRight = "BottomRight" } /** * The loop type of storyboard animations. */ declare enum AnimationLoopType { loopForever = "LoopForever", loopOnce = "LoopOnce" } interface RequestResponse { /** * The result of the API request. */ readonly data: Buffer; /** * The status code of the API request. */ readonly statusCode: number; } type DroidAPIEndpoint = "getuserinfo.php" | "scoresearch.php" | "scoresearchv2.php" | "upload" | "user_list.php" | "usergeneral.php" | "top.php" | "time.php" | "account_ban_get.php" | "account_ban_set.php" | "account_restricted_get.php" | "account_restricted_set.php" | "single_score_wipe.php" | "user_wipe.php" | "user_rename.php"; type OsuAPIEndpoint = "get_beatmaps" | "get_user" | "get_scores" | "get_user_best" | "get_user_recent" | "get_match" | "get_replay"; declare abstract class APIRequestBuilder { /** * The main point of API host. */ protected abstract readonly host: string; /** * The API key for this builder. */ protected abstract readonly APIkey: string; /** * The parameter for API key requests. */ protected abstract readonly APIkeyParam: string; /** * Whether or not to include the API key in the request URL. */ protected requiresAPIkey: boolean; /** * The endpoint of this builder. */ protected endpoint: string; /** * The parameters of this builder. */ protected readonly params: Map; private fetchAttempts; /** * Sets the API endpoint. * * @param endpoint The endpoint to set. */ setEndpoint(endpoint: APIParams): this; /** * Sets if this builder includes the API key in the request URL. * * @param requireAPIkey Whether or not to include the API key in the request URL. */ setRequireAPIkey(requireAPIkey: boolean): this; /** * Builds the URL to request the API. */ buildURL(): string; /** * Sends a request to the API using built parameters. * * If the request fails, it will be redone 5 times. */ sendRequest(): Promise; /** * Adds a parameter to the builder. * * @param param The parameter to add. * @param value The value to add for the parameter. */ addParameter(param: string, value: string | number): this; /** * Removes a parameter from the builder. * * @param param The parameter to remove. */ removeParameter(param: string): this; } /** * API request builder for osu!droid. */ declare class DroidAPIRequestBuilder extends APIRequestBuilder { protected readonly host: string; protected readonly APIkey: string; protected readonly APIkeyParam: string; } /** * API request builder for osu!standard. */ declare class OsuAPIRequestBuilder extends APIRequestBuilder { protected readonly host: string; protected readonly APIkey: string; protected readonly APIkeyParam: string; } /** * Mode enum to switch things between osu!droid and osu!standard. */ declare enum Modes { droid = "droid", osu = "osu" } /** * An interface denoting that a mod can be applied to osu!droid. */ interface IModApplicableToDroid { /** * Whether the mod is ranked in osu!droid. */ readonly droidRanked: boolean; /** * The droid score multiplier of this mod. */ readonly droidScoreMultiplier: number; /** * The droid enum of the mod. */ readonly droidString: string; } /** * An interface denoting that a mod can be applied to osu!standard. */ interface IModApplicableToOsu { /** * Whether the mod is ranked in osu!standard. */ readonly pcRanked: boolean; /** * The PC score multiplier of this mod. */ readonly pcScoreMultiplier: number; /** * The bitwise enum of the mod. */ readonly bitwise: number; } /** * Represents a mod. */ declare abstract class Mod { /** * The acronym of the mod. */ abstract readonly acronym: string; /** * The name of the mod. */ abstract readonly name: string; /** * Whether this mod can be applied to osu!droid. */ isApplicableToDroid(): this is this & IModApplicableToDroid; /** * Whether this mod can be applied to osu!standard. */ isApplicableToOsu(): this is this & IModApplicableToOsu; } /** * Holds general beatmap statistics for further modifications. */ declare class MapStats { /** * The circle size of the beatmap. */ cs?: number; /** * The approach rate of the beatmap. */ ar?: number; /** * The overall difficulty of the beatmap. */ od?: number; /** * The health drain rate of the beatmap. */ hp?: number; /** * The enabled modifications. */ mods: Mod[]; /** * The speed multiplier applied from all modifications. */ speedMultiplier: number; /** * Whether or not this map statistics uses forced AR. */ isForceAR: boolean; /** * Whether to calculate for old statistics for osu!droid gamemode (1.6.7 and older). Defaults to `false`. */ oldStatistics: boolean; /** * Whether this map statistics have been calculated. */ private calculated; static readonly OD0_MS: number; static readonly OD10_MS: number; static readonly AR0_MS: number; static readonly AR5_MS: number; static readonly AR10_MS: number; static readonly OD_MS_STEP: number; static readonly AR_MS_STEP1: number; static readonly AR_MS_STEP2: number; constructor(values?: { /** * The circle size of the beatmap. */ cs?: number; /** * The approach rate of the beatmap. */ ar?: number; /** * The overall difficulty of the beatmap. */ od?: number; /** * The health drain rate of the beatmap. */ hp?: number; /** * Applied modifications. */ mods?: Mod[]; /** * The speed multiplier to calculate for. */ speedMultiplier?: number; /** * Whether or not force AR is turned on. */ isForceAR?: boolean; /** * Whether to calculate for old statistics for osu!droid gamemode (1.6.7 or older). */ oldStatistics?: boolean; }); /** * Calculates map statistics. * * This can only be called once for an instance. */ calculate(params?: { /** * The gamemode to calculate for. Defaults to `Modes.osu`. */ mode?: Modes; /** * The applied modifications in osu!standard format. */ mods?: string; /** * The speed multiplier to calculate for. */ speedMultiplier?: number; /** * Whether force AR is turned on. */ isForceAR?: boolean; /** * Whether to convert osu!droid OD to osu!standard OD. Defaults to `true`. * Will only be considered when using `Modes.droid` for `mode`. */ convertDroidOD?: boolean; }): MapStats; /** * Returns a string representative of the class. */ toString(): string; /** * Utility function to apply speed and flat multipliers to stats where speed changes apply for AR. * * @param baseAR The base AR value. * @param speedMultiplier The speed multiplier to calculate. * @param statisticsMultiplier The statistics multiplier to calculate from map-changing nonspeed-changing mods. */ static modifyAR(baseAR: number, speedMultiplier: number, statisticsMultiplier: number): number; /** * Converts an AR value to its milliseconds value. * * @param ar The AR to convert. * @returns The milliseconds value represented by the AR. */ static arToMS(ar: number): number; /** * Utility function to apply speed and flat multipliers to stats where speed changes apply for OD. * * @param baseOD The base OD value. * @param speedMultiplier The speed multiplier to calculate. * @param statisticsMultiplier The statistics multiplier to calculate from map-changing nonspeed-changing mods. */ static modifyOD(baseOD: number, speedMultiplier: number, statisticsMultiplier: number): number; } /** * Represents the speed of the countdown before the first hit object. */ declare enum BeatmapCountdown { noCountDown = 0, normal = 1, half = 2, double = 3 } /** * Represents the draw order of hit circle overlays compared to hit numbers. * * - `noChange` = use skin setting * - `below` = draw overlays under numbers * - `above` = draw overlays on top of numbers */ declare enum BeatmapOverlayPosition { noChange = "NoChange", below = "Below", above = "Above" } /** * Represents available sample banks. */ declare enum SampleBank { none = 0, normal = 1, soft = 2, drum = 3 } /** * Represents game modes available in the game. */ declare enum GameMode { osu = 0, taiko = 1, catch = 2, mania = 3 } /** * Contains general information about a beatmap. */ declare class BeatmapGeneral { /** * The location of the audio file relative to the beatmapset file. */ audioFilename: string; /** * The amount of milliseconds of silence before the audio starts playing. */ audioLeadIn: number; /** * The time in milliseconds when the audio preview should start. * * If -1, the audio should begin playing at 40% of its length. */ previewTime: number; /** * The speed of the countdown before the first hit object. */ countdown: BeatmapCountdown; /** * The sample bank that will be used if timing points do not override it. */ sampleBank: SampleBank; /** * The sample volume that will be used if timing points do not override it. */ sampleVolume: number; /** * The multiplier for the threshold in time where hit objects * placed close together stack, ranging from 0 to 1. */ stackLeniency: number; /** * The game mode of the beatmap. */ mode: GameMode; /** * Whether or not breaks have a letterboxing effect. */ letterBoxInBreaks: boolean; /** * Whether or not the storyboard can use the user's skin images. */ useSkinSprites: boolean; /** * The draw order of hit circle overlays compared to hit numbers. */ overlayPosition: BeatmapOverlayPosition; /** * The preffered skin to use during gameplay. */ skinPreference: string; /** * Whether or not a warning about flashing colours should be shown at the beginning of the map. */ epilepsyWarning: boolean; /** * The time in beats that the countdown starts before the first hit object. */ countdownOffset: number; /** * Whether or not the storyboard allows widescreen viewing. */ widescreenStoryboard: boolean; /** * Whether or not sound samples will change rate when playing with speed-changing mods. */ samplesMatchPlaybackRate: boolean; } /** * Represents the grid size setting in the editor. */ declare enum EditorGridSize { tiny = 4, small = 8, medium = 16, large = 32 } /** * Contains saved settings for the beatmap editor. */ declare class BeatmapEditor { /** * Time in milliseconds of bookmarks. */ bookmarks: number[]; /** * The multiplier at which distance between consecutive notes will be snapped based on their rhythmical difference. */ distanceSnap: number; /** * Determines the editor's behaviour in quantizing hit objects based on the {@link https://osu.ppy.sh/wiki/en/Client/Beatmap_editor/Beat_Snap Beat Snap} principles. */ beatDivisor: number; /** * The grid size setting in the editor. */ gridSize: EditorGridSize; /** * The scale factor for the {@link https://osu.ppy.sh/wiki/en/Client/Beatmap_editor/Compose#top-left-(hit-objects-timeline) object timeline}. */ timelineZoom: number; } /** * Contains information used to identify a beatmap. */ declare class BeatmapMetadata { /** * The romanized song title of the beatmap. */ title: string; /** * The song title of the beatmap. */ titleUnicode: string; /** * The romanized artist of the song of the beatmap. */ artist: string; /** * The song artist of the beatmap. */ artistUnicode: string; /** * The creator of the beatmap. */ creator: string; /** * The difficulty name of the beatmap. */ version: string; /** * The original media the song was produced for. */ source: string; /** * The search terms of the beatmap. */ tags: string[]; /** * The ID of the beatmap. */ beatmapId?: number; /** * The ID of the beatmapset containing this beatmap. */ beatmapSetId?: number; /** * The full title of the beatmap, which is `Artist - Title (Creator) [Difficulty Name]`. */ get fullTitle(): string; /** * The full unicode title of the beatmap, which is `Artist - Title (Creator) [Difficulty Name]`. * * Will fallback to original artist and title if needed. */ get fullUnicodeTitle(): string; } /** * Contains difficulty settings of a beatmap. */ declare class BeatmapDifficulty { /** * The approach rate of the beatmap. */ ar?: number; /** * The circle size of the beatmap. */ cs: number; /** * The overall difficulty of the beatmap. */ od: number; /** * The health drain rate of the beatmap. */ hp: number; /** * The base slider velocity in hundreds of osu! pixels per beat. */ sliderMultiplier: number; /** * The amount of slider ticks per beat. */ sliderTickRate: number; } /** * Represents a two-dimensional vector. */ declare class Vector2 { /** * The x position of this vector. */ x: number; /** * The y position of this vector. */ y: number; constructor(x: number, y: number); /** * Multiplies this vector with another vector. * * @param vec The other vector. * @returns The multiplied vector. */ multiply(vec: Vector2): Vector2; /** * Divides this vector with a scalar. * * Attempting to divide by 0 will throw an error. * * @param divideFactor The factor to divide the vector by. * @returns The divided vector. */ divide(divideFactor: number): Vector2; /** * Adds this vector with another vector. * * @param vec The other vector. * @returns The added vector. */ add(vec: Vector2): Vector2; /** * Subtracts this vector with another vector. * * @param vec The other vector. * @returns The subtracted vector. */ subtract(vec: Vector2): Vector2; /** * The length of this vector. */ get length(): number; /** * Performs a dot multiplication with another vector. * * @param vec The other vector. * @returns The dot product of both vectors. */ dot(vec: Vector2): number; /** * Scales this vector. * * @param scaleFactor The factor to scale the vector by. * @returns The scaled vector. */ scale(scaleFactor: number): Vector2; /** * Gets the distance between this vector and another vector. * * @param vec The other vector. * @returns The distance between this vector and the other vector. */ getDistance(vec: Vector2): number; /** * Gets the angle between this vector and another vector. * * @param vec The other vector. * @returns The angle between this vector and the other vector. */ getAngle(vec: Vector2): number; /** * Normalizes the vector. */ normalize(): void; /** * Checks whether this vector is equal to another vector. * * @param other The other vector. * @returns Whether this vector is equal to the other vector. */ equals(other: Vector2): boolean; /** * Returns a string representation of the vector. */ toString(): string; } /** * Represents a beatmap's background. */ declare class BeatmapBackground { /** * The location of the background image relative to the beatmap directory. */ filename: string; /** * Offset in osu! pixels from the centre of the screen. * * For example, an offset of `50,100` would have the background shown 50 osu! * pixels to the right and 100 osu! pixels down from the centre of the screen. */ offset: Vector2; constructor(filename: string, offset: Vector2); } /** * Represents a beatmap's video. */ declare class BeatmapVideo { /** * The location of the video relative to the beatmap directory. */ filename: string; /** * The start time of the video, in milliseconds from the beginning of the beatmap's audio. */ startTime: number; /** * Offset in osu! pixels from the centre of the screen. * * For example, an offset of `50,100` would have the video shown 50 osu! pixels * to the right and 100 osu! pixels down from the centre of the screen. */ offset: Vector2; constructor(startTime: number, filename: string, offset: Vector2); } /** * Available types of a storyboard layer. */ declare enum StoryboardLayerType { background = "Background", fail = "Fail", pass = "Pass", foreground = "Foreground", overlay = "Overlay", sample = "Sample" } /** * Represents a storyboard element. */ declare abstract class StoryboardElement { /** * The file path to the content of the element. */ readonly path: string; /** * The time at which the element starts. */ abstract get startTime(): number; /** * The time at which the element ends. */ get endTime(): number; /** * The duration of the storyboard element. */ get duration(): number; constructor(path: string); } /** * Represents a storyboard's layer. */ declare class StoryboardLayer { /** * The name of the layer. */ readonly name: StoryboardLayerType; /** * The depth of the layer. */ readonly depth: number; /** * Whether this storyboard layer is visible in pass state. */ visibleWhenPassing: boolean; /** * Whether this storyboard layer is visible in fail state. */ visibleWhenFailing: boolean; /** * The storyboard elements in this layer. */ elements: StoryboardElement[]; constructor(name: StoryboardLayerType, depth: number, visibleWhenPassing?: boolean, visibleWhenFailing?: boolean); } /** * Represents a storyboard. */ declare class Storyboard { /** * The layers in the storyboard. */ readonly layers: Partial>; /** * Whether the storyboard can fall back to skin sprites in case no matching storyboard sprites are found. */ useSkinSprites: boolean; /** * The variables of the storyboard. */ variables: Record; /** * The depth of the currently front-most storyboard layer, excluding the overlay layer. */ private minimumLayerDepth; /** * Across all layers, find the earliest point in time that a storyboard element exists at. * Will return `null` if there are no elements. * * This iterates all elements and as such should be used sparingly or stored locally. */ get earliestEventTime(): number | null; /** * Across all layers, find the latest point in time that a storyboard element exists at. * Will return `null` if there are no elements. * * This iterates all elements and as such should be used sparingly or stored locally. * Samples return start time as their end time. */ get latestEventTime(): number | null; /** * Gets a layer of the storyboard. * * @param type The layer type. * @param createIfNotAvailable Whether to create the storyboard layer if it's not available. Defaults to `true`. * @returns The storyboard layer. */ getLayer(type: StoryboardLayerType, createIfNotAvailable?: boolean): StoryboardLayer; /** * Gets a layer of the storyboard. * * @param type The layer type. * @param createIfNotAvailable Whether to create the storyboard layer if it's not available. Defaults to `true`. * @returns The storyboard layer. */ getLayer(type: StoryboardLayerType, createIfNotAvailable: false): StoryboardLayer | null; } /** * Represents a break period in a beatmap. */ declare class BreakPoint { /** * The minimum duration required for a break to have any effect. */ static readonly MIN_BREAK_DURATION: number; /** * The start time of the break period. */ readonly startTime: number; /** * The end time of the break period. */ readonly endTime: number; /** * The duration of the break period. This is obtained from `endTime - startTime`. */ readonly duration: number; constructor(values: { startTime: number; endTime: number; }); /** * Returns a string representation of the class. */ toString(): string; /** * Whether this break period contains a specified time. * * @param time The time to check in milliseconds. * @returns Whether the time falls within this break period. */ contains(time: number): boolean; } /** * Contains beatmap events. */ declare class BeatmapEvents { /** * The beatmap's background. */ background?: BeatmapBackground; /** * The beatmap's video. */ video?: BeatmapVideo; /** * The beatmap's storyboard. */ storyboard?: Storyboard; /** * The breaks this beatmap has. */ readonly breaks: BreakPoint[]; /** * Whether the beatmap's background should be hidden while its storyboard is being displayed. */ get storyboardReplacesBackground(): boolean; } /** * Represents a control point in a beatmap. */ declare abstract class ControlPoint { /** * The time at which the control point takes effect in milliseconds. */ readonly time: number; constructor(values: { /** * The time at which the control point takes effect in milliseconds. */ time: number; }); /** * Determines whether this control point results in a meaningful change when placed alongside another. * * @param existing An existing control point to compare with. */ abstract isRedundant(existing: ControlPoint): boolean; /** * Returns a string representative of the class. */ abstract toString(): string; } /** * A manager for a control point. */ declare abstract class ControlPointManager { /** * The default control point for this type. */ abstract readonly defaultControlPoint: T; private _points; /** * The control points in this manager. */ get points(): readonly T[]; /** * Finds the control point that is active at a given time. * * @param time The time. * @returns The active control point at the given time. */ abstract controlPointAt(time: number): T; /** * Adds a new control point. * * Note that the provided control point may not be added if the correct state is already present at the control point's time. * * Additionally, any control point that exists in the same time will be removed. * * @param controlPoint The control point to add. * @returns Whether the control point was added. */ add(controlPoint: T): boolean; /** * Removes a control point. * * This method will remove the earliest control point in the array that is equal to the given control point. * * @param controlPoint The control point to remove. * @returns Whether the control point was removed. */ remove(controlPoint: T): boolean; /** * Removes a control point at an index. * * @param index The index of the control point to remove. * @returns The control point that was removed. */ removeAt(index: number): T; /** * Clears all control points of this type. */ clear(): void; /** * Binary searches one of the control point lists to find the active control point at the given time. * * Includes logic for returning the default control point when no matching point is found. * * @param time The time to find the control point at. * @param fallback The control point to use when the given time is before any control points. Defaults to the default control point. * @returns The active control point at the given time, or the default control point if none found. */ protected binarySearchWithFallback(time: number, fallback?: T): T; /** * Binary searches one of the control point lists to find the active control point at the given time. * * @param time The time to find the control point at. * @returns The active control point at the given time, `null` if none found. */ protected binarySearch(time: number): T | null; /** * Finds the insertion index of a control point in a given time. * * @param time The start time of the control point. */ private findInsertionIndex; } /** * Represents a control point that changes the beatmap's BPM. */ declare class TimingControlPoint extends ControlPoint { /** * The amount of milliseconds passed for each beat. */ readonly msPerBeat: number; /** * The amount of beats in a measure. */ readonly timeSignature: number; constructor(values: { time: number; msPerBeat: number; timeSignature: number; }); isRedundant(): boolean; toString(): string; } /** * A manager for timing control points. */ declare class TimingControlPointManager extends ControlPointManager { readonly defaultControlPoint: TimingControlPoint; controlPointAt(time: number): TimingControlPoint; } /** * Represents a control point that changes speed multiplier. */ declare class DifficultyControlPoint extends ControlPoint { /** * The slider speed multiplier of the control point. */ readonly speedMultiplier: number; /** * Whether or not slider ticks should be generated at this control point. * * This exists for backwards compatibility with maps that abuse NaN slider velocity behavior on osu!stable (e.g. /b/2628991). */ readonly generateTicks: boolean; constructor(values: { time: number; speedMultiplier: number; generateTicks: boolean; }); isRedundant(existing: DifficultyControlPoint): boolean; toString(): string; } /** * A manager for difficulty control points. */ declare class DifficultyControlPointManager extends ControlPointManager { readonly defaultControlPoint: DifficultyControlPoint; controlPointAt(time: number): DifficultyControlPoint; } /** * Represents a control point that applies an effect to a beatmap. */ declare class EffectControlPoint extends ControlPoint { /** * Whether or not kiai time is enabled at this control point. */ readonly isKiai: boolean; /** * Whether the first bar line of this control point is ignored. */ readonly omitFirstBarLine: boolean; constructor(values: { time: number; isKiai: boolean; omitFirstBarLine: boolean; }); isRedundant(existing: EffectControlPoint): boolean; toString(): string; } /** * A manager for effect control points. */ declare class EffectControlPointManager extends ControlPointManager { readonly defaultControlPoint: EffectControlPoint; controlPointAt(time: number): EffectControlPoint; } /** * Represents a control point that handles sample sounds. */ declare class SampleControlPoint extends ControlPoint { /** * The sample bank at this control point. */ readonly sampleBank: SampleBank; /** * The sample volume at this control point. */ readonly sampleVolume: number; /** * The index of the sample bank, if this sample bank uses custom samples. * * If this is 0, the beatmap's sample should be used instead. */ readonly customSampleBank: number; constructor(values: { time: number; sampleBank: SampleBank; sampleVolume: number; customSampleBank: number; }); isRedundant(existing: SampleControlPoint): boolean; toString(): string; } /** * A manager for sample control points. */ declare class SampleControlPointManager extends ControlPointManager { readonly defaultControlPoint: SampleControlPoint; controlPointAt(time: number): SampleControlPoint; } /** * Contains information about timing (control) points of a beatmap. */ declare class BeatmapControlPoints { /** * The manager for timing control points of the beatmap. */ readonly timing: TimingControlPointManager; /** * The manager for difficulty control points of the beatmap. */ readonly difficulty: DifficultyControlPointManager; /** * The manager for effect control points of the beatmap. */ readonly effect: EffectControlPointManager; /** * The manager for sample control points of the beatmap. */ readonly sample: SampleControlPointManager; /** * Clears all control points in the beatmap. */ clear(): void; } /** * Represents an RGB color. */ declare class RGBColor { /** * The red component of the color. */ r: number; /** * The green component of the color. */ g: number; /** * The blue component of the color. */ b: number; /** * The alpha component of the color. */ a: number; constructor(r: number, g: number, b: number, a?: number); /** * Returns a string representation of the color. */ toString(): string; /** * Checks whether this color is equal to another color. * * @param other The other color. */ equals(other: RGBColor): boolean; } /** * Contains information about combo and skin colors of a beatmap. */ declare class BeatmapColor { /** * The combo colors of the beatmap. */ readonly combo: RGBColor[]; /** * Additive slider track color. */ sliderTrackOverride?: RGBColor; /** * The color of slider borders. */ sliderBorder?: RGBColor; } /** * Bitmask constant of object types. This is needed as osu! uses bits to determine object types. */ declare enum ObjectTypes { circle = 1, slider = 2, newCombo = 4, spinner = 8, comboOffset = 112 } /** * Represents a gameplay hit sample. */ declare class HitSampleInfo { static readonly HIT_WHISTLE: string; static readonly HIT_FINISH: string; static readonly HIT_NORMAL: string; static readonly HIT_CLAP: string; /** * The name of the sample. */ readonly name: string; /** * The bank to load the sample from. */ readonly bank?: SampleBank; /** * The sample volume. * * If this is 0, the control point's volume should be used instead. */ readonly volume: number; /** * The index of the sample bank, if this sample bank uses custom samples. * * If this is 0, the control point's sample index should be used instead. */ readonly customSampleBank: number; /** * Whether this hit sample is layered. * * Layered hit sample are automatically added in all modes (except osu!mania), * but can be disabled using the layered skin config option. */ readonly isLayered: boolean; /** * Whether this hit sample is a custom sample. */ get isCustom(): boolean; constructor(name: string, bank?: SampleBank, customSampleBank?: number, volume?: number, isLayered?: boolean); } /** * Represents a hitobject in a beatmap. */ declare abstract class HitObject { /** * The base radius of all hitobjects. */ static readonly baseRadius: number; /** * The start time of the hitobject in milliseconds. */ startTime: number; /** * The bitwise type of the hitobject (circle/slider/spinner). */ readonly type: ObjectTypes; /** * The position of the hitobject in osu!pixels. */ readonly position: Vector2; /** * The end position of the hitobject in osu!pixels. */ readonly endPosition: Vector2; /** * The end time of the hitobject. */ endTime: number; /** * The duration of the hitobject. */ get duration(): number; /** * Whether this hit object represents a new combo. */ readonly isNewCombo: boolean; /** * How many combo colors to skip, if this object starts a new combo. */ readonly comboOffset: number; /** * The samples to be played when this hit object is hit. * * In the case of sliders, this is the sample of the curve body * and can be treated as the default samples for the hit object. */ samples: HitSampleInfo[]; /** * The stack height of the hitobject. */ protected _stackHeight: number; /** * The stack height of the hitobject. */ get stackHeight(): number; /** * The stack height of the hitobject. */ set stackHeight(value: number); /** * The osu!droid scale used to calculate stacked position and radius. */ protected _droidScale: number; /** * The osu!droid scale used to calculate stacked position and radius. */ get droidScale(): number; /** * The osu!droid scale used to calculate stacked position and radius. */ set droidScale(value: number); /** * The osu!standard scale used to calculate stacked position and radius. */ protected _osuScale: number; /** * The osu!standard scale used to calculate stacked position and radius. */ get osuScale(): number; /** * The osu!standard scale used to calculate stacked position and radius. */ set osuScale(value: number); /** * The hitobject type (circle, slider, or spinner). */ get typeStr(): string; constructor(values: { startTime: number; position: Vector2; newCombo?: boolean; comboOffset?: number; type?: number; endTime?: number; endPosition?: Vector2; }); /** * Evaluates the radius of the hitobject. * * @param mode The gamemode to evaluate for. * @returns The radius of the hitobject with respect to the gamemode. */ getRadius(mode: Modes): number; /** * Evaluates the stack offset vector of the hitobject. * * This is used to calculate offset for stacked positions. * * @param mode The gamemode to evaluate for. * @returns The stack offset with respect to the gamemode. */ getStackOffset(mode: Modes): Vector2; /** * Evaluates the stacked position of the hitobject. * * @param mode The gamemode to evaluate for. * @returns The stacked position with respect to the gamemode. */ getStackedPosition(mode: Modes): Vector2; /** * Evaluates the stacked end position of the hitobject. * * @param mode The gamemode to evaluate for. * @returns The stacked end position with respect to the gamemode. */ getStackedEndPosition(mode: Modes): Vector2; /** * Returns the string representative of the class. */ abstract toString(): string; /** * Evaluates the stacked position of the specified position. * * @param position The position to evaluate. * @param mode The gamemode to evaluate for. * @returns The stacked position. */ private evaluateStackedPosition; } /** * Represents a circle in a beatmap. * * All we need from circles is their position. All positions * stored in the objects are in playfield coordinates (512*384 * rectangle). */ declare class Circle extends HitObject { constructor(values: { startTime: number; newCombo?: boolean; comboOffset?: number; type?: number; position: Vector2; }); toString(): string; } /** * Types of slider paths. */ declare enum PathType { Catmull = "C", Bezier = "B", Linear = "L", PerfectCurve = "P" } /** * Represents a slider's path. */ declare class SliderPath { /** * The path type of the slider. */ readonly pathType: PathType; /** * The control points (anchor points) of the slider. */ readonly controlPoints: Vector2[]; /** * Distance that is expected when calculating slider path. */ readonly expectedDistance: number; /** * Whether or not the instance has been initialized. */ isInitialized: boolean; /** * The calculated path of the slider. */ readonly calculatedPath: Vector2[]; /** * The cumulative length of the slider. */ readonly cumulativeLength: number[]; constructor(values: { /** * The path type of the slider. */ pathType: PathType; /** * The anchor points of the slider. */ controlPoints: Vector2[]; /** * The distance that is expected when calculating slider path. */ expectedDistance: number; }); /** * Initializes the instance. */ ensureInitialized(): void; /** * Calculates the slider's path. */ calculatePath(): void; /** * Calculates the slider's subpath. */ calculateSubPath(subControlPoints: Vector2[]): Vector2[]; /** * Calculates the slider's cumulative length. */ calculateCumulativeLength(): void; /** * Computes the position on the slider at a given progress that ranges from 0 (beginning of the path) * to 1 (end of the path). * * @param progress Ranges from 0 (beginning of the path) to 1 (end of the path). */ positionAt(progress: number): Vector2; /** * Returns the progress of reaching expected distance. */ private progressToDistance; /** * Interpolates verticles of the slider. */ private interpolateVerticles; /** * Binary searches the cumulative length array and returns the * index at which `arr[index] >= d`. * * @param d The distance to search. * @returns The index. */ private indexOfDistance; } /** * Represents the head of a slider. */ declare class SliderHead extends Circle { } /** * Represents the tail of a slider. */ declare class SliderTail extends Circle { } /** * Represents a repeat point in a slider. */ declare class SliderRepeat extends HitObject { /** * The index of the repeat point. */ readonly repeatIndex: number; /** * The duration of the repeat point. */ readonly spanDuration: number; constructor(values: { position: Vector2; startTime: number; repeatIndex: number; spanDuration: number; }); toString(): string; } /** * Represents a slider tick in a slider. */ declare class SliderTick extends HitObject { /** * The index of the span at which this slider tick lies. */ readonly spanIndex: number; /** * The start time of the span at which this slider tick lies. */ readonly spanStartTime: number; constructor(values: { position: Vector2; startTime: number; spanIndex: number; spanStartTime: number; }); toString(): string; } /** * Represents a hitobject that can be nested within a slider. */ type SliderNestedHitObject = SliderHead | SliderTick | SliderRepeat | SliderTail; /** * Represents a slider in a beatmap. */ declare class Slider extends HitObject { /** * The nested hitobjects of the slider. Consists of headcircle (sliderhead), slider ticks, repeat points, and tailcircle (sliderend). */ readonly nestedHitObjects: SliderNestedHitObject[]; /** * The slider's path. */ readonly path: SliderPath; /** * The slider's velocity. */ readonly velocity: number; /** * The spacing between slider ticks of this slider. */ readonly tickDistance: number; /** * The position of the cursor at the point of completion of this slider if it was hit * with as few movements as possible. This is set and used by difficulty calculation. */ lazyEndPosition?: Vector2; /** * The distance travelled by the cursor upon completion of this slider if it was hit * with as few movements as possible. This is set and used by difficulty calculation. */ lazyTravelDistance: number; /** * The time taken by the cursor upon completion of this slider if it was hit with * as few movements as possible. This is set and used by difficulty calculation. */ lazyTravelTime: number; /** * The length of one span of this slider. */ readonly spanDuration: number; /** * The slider's head. */ readonly head: SliderHead; /** * The slider's tail. */ readonly tail: SliderTail; /** * The node samples of this slider. */ readonly nodeSamples: HitSampleInfo[][]; /** * The amount of slider ticks in this slider. */ get ticks(): number; /** * The amount of repeat points in this slider. */ get repeats(): number; get stackHeight(): number; set stackHeight(value: number); get droidScale(): number; set droidScale(value: number); get osuScale(): number; set osuScale(value: number); /** * The repetition amount of the slider. Note that 1 repetition means no repeats (1 loop). */ private readonly repetitions; static readonly legacyLastTickOffset: number; constructor(values: { startTime: number; type: number; position: Vector2; newCombo?: boolean; comboOffset?: number; nodeSamples: HitSampleInfo[][]; repetitions: number; path: SliderPath; speedMultiplier: number; msPerBeat: number; mapSliderVelocity: number; mapTickRate: number; tickDistanceMultiplier: number; }); toString(): string; } /** * Represents a spinner in a beatmap. * * All we need from spinners is their duration. The * position of a spinner is always at 256x192. */ declare class Spinner extends HitObject { constructor(values: { startTime: number; type: number; endTime: number; }); toString(): string; } /** * Represents a hitobject that can be placed manually by the user in the game's editor. */ type PlaceableHitObject = Circle | Slider | Spinner; /** * Contains information about hit objects of a beatmap. */ declare class BeatmapHitObjects { private _objects; /** * The objects of the beatmap. */ get objects(): readonly PlaceableHitObject[]; private _circles; /** * The amount of circles in the beatmap. */ get circles(): number; private _sliders; /** * The amount of sliders in the beatmap. */ get sliders(): number; private _spinners; /** * The amount of spinners in the beatmap. */ get spinners(): number; private _sliderTicks; /** * The amount of slider ticks in the beatmap. */ get sliderTicks(): number; /** * The amount of sliderends in the beatmap. */ get sliderEnds(): number; private _sliderRepeatPoints; /** * The amount of slider repeat points in the beatmap. */ get sliderRepeatPoints(): number; /** * Adds hitobjects. * * The sorting order of hitobjects will be maintained. * * @param objects The hitobjects to add. */ add(...objects: PlaceableHitObject[]): void; /** * Removes a hitobject at an index. * * @param index The index of the hitobject to remove. * @returns The hitobject that was removed. */ removeAt(index: number): PlaceableHitObject; /** * Clears all hitobjects. */ clear(): void; /** * Finds the insertion index of a hitobject in a given time. * * @param startTime The start time of the hitobject. */ private findInsertionIndex; } /** * Represents a beatmap with advanced information. */ declare class Beatmap { /** * The format version of the beatmap. */ formatVersion: number; /** * General information about the beatmap. */ readonly general: BeatmapGeneral; /** * Saved settings for the beatmap editor. */ readonly editor: BeatmapEditor; /** * Information used to identify the beatmap. */ readonly metadata: BeatmapMetadata; /** * Difficulty settings of the beatmap. */ readonly difficulty: BeatmapDifficulty; /** * Events of the beatmap. */ readonly events: BeatmapEvents; /** * Timing and control points of the beatmap. */ readonly controlPoints: BeatmapControlPoints; /** * Combo and skin colors of the beatmap. */ readonly colors: BeatmapColor; /** * The objects of the beatmap. */ readonly hitObjects: BeatmapHitObjects; /** * The maximum combo of the beatmap. */ get maxCombo(): number; /** * The most common beat length of the beatmap. */ get mostCommonBeatLength(): number; /** * Returns a time combined with beatmap-wide time offset. * * BeatmapVersion 4 and lower had an incorrect offset. Stable has this set as 24ms off. * * @param time The time. */ getOffsetTime(time: number): number; /** * Calculates the osu!droid maximum score of the beatmap without taking spinner bonus into account. * * @param stats The statistics used for calculation. */ maxDroidScore(stats: MapStats): number; /** * Calculates the osu!standard maximum score of the beatmap without taking spinner bonus into account. * * @param mods The modifications to calculate for. Defaults to No Mod. */ maxOsuScore(mods?: Mod[]): number; /** * Returns a string representative of the class. */ toString(): string; } /** * Sections that exist in `.osu` and `.osb` files. */ declare enum BeatmapSection { general = "General", editor = "Editor", metadata = "Metadata", difficulty = "Difficulty", events = "Events", variables = "Variables", timingPoints = "TimingPoints", colors = "Colours", hitObjects = "HitObjects" } /** * The base of all decoders. */ declare abstract class SectionDecoder { /** * The string in the line at which the decoder is processing. */ private lastPosition; /** * The target of the decoding process. */ protected target: T; protected readonly formatVersion: number; constructor(target: T, formatVersion?: number); /** * Performs a decoding process. * * @param line The line to decode. * @returns The result. */ decode(line: string): T; /** * Logs the position at the line at which an exception occurs. */ logExceptionPosition(): string; /** * Processes a property of the beatmap. This takes the current line as parameter. * * For example, `ApproachRate:9` will be split into `[ApproachRate, 9]`. */ protected property(line: string): string[]; /** * Sets the last position of the current decoder state. * * This is useful to debug syntax errors. */ protected setPosition(str: string): string; /** * Internal decoder function for decoding the target. * * @param line The line to decode. */ protected abstract decodeInternal(line: string): void; /** * Attempts to parse a string into an integer. * * Throws an exception when the resulting value is invalid (such as NaN), too low, or too high. * * @param str The string to parse. * @param min The minimum threshold. Defaults to `-ParserConstants.MAX_PARSE_VALUE`. * @param max The maximum threshold. Defaults to `ParserConstants.MAX_PARSE_VALUE`. * @param allowNaN Whether to allow NaN. * @returns The parsed integer. */ protected tryParseInt(str: string, min?: number, max?: number, allowNaN?: boolean): number; /** * Attempts to parse a string into a float. * * Throws an exception when the resulting value is too low or too high. * * @param str The string to parse. * @param min The minimum threshold. Defaults to `-ParserConstants.MAX_PARSE_VALUE`. * @param max The maximum threshold. Defaults to `ParserConstants.MAX_PARSE_VALUE`. * @param allowNaN Whether to allow NaN. * @returns The parsed float. */ protected tryParseFloat(str: string, min?: number, max?: number, allowNaN?: boolean): number; /** * Checks if a number is within a given threshold. * * @param num The number to check. * @param min The minimum threshold. Defaults to `-ParserConstants.MAX_PARSE_VALUE`. * @param max The maximum threshold. Defaults to `ParserConstants.MAX_PARSE_VALUE`. */ protected isNumberValid(num: number, min?: number, max?: number): boolean; } /** * The base of main decoders. */ declare abstract class Decoder> { /** * The result of the decoding process. */ protected abstract finalResult: R; /** * The result of the decoding process. */ get result(): R; static readonly latestVersion: number; /** * The format version of the decoded target. */ protected formatVersion: number; /** * Available per-section decoders, mapped by its section name. */ protected abstract decoders: Partial>; /** * The amount of lines of the file that have been processed up to this point. */ protected line: number; /** * The currently processed line. */ protected currentLine: string; /** * The currently processed section. */ protected section: BeatmapSection; /** * Performs the decoding process. * * @param str The string to decode. * @returns The current decoder instance. */ decode(str: string): this; /** * Determines whether a line should be skipped. * * @param line The line to determine. * @returns Whether the line should be skipped. */ protected shouldSkipLine(line: string): boolean; /** * Internal decoder function for decoding a line. * * @param line The line to decode. */ protected decodeLine(line: string): void; /** * Resets this decoder's instance. */ protected reset(): void; } /** * A beatmap decoder. */ declare class BeatmapDecoder extends Decoder> { protected finalResult: Beatmap; protected decoders: Partial>>; private previousSection; /** * @param str The string to decode. * @param mods The mods to decode for. * @param parseStoryboard Whether to parse the beatmap's storyboard. */ decode(str: string, mods?: Mod[], parseStoryboard?: boolean): this; protected decodeLine(line: string): void; protected reset(): void; } /** * The base of all encoders. */ declare abstract class BaseEncoder { /** * The target of the encoding process. */ protected result: string; /** * Whether sections should be encoded. Defaults to `true`. */ readonly encodeSections: boolean; constructor(encodeSections?: boolean); /** * Performs the encoding process. * * @returns The result. */ encode(): string; /** * Internal encoder function for encoding the target. */ protected abstract encodeInternal(): void; /** * Writes a line to encoded text. * * @param line The line to write. */ protected write(line: string): void; /** * Writes a line to encoded text, followed by a line feed character (`\n`). * * @param line The line to write. */ protected writeLine(line?: string): void; } /** * The base of main encoders. */ declare abstract class Encoder { /** * The target of the encoding process. */ protected target: T; /** * The result of the encoding process. */ protected finalResult: string; /** * The result of the encoding process. */ get result(): string; /** * Available per-section encoders. */ protected abstract encoders: E[]; /** * @param target The target of the encoding process. */ constructor(target: T); /** * Performs the decoding process. * * Keep in mind that this will not produce the exact same file as the original decoded file. */ encode(): this; /** * Writes a line to encoded text. * * @param line The line to write. */ protected writeLine(line?: string): void; /** * Internal encoder function to encode the target to a string. */ protected encodeInternal(): void; /** * Resets this encoder's instance. */ protected abstract reset(): void; } /** * The base of per-section beatmap encoders. */ declare abstract class BeatmapBaseEncoder extends BaseEncoder { /** * The beatmap that is being encoded. */ readonly map: Beatmap; constructor(map: Beatmap, encodeSections?: boolean); /** * Converts a sample bank to its string equivalent. * * @param sampleBank The sample bank. */ protected sampleBankToString(sampleBank: SampleBank): string; } /** * A beatmap encoder. * * Note that this beatmap encoder does not encode storyboards, and as such equality with the * original beatmap file is not guaranteed (and usually will not be equal). */ declare class BeatmapEncoder extends Encoder { protected encoders: BeatmapBaseEncoder[]; private readonly latestVersion; protected encodeInternal(): void; /** * Resets this encoder's instance. */ protected reset(): void; } /** * Determines how color blending should be done. */ declare enum BlendingEquation { /** * Inherits from parent. */ inherit = 0, /** * Adds the source and destination colours. */ add = 1, /** * Chooses the minimum of each component of the source and destination colours. */ min = 2, /** * Chooses the maximum of each component of the source and destination colours. */ max = 3, /** * Subtracts the destination colour from the source colour. */ subtract = 4, /** * Subtracts the source colour from the destination colour. */ reverseSubtract = 5 } /** * Determines how a blend operation should be done. */ declare enum BlendingType { inherit = 0, constantAlpha = 1, constantColor = 2, dstAlpha = 3, dstColor = 4, one = 5, oneMinusConstantAlpha = 6, oneMinusConstantColor = 7, oneMinusDstAlpha = 8, oneMinusDstColor = 9, oneMinusSrcAlpha = 10, oneMinusSrcColor = 11, srcAlpha = 12, srcAlphaSaturate = 13, srcColor = 14, zero = 15 } /** * Contains information about how a blend mode operation should be blended into its destination. */ declare class BlendingParameters { /** * The blending factor for the source color of the blend. */ source: BlendingType; /** * The blending factor for the destination color of the blend. */ destination: BlendingType; /** * The blending factor for the source alpha of the blend. */ sourceAlpha: BlendingType; /** * The blending factor for the destination alpha of the blend. */ destinationAlpha: BlendingType; /** * Gets or sets the blending equation to use for the RGB components of the blend. */ rgbEquation: BlendingEquation; /** * Gets or sets the blending equation to use for the alpha component of the blend. */ alphaEquation: BlendingEquation; static readonly none: BlendingParameters; static readonly inherit: BlendingParameters; static readonly mixture: BlendingParameters; static readonly additive: BlendingParameters; constructor(source: BlendingType, destination: BlendingType, sourceAlpha: BlendingType, destinationAlpha: BlendingType, rgbEquation: BlendingEquation, alphaEquation: BlendingEquation); } /** * Represents root bounds. * * Used in the Brent root-finding algorithm. */ interface RootBounds { /** * The low value of the range where the root is supposed to be. Can be expanded if needed. */ lowerBound: number; /** * The high value of the range where the root is supposed to be. Can be expanded if needed. */ upperBound: number; } /** * Algorithm by Brent, Van Wijngaarden, Dekker et al. * * Implementation inspired by Press, Teukolsky, Vetterling, and Flannery, "Numerical Recipes in C", 2nd edition, Cambridge University Press. */ declare abstract class Brent { /** * Finds a solution to the equation f(x) = 0. * * @param f The function to find roots from. * @param bounds The upper and lower root bounds. * @param accuracy The desired accuracy. The root will be refined until the accuracy or the maximum number of iterations is reached. Defaults to 1e-8. Must be greater than 0. * @param maxIterations The maximum number of iterations. Defaults to 100. * @param expandFactor The factor at which to expand the bounds, if needed. Defaults to 1.6. * @param maxExpandIterations The maximum number of expand iterations. Defaults to 100. * @returns The root with the specified accuracy. Throws an error if the algorithm failed to converge. */ static findRootExpand(f: (x: number) => number, bounds: RootBounds, accuracy?: number, maxIterations?: number, expandFactor?: number, maxExpandIterations?: number): number; /** * Finds a solution to the equation f(x) = 0. * * @param f The function to find roots from. * @param bounds The upper and lower root bounds. * @param accuracy The desired accuracy. The root will be refined until the accuracy or the maximum number of iterations is reached. Defaults to 1e-8. Must be greater than 0. * @param maxIterations The maximum number of iterations. Defaults to 100. * @returns The root with the specified accuracy. Throws an error if the algorithm failed to converge. */ static findRoot(f: (x: number) => number, bounds: RootBounds, accuracy?: number, maxIterations?: number): number; /** * Finds a solution to the equation f(x) = 0. * * @param f The function to find roots from. * @param bounds The upper and lower root bounds. * @param accuracy The desired accuracy. The root will be refined until the accuracy or the maximum number of iterations is reached. Must be greater than 0. * @param maxIterations The maximum number of iterations. Usually 100. * @returns The root with the specified accuracy, `null` if not found. */ static tryFindRoot(f: (x: number) => number, bounds: RootBounds, accuracy: number, maxIterations: number): number | null; /** * Helper method useful for preventing rounding errors. * * @returns a * sign(b) */ static sign(a: number, b: number): number; } /** * A utility class for calculating circle sizes across all modes (rimu! and osu!standard). */ declare abstract class CircleSizeCalculator { private static readonly assumedDroidHeight; /** * Converts osu!droid CS to osu!droid scale. * * @param cs The CS to convert. * @param mods The mods to apply. * @returns The calculated osu!droid scale. */ static droidCSToDroidScale(cs: number, mods?: Mod[]): number; /** * Converts osu!droid scale to osu!standard radius. * * @param scale The osu!droid scale to convert. * @returns The osu!standard radius of the given osu!droid scale. */ static droidScaleToStandardRadius(scale: number): number; /** * Converts osu!standard radius to osu!droid scale. * * @param radius The osu!standard radius to convert. * @returns The osu!droid scale of the given osu!standard radius. */ static standardRadiusToDroidScale(radius: number): number; /** * Converts osu!standard radius to osu!standard circle size. * * @param radius The osu!standard radius to convert. * @returns The osu!standard circle size of the given radius. */ static standardRadiusToStandardCS(radius: number): number; /** * Converts osu!standard circle size to osu!standard scale. * * @param cs The osu!standard circle size to convert. * @returns The osu!standard scale of the given circle size. */ static standardCSToStandardScale(cs: number): number; /** * Converts osu!standard scale to osu!droid scale. * * @param scale The osu!standard scale to convert. * @returns The osu!droid scale of the given osu!standard scale. */ static standardScaleToDroidScale(scale: number): number; /** * Converts osu!standard circle size to osu!droid scale. * * @param cs The osu!standard circle size to convert. * @returns The osu!droid scale of the given osu!droid scale. */ static standardCSToDroidScale(cs: number): number; } /** * Types of easing. * * See {@link http://easings.net/ this} page for more samples. */ declare enum Easing { none = 0, out = 1, in = 2, inQuad = 3, outQuad = 4, inOutQuad = 5, inCubic = 6, outCubic = 7, inOutCubic = 8, inQuart = 9, outQuart = 10, inOutQuart = 11, inQuint = 12, outQuint = 13, inOutQuint = 14, inSine = 15, outSine = 16, inOutSine = 17, inExpo = 18, outExpo = 19, inOutExpo = 20, inCirc = 21, outCirc = 22, inOutCirc = 23, inElastic = 24, outElastic = 25, outElasticHalf = 26, outElasticQuarter = 27, inOutElastic = 28, inBack = 29, outBack = 30, inOutBack = 31, inBounce = 32, outBounce = 33, inOutBounce = 34, outPow10 = 35 } /** * Available storyboard command types. */ declare enum StoryboardCommandType { movement = "M", movementX = "MX", movementY = "MY", fade = "F", scale = "S", vectorScale = "V", rotation = "R", color = "C", parameter = "P", loop = "L", trigger = "T" } /** * Available storyboard parameter command types. */ declare enum StoryboardParameterCommandType { horizontalFlip = "H", verticalFlip = "V", blendingMode = "A" } /** * Represents a storyboard command. */ declare class Command { /** * The type of the command. */ readonly type: StoryboardCommandType; /** * The parameter type of the command. */ readonly parameterType?: StoryboardParameterCommandType; /** * The easing of the command. */ easing: Easing; /** * The time at which the command starts. */ startTime: number; /** * The time at which the command ends. */ endTime: number; /** * The start value of the command. */ startValue: T; /** * The end value of the command. */ endValue: T; /** * The duration of the command. */ get duration(): number; constructor(easing: Easing, startTime: number, endTime: number, startValue: T, endValue: T, type: StoryboardCommandType, parameterType?: StoryboardParameterCommandType); /** * Whether this command is a parameter command. */ isParameter(): this is this & { readonly parameterType: StoryboardParameterCommandType; }; toString(): string; } /** * Represents a command timeline. * * A command timeline contains all commands that occur within a set period of time. */ interface ICommandTimeline { /** * The start time of the command timeline. */ get startTime(): number; /** * The end time of the command timeline. */ get endTime(): number; /** * Whether this command timeline has at least one command. */ get hasCommands(): boolean; } /** * Represents a command timeline. * * A command timeline contains all commands of the same type that occur in a sprite. */ declare class CommandTimeline implements ICommandTimeline { /** * The type of the command timeline. */ readonly type: StoryboardCommandType; /** * The parameter command type of the command timeline. */ readonly parameterType?: StoryboardParameterCommandType; private _commands; private _startTime; private _endTime; private _startValue; private _endValue; /** * The commands in this command timeline. */ get commands(): Command[]; get startTime(): number; get endTime(): number; /** * The start value of the command timeline. */ get startValue(): T | null; /** * The end value of the command timeline. */ get endValue(): T | null; get hasCommands(): boolean; constructor(type: StoryboardCommandType, parameterType?: StoryboardParameterCommandType); /** * Adds a command to this command timeline. * * @param easing The easing to apply. * @param startTime The start time of the command. * @param endTime The end time of the command. * @param startValue The start value of the command. * @param endValue The end value of the command. */ add(easing: Easing, startTime: number, endTime: number, startValue: T, endValue: T): void; } type CommandTimelineSelector = (timelineGroup: CommandTimelineGroup) => CommandTimeline; /** * Represents a group of command timelines. */ declare class CommandTimelineGroup { /** * The command timeline that changes an animation or sprite's X and Y coordinates. */ move: CommandTimeline; /** * The command timeline that changes an animation or sprite's X-coordinate. */ x: CommandTimeline; /** * The command timeline that changes an animation or sprite's Y-coordinate. */ y: CommandTimeline; /** * The command timeline that scales an animation or sprite with a number. */ scale: CommandTimeline; /** * The command timeline that scales an animation or sprite with a vector. * * This allows scaling the width and height of an animation or sprite individually at the same time. */ vectorScale: CommandTimeline; /** * The command timeline that rotates an animation or sprite, in radians, clockwise. */ rotation: CommandTimeline; /** * The command timeline that changes an animation or sprite's virtual light source color. * * The colors of the pixels on the animation or sprite are determined subtractively. */ color: CommandTimeline; /** * The command timeline that changes the opacity of an animation or sprite. */ alpha: CommandTimeline; /** * The command timeline that determines the blending behavior of an animation or sprite. */ blendingParameters: CommandTimeline; /** * The command timeline that determines whether the animation or sprite should be flipped horizontally. */ flipHorizontal: CommandTimeline; /** * The command timeline that determines whether the animation or sprite should be flipped vertically. */ flipVertical: CommandTimeline; private readonly timelines; /** * The start time of commands. */ get commandsStartTime(): number; /** * The end time of commands. */ get commandsEndTime(): number; /** * The duration of commands. */ get commandsDuration(): number; /** * The start time of the command timeline group. */ get startTime(): number; /** * The end time of the command timeline group. */ get endTime(): number; /** * The duration of the command timeline group. */ get duration(): number; /** * Whether this command timeline group has at least one command. */ get hasCommands(): boolean; /** * Gets the commands from a command timeline. * * @param timelineSelector A function to select the command timeline to retrieve commands from. * @param offset The offset to apply to all commands. */ getCommands(timelineSelector: CommandTimelineSelector, offset?: number): Command[]; } /** * Represents a loop compound command. */ declare class CommandLoop extends CommandTimelineGroup { /** * The start time of the loop command. */ loopStartTime: number; /** * The total number of times this loop is played back. Always greater than zero. */ readonly totalIterations: number; get startTime(): number; get endTime(): number; constructor(startTime: number, repeatCount: number); getCommands(timelineSelector: CommandTimelineSelector, offset?: number): Command[]; toString(): string; } /** * Represents a trigger command. */ declare class CommandTrigger extends CommandTimelineGroup { /** * The name of the trigger. */ triggerName: string; /** * The start time of the command. */ triggerStartTime: number; /** * The end time of the command. */ triggerEndTime: number; /** * The group number of the command. */ groupNumber: number; constructor(triggerName: string, startTime: number, endTime: number, groupNumber: number); toString(): string; } /** * A Math utility class containing all methods related to the error function. * * This class shares the same implementation as {@link https://numerics.mathdotnet.com/ Math.NET Numerics}. */ declare abstract class ErrorFunction { /** * Polynomial coefficients for a numerator of erfImp * calculation for erf(x) in the interval [1e-10, 0.5]. */ private static readonly erfImpAn; /** * Polynomial coefficients for a denominator of erfImp * calculation for erf(x) in the interval [1e-10, 0.5]. */ private static readonly erfImpAd; /** * Polynomial coefficients for a numerator in erfImp * calculationfor erfc(x) in the interval [0.5, 0.75]. */ private static readonly erfImpBn; /** * Polynomial coefficients for a denominator in erfImp * calculation for Erfc(x) in the interval [0.5, 0.75]. */ private static readonly erfImpBd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [0.75, 1.25]. */ private static readonly erfImpCn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [0.75, 1.25]. */ private static readonly erfImpCd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [1.25, 2.25]. */ private static readonly erfImpDn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [1.25, 2.25]. */ private static readonly erfImpDd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [2.25, 3.5]. */ private static readonly erfImpEn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [2.25, 3.5]. */ private static readonly erfImpEd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [3.5, 5.25]. */ private static readonly erfImpFn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [3.5, 5.25]. */ private static readonly erfImpFd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [5.25, 8]. */ private static readonly erfImpGn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [5.25, 8]. */ private static readonly erfImpGd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [8, 11.5]. */ private static readonly erfImpHn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [8, 11.5]. */ private static readonly erfImpHd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [11.5, 17]. */ private static readonly erfImpIn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [11.5, 17]. */ private static readonly erfImpId; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [17, 24]. */ private static readonly erfImpJn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [17, 24]. */ private static readonly erfImpJd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [24, 38]. */ private static readonly erfImpKn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [24, 38]. */ private static readonly erfImpKd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [38, 60]. */ private static readonly erfImpLn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [38, 60]. */ private static readonly erfImpLd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [60, 85]. */ private static readonly erfImpMn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [60, 85]. */ private static readonly erfImpMd; /** * Polynomial coefficients for a numerator in erfImp * calculation for erfc(x) in the interval [85, 110]. */ private static readonly erfImpNn; /** * Polynomial coefficients for a denominator in erfImp * calculation for erfc(x) in the interval [85, 110]. */ private static readonly erfImpNd; /** * Polynomial coefficients for a numerator of erfInvImp * calculation for erf^-1(z) in the interval [0, 0.5]. */ private static readonly ervInvImpAn; /** * Polynomial coefficients for a denominator of erfInvImp * calculation for erf^-1(z) in the interval [0, 0.5]. */ private static readonly ervInvImpAd; /** * Polynomial coefficients for a numerator of erfInvImp * calculation for erf^-1(z) in the interval [0.5, 0.75]. */ private static readonly ervInvImpBn; /** * Polynomial coefficients for a denominator of erfInvImp * calculation for erf^-1(z) in the interval [0.5, 0.75]. */ private static readonly ervInvImpBd; /** * Polynomial coefficients for a numerator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x less than 3. */ private static readonly ervInvImpCn; /** * Polynomial coefficients for a denominator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x less than 3. */ private static readonly ervInvImpCd; /** * Polynomial coefficients for a numerator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x between 3 and 6. */ private static readonly ervInvImpDn; /** * Polynomial coefficients for a denominator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x between 3 and 6. */ private static readonly ervInvImpDd; /** * Polynomial coefficients for a numerator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x between 6 and 18. */ private static readonly ervInvImpEn; /** * Polynomial coefficients for a denominator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x between 6 and 18. */ private static readonly ervInvImpEd; /** * Polynomial coefficients for a numerator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x between 18 and 44. */ private static readonly ervInvImpFn; /** * Polynomial coefficients for a denominator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x between 18 and 44. */ private static readonly ervInvImpFd; /** * Polynomial coefficients for a numerator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x greater than 44. */ private static readonly ervInvImpGn; /** * Polynomial coefficients for a denominator of erfInvImp * calculation for erf^-1(z) in the interval [0.75, 1] with x greater than 44. */ private static readonly ervInvImpGd; /** * Calculates the error function. * * @param x The value to evaluate. * @returns The error function evaluated at x, or: * - 1 if `x == Number.POSITIVE_INFINITY`; * - -1 if `x == Number.NEGATIVE_INFINITY`. */ static erf(x: number): number; /** * Calculates the complementary error function. * * @param x The value to evaluate. * @returns The complementary error function evaluated at given value, or: * - 0 if `x === Number.POSITIVE_INFINITY`; * - 2 if `x === Number.NEGATIVE_INFINITY`. */ static erfc(x: number): number; /** * Calculates the inverse error function evaluated at z. * * @param z The value to evaluate. * @returns The inverse error function evaluated at z, or: * - `Number.POSITIVE_INFINITY` if `z >= 1`; * - `Number.NEGATIVE_INFINITY` if `z <= -1`. */ static erfInv(z: number): number; /** * Calculates the complementary inverse error function evaluated at z. * * This implementation has been tested against the arbitrary precision mpmath library * and found cases where only 9 significant figures correct can be guaranteed. * * @param z The value to evaluate. * @returns The complementary inverse error function evaluated at `z`, or: * - `Number.POSITIVE_INFINITY` if `z <= 0`; * - `Number.NEGATIVE_INFINITY` if `z >= -2`. */ static erfcInv(z: number): number; /** * The implementation of the error function. * * @param z Where to evaluate the error function. * @param invert Whether to compute 1 - the error function. * @returns The error function. */ private static erfImp; /** * The implementation of the inverse error function. * * @param p The first intermediate parameter. * @param q The second intermediate parameter. * @param s The third intermediate parameter. * @returns The inverse error function. */ private static erfInvImp; } declare abstract class HitWindow { /** * The overall difficulty of this hit window. */ readonly overallDifficulty: number; /** * @param overallDifficulty The overall difficulty of this hit window. */ constructor(overallDifficulty: number); /** * Gets the hit window for 300 (great) hit result. * * @param isPrecise Whether to calculate for Precise mod. * @returns The hit window in milliseconds. */ abstract hitWindowFor300(isPrecise?: boolean): number; /** * Gets the hit window for 100 (good) hit result. * * @param isPrecise Whether to calculate for Precise mod. * @returns The hit window in milliseconds. */ abstract hitWindowFor100(isPrecise?: boolean): number; /** * Gets the hit window for 50 (meh) hit result. * * @param isPrecise Whether to calculate for Precise mod. * @returns The hit window in milliseconds. */ abstract hitWindowFor50(isPrecise?: boolean): number; } /** * Represents the hit window of osu!droid. */ declare class DroidHitWindow extends HitWindow { /** * Calculates the overall difficulty value of a great hit window. * * @param value The value of the hit window, in milliseconds. * @param isPrecise Whether to calculate for Precise mod. * @returns The overall difficulty value. */ static hitWindow300ToOD(value: number, isPrecise?: boolean): number; /** * Calculates the overall difficulty value of a good hit window. * * @param value The value of the hit window, in milliseconds. * @param isPrecise Whether to calculate for Precise mod. * @returns The overall difficulty value. */ static hitWindow100ToOD(value: number, isPrecise?: boolean): number; /** * Calculates the overall difficulty value of a meh hit window. * * @param value The value of the hit window, in milliseconds. * @param isPrecise Whether to calculate for Precise mod. * @returns The overall difficulty value. */ static hitWindow50ToOD(value: number, isPrecise?: boolean): number; hitWindowFor300(isPrecise?: boolean): number; hitWindowFor100(isPrecise?: boolean): number; hitWindowFor50(isPrecise?: boolean): number; } /** * Represents the hit window of osu!standard. */ declare class OsuHitWindow extends HitWindow { /** * Calculates the overall difficulty value of a great hit window. * * @param value The value of the hit window, in milliseconds. * @returns The overall difficulty value. */ static hitWindow300ToOD(value: number): number; /** * Calculates the overall difficulty value of a good hit window. * * @param value The value of the hit window, in milliseconds. * @returns The overall difficulty value. */ static hitWindow100ToOD(value: number): number; /** * Calculates the overall difficulty value of a meh hit window. * * @param value The value of the hit window, in milliseconds. * @returns The overall difficulty value. */ static hitWindow50ToOD(value: number): number; hitWindowFor300(): number; hitWindowFor100(): number; hitWindowFor50(): number; } /** * An evaluator for evaluating stack heights of hitobjects. */ declare abstract class HitObjectStackEvaluator { private static readonly stackDistance; /** * Applies note stacking to hit objects using osu!standard algorithm. * * @param formatVersion The format version of the beatmap containing the hit objects. * @param objects The hit objects to apply stacking to. * @param ar The calculated approach rate of the beatmap. * @param stackLeniency The multiplier for the threshold in time where hit objects placed close together stack, ranging from 0 to 1. * @param startIndex The minimum index bound of the hit object to apply stacking to. Defaults to 0. * @param endIndex The maximum index bound of the hit object to apply stacking to. Defaults to the last index of the array of hit objects. */ static applyStandardStacking(formatVersion: number, hitObjects: readonly PlaceableHitObject[], ar: number, stackLeniency: number, startIndex?: number, endIndex?: number): void; /** * Applies note stacking to hitobjects using osu!droid algorithm. * * @param hitObjects The hitobjects to apply stacking to. * @param stackLeniency The multiplier for the threshold in time where hit objects placed close together stack, ranging from 0 to 1. */ static applyDroidStacking(hitObjects: readonly PlaceableHitObject[], stackLeniency: number): void; /** * Applies note stacking to hit objects. * * Used for beatmaps version 5 or older. * * @param objects The hit objects to apply stacking to. * @param ar The calculated approach rate of the beatmap. * @param stackLeniency The multiplier for the threshold in time where hit objects placed close together stack, ranging from 0 to 1. */ private static applyStandardOldStacking; } /** * Represents available hitsound types. */ declare enum HitSoundType { none = 0, normal = 1, whistle = 2, finish = 4, clap = 8 } /** * Quick and simple if statement for type checking. */ type If = T extends true ? A : T extends false ? B : A | B; /** * Holds interpolation methods for numbers. */ declare abstract class Interpolation { /** * Performs a linear interpolation. * * @param start The starting point of the interpolation. * @param final The final point of the interpolation. * @param amount The interpolation multiplier. * @returns The interpolated value. */ static lerp(start: number, final: number, amount: number): number; } /** * Ranking status of a beatmap. */ declare enum RankedStatus { graveyard = -2, wip = -1, pending = 0, ranked = 1, approved = 2, qualified = 3, loved = 4 } interface OsuAPIResponse { readonly approved: string; readonly submit_date: string; readonly approved_date: string; readonly last_update: string; readonly artist: string; readonly beatmap_id: string; readonly beatmapset_id: string; readonly bpm: string; readonly creator: string; readonly creator_id: string; readonly difficultyrating?: string; readonly diff_aim?: string; readonly diff_speed?: string; readonly diff_size: string; readonly diff_overall: string; readonly diff_approach: string; readonly diff_drain: string; readonly hit_length: string; readonly source: string; readonly genre_id: string; readonly language_id: string; readonly title: string; readonly total_length: string; readonly version: string; readonly file_md5: string; readonly mode: string; readonly tags: string; readonly favourite_count: string; readonly rating: string; readonly playcount: string; readonly passcount: string; readonly count_normal: string; readonly count_slider: string; readonly count_spinner: string; readonly max_combo: string; readonly storyboard: string; readonly video: string; readonly download_unavailable: string; readonly audio_unavailable: string; readonly packs?: string; } /** * Represents a beatmap with general information. */ declare class MapInfo { /** * The title of the song of the beatmap. */ title: string; /** * The full title of the beatmap, which is `Artist - Title (Creator) [Difficulty Name]`. */ get fullTitle(): string; /** * The artist of the song of the beatmap. */ artist: string; /** * The creator of the beatmap. */ creator: string; /** * The difficulty name of the beatmap. */ version: string; /** * The source of the song, if any. */ source: string; /** * The ranking status of the beatmap. */ approved: RankedStatus; /** * The ID of the beatmap. */ beatmapID: number; /** * The ID of the beatmapset containing the beatmap. */ beatmapsetID: number; /** * The amount of times the beatmap has been played. */ plays: number; /** * The amount of times the beatmap has been favorited. */ favorites: number; /** * The date of which the beatmap was submitted. */ submitDate: Date; /** * The date of which the beatmap was last updated. */ lastUpdate: Date; /** * The duration of the beatmap not including breaks. */ hitLength: number; /** * The duration of the beatmap including breaks. */ totalLength: number; /** * The BPM of the beatmap. */ bpm: number; /** * The amount of circles in the beatmap. */ circles: number; /** * The amount of sliders in the beatmap. */ sliders: number; /** * The amount of spinners in the beatmap. */ spinners: number; /** * The amount of objects in the beatmap. */ get objects(): number; /** * The maximum combo of the beatmap. */ maxCombo: number; /** * The circle size of the beatmap. */ cs: number; /** * The approach rate of the beatmap. */ ar: number; /** * The overall difficulty of the beatmap. */ od: number; /** * The health drain rate of the beatmap. */ hp: number; /** * The beatmap packs that contain this beatmap, represented by their ID. */ packs: string[]; /** * The aim difficulty rating of the beatmap. */ aimDifficulty: number; /** * The speed difficulty rating of the beatmap. */ speedDifficulty: number; /** * The generic difficulty rating of the beatmap. */ totalDifficulty: number; /** * The MD5 hash of the beatmap. */ hash: string; /** * Whether or not this beatmap has a storyboard. */ storyboardAvailable: boolean; /** * Whether or not this beatmap has a video. */ videoAvailable: boolean; /** * The decoded beatmap from beatmap decoder. */ get beatmap(): If; private cachedBeatmap; /** * Retrieve a beatmap's general information. * * @param beatmapIdOrHash The beatmap ID or MD5 hash of the beatmap. * @param downloadBeatmap Whether to also retrieve the .osu file of the beatmap. Defaults to `true`. * @returns The beatmap, `null` if the beatmap is not found or the beatmap is not an osu!standard beatmap. */ static getInformation(beatmapIdOrHash: string | number, downloadBeatmap?: boolean): Promise | null>; /** * Retrieve a beatmap's general information. * * @param beatmapIdOrHash The beatmap ID or MD5 hash of the beatmap. * @param downloadBeatmap Whether to also retrieve the .osu file of the beatmap. Defaults to `true`. * @returns The beatmap, `null` if the beatmap is not found or the beatmap is not an osu!standard beatmap. */ static getInformation(beatmapIdOrHash: string | number, downloadBeatmap: false): Promise | null>; /** * Fills the current instance with map data. * * @param mapinfo The map data. */ fillMetadata(mapinfo: OsuAPIResponse): MapInfo; /** * Checks whether the beatmap file has been downloaded. */ hasDownloadedBeatmap(): this is MapInfo; /** * Retrieves the .osu file of the beatmap. * * After this, you can use the `hasDownloadedBeatmap` method to check if the beatmap has been downloaded. * * @param force Whether to download the file regardless if it's already available. */ retrieveBeatmapFile(force?: boolean): Promise; /** * Converts the beatmap's BPM if speed-changing mods are applied. */ convertBPM(stats: MapStats): number; /** * Converts the beatmap's status into a string. */ convertStatus(): string; /** * Converts the beatmap's length if speed-changing mods are applied. */ convertTime(stats: MapStats): string; /** * Time string parsing function for statistics utility. */ private timeString; /** * Shows the beatmap's statistics based on applied statistics and option. * * - Option `0`: return map title and mods used if defined * - Option `1`: return song source and map download link to beatmap mirrors * - Option `2`: return circle, slider, and spinner count * - Option `3`: return CS, AR, OD, HP, and max score statistics for droid * - Option `4`: return CS, AR, OD, HP, and max score statistics for PC * - Option `5`: return BPM, map length, and max combo * - Option `6`: return last update date and map status * - Option `7`: return favorite count and play count * * @param option The option to pick. * @param stats The custom statistics to apply. This will only be used to apply mods, custom speed multiplier, and force AR. */ showStatistics(option: number, stats?: MapStats): string; /** * Returns a color integer based on the beatmap's ranking status. * * Useful to make embed messages. */ get statusColor(): number; /** * Returns a string representative of the class. */ toString(): string; } /** * Some math utility functions. */ declare abstract class MathUtils { /** * Rounds a specified number with specified amount of fractional digits. * * @param num The number to round. * @param fractionalDigits The amount of fractional digits. */ static round(num: number, fractionalDigits: number): number; /** * Limits the specified number on range `[min, max]`. * * @param num The number to limit. * @param min The minimum range. * @param max The maximum range. */ static clamp(num: number, min: number, max: number): number; /** * Calculates the standard deviation of given data. * * @param data The data to calculate. */ static calculateStandardDeviation(data: number[]): number; /** * Converts degrees to radians. * * @param degrees An angle in degrees. * @returns The angle expressed in radians. */ static degreesToRadians(degrees: number): number; /** * Converts radians to degrees. * * @param radians An angle in radians. * @returns The angle expressed in degrees. */ static radiansToDegrees(radians: number): number; } /** * Represents the Auto mod. */ declare class ModAuto extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the Autopilot mod. */ declare class ModAutopilot extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the DoubleTime mod. */ declare class ModDoubleTime extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the Easy mod. */ declare class ModEasy extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the Flashlight mod. */ declare class ModFlashlight extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the HalfTime mod. */ declare class ModHalfTime extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the HardRock mod. */ declare class ModHardRock extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly bitwise: number; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly droidString: string; } /** * Represents the Hidden mod. */ declare class ModHidden extends Mod implements IModApplicableToDroid, IModApplicableToOsu { static readonly fadeInDurationMultiplier: number; static readonly fadeOutDurationMultiplier: number; readonly acronym: string; readonly name: string; readonly bitwise: number; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly droidString: string; } /** * Represents the NightCore mod. */ declare class ModNightCore extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the NoFail mod. */ declare class ModNoFail extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the Perfect mod. */ declare class ModPerfect extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the Precise mod. */ declare class ModPrecise extends Mod implements IModApplicableToDroid { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly droidScoreMultiplier: number; readonly droidString: string; } /** * Represents the ReallyEasy mod. */ declare class ModReallyEasy extends Mod implements IModApplicableToDroid { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly droidScoreMultiplier: number; readonly droidString: string; } /** * Represents the Relax mod. */ declare class ModRelax extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the ScoreV2 mod. */ declare class ModScoreV2 extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the SmallCircle mod. */ declare class ModSmallCircle extends Mod implements IModApplicableToDroid { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly droidScoreMultiplier: number; readonly droidString: string; } /** * Represents the SpunOut mod. */ declare class ModSpunOut extends Mod implements IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly pcRanked: boolean; readonly pcScoreMultiplier: number; readonly bitwise: number; } /** * Represents the SuddenDeath mod. */ declare class ModSuddenDeath extends Mod implements IModApplicableToDroid, IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly droidRanked: boolean; readonly pcRanked: boolean; readonly droidScoreMultiplier: number; readonly pcScoreMultiplier: number; readonly bitwise: number; readonly droidString: string; } /** * Represents the TouchDevice mod. */ declare class ModTouchDevice extends Mod implements IModApplicableToOsu { readonly acronym: string; readonly name: string; readonly pcRanked: boolean; readonly pcScoreMultiplier: number; readonly bitwise: number; } /** * Options for parsing mods. */ interface ModParseOptions { /** * Whether to check for duplicate mods. Defaults to `true`. */ checkDuplicate?: boolean; /** * Whether to check for incompatible mods. Defaults to `true`. */ checkIncompatible?: boolean; } /** * Utilities for mods. */ declare abstract class ModUtil { /** * Mods that are incompatible with each other. */ static readonly incompatibleMods: Mod[][]; /** * All mods that exists. */ static readonly allMods: Mod[]; /** * Mods that change the playback speed of a beatmap. */ static readonly speedChangingMods: Mod[]; /** * Mods that change the way the map looks. */ static readonly mapChangingMods: Mod[]; /** * Gets a list of mods from a droid mod string, such as "hd". * * @param str The string. * @param options Options for parsing behavior. */ static droidStringToMods(str: string, options?: ModParseOptions): (Mod & IModApplicableToDroid)[]; /** * Gets a list of mods from a PC modbits. * * @param modbits The modbits. * @param options Options for parsing behavior. */ static pcModbitsToMods(modbits: number, options?: ModParseOptions): (Mod & IModApplicableToOsu)[]; /** * Gets a list of mods from a PC mod string, such as "HDHR". * * @param str The string. * @param options Options for parsing behavior. */ static pcStringToMods(str: string, options?: ModParseOptions): Mod[]; /** * Checks for mods that are duplicated. * * @param mods The mods to check for. * @returns Mods that have been filtered. */ static checkDuplicateMods(mods: Mod[]): Mod[]; /** * Checks for mods that are incompatible with each other. * * @param mods The mods to check for. * @returns Mods that have been filtered. */ static checkIncompatibleMods(mods: Mod[]): Mod[]; /** * Removes speed-changing mods from an array of mods. * * @param mods The array of mods. * @returns A new array with speed changing mods filtered out. */ static removeSpeedChangingMods(mods: Mod[]): Mod[]; /** * Processes parsing options. * * @param mods The mods to process. * @param options The options to process. * @returns The processed mods. */ private static processParsingOptions; } /** * Continuous Univariate Normal distribution, also known as Gaussian distribution. * * For details about this distribution, see {@link http://en.wikipedia.org/wiki/Normal_distribution Wikipedia - Normal distribution}. * * This class shares the same implementation as {@link https://numerics.mathdotnet.com/ Math.NET Numerics}. */ declare abstract class NormalDistribution { /** * Computes the inverse of the cumulative distribution function (InvCDF) for the distribution * at the given probability. This is also known as the quantile or percent point function. * * @param mean The mean (μ) of the normal distribution. * @param stdDev The standard deviation (σ) of the normal distribution. Range: σ ≥ 0. * @param p The location at which to compute the inverse cumulative density. * @returns The inverse cumulative density at `p`. */ static invCDF(mean: number, stdDev: number, p: number): number; } /** * Path approximator for sliders. */ declare abstract class PathApproximator { private static readonly bezierTolerance; /** * The amount of pieces to calculate for each control point quadruplet. */ private static readonly catmullDetail; private static readonly circularArcTolerance; /** * Approximates a bezier slider's path. * * Creates a piecewise-linear approximation of a bezier curve by adaptively repeatedly subdividing * the control points until their approximation error vanishes below a given threshold. * * @param controlPoints The anchor points of the slider. */ static approximateBezier(controlPoints: Vector2[]): Vector2[]; /** * Approximates a catmull slider's path. * * Creates a piecewise-linear approximation of a Catmull-Rom spline. * * @param controlPoints The anchor points of the slider. */ static approximateCatmull(controlPoints: Vector2[]): Vector2[]; /** * Approximates a slider's circular arc. * * Creates a piecewise-linear approximation of a circular arc curve. * * @param controlPoints The anchor points of the slider. */ static approximateCircularArc(controlPoints: Vector2[]): Vector2[]; /** * Approximates a linear slider's path. * * Creates a piecewise-linear approximation of a linear curve. * Basically, returns the input. * * @param controlPoints The anchor points of the slider. */ static approximateLinear(controlPoints: Vector2[]): Vector2[]; /** * Checks if a bezier slider is flat enough to be approximated. * * Make sure the 2nd order derivative (approximated using finite elements) is within tolerable bounds. * * NOTE: The 2nd order derivative of a 2D curve represents its curvature, so intuitively this function * checks (as the name suggests) whether our approximation is _locally_ "flat". More curvy parts * need to have a denser approximation to be more "flat". * * @param controlPoints The anchor points of the slider. */ private static bezierIsFlatEnough; /** * Approximates a bezier slider's path. * * This uses {@link https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm De Casteljau's algorithm} to obtain an optimal * piecewise-linear approximation of the bezier curve with the same amount of points as there are control points. * * @param controlPoints The control points describing the bezier curve to be approximated. * @param output The points representing the resulting piecewise-linear approximation. * @param subdivisionBuffer1 The first buffer containing the current subdivision state. * @param subdivisionBuffer2 The second buffer containing the current subdivision state. * @param count The number of control points in the original array. */ private static bezierApproximate; /** * Subdivides `n` control points representing a bezier curve into 2 sets of `n` control points, each * describing a bezier curve equivalent to a half of the original curve. Effectively this splits * the original curve into 2 curves which result in the original curve when pieced back together. * * @param controlPoints The anchor points of the slider. * @param l Parts of the slider for approximation. * @param r Parts of the slider for approximation. * @param subdivisionBuffer Parts of the slider for approximation. * @param count The amount of anchor points in the slider. */ private static bezierSubdivide; /** * Finds a point on the spline at the position of a parameter. * * @param vec1 The first vector. * @param vec2 The second vector. * @param vec3 The third vector. * @param vec4 The fourth vector. * @param t The parameter at which to find the point on the spline, in the range [0, 1]. */ private static catmullFindPoint; } /** * Represents the osu! playfield. */ declare abstract class Playfield { /** * The size of the playfield, which is 512x384. */ static readonly baseSize: Vector2; } /** * A single-variable polynomial with real-valued coefficients and non-negative exponents. * * This class shares the same implementation as {@link https://numerics.mathdotnet.com/ Math.NET Numerics}. */ declare abstract class Polynomial { /** * Evaluates a polynomial at point z. * * Coefficients are ordered ascending by power with power k at index k. * For example, coefficients `[3, -1, 2]` represent `y = 2x^2 - x + 3`. * * @param z The location where to evaluate the polynomial at. * @param coefficients The coefficients of the polynomial, coefficient for power k at index k. * @returns The polynomial at z. */ static evaluate(z: number, coefficients: number[]): number; } /** * Precision utilities. */ declare abstract class Precision { static readonly FLOAT_EPSILON: number; /** * Checks if two numbers are equal with a given tolerance. * * @param value1 The first number. * @param value2 The second number. * @param acceptableDifference The acceptable difference as threshold. Default is `Precision.FLOAT_EPSILON = 1e-3`. */ static almostEqualsNumber(value1: number, value2: number, acceptableDifference?: number): boolean; /** * Checks if two vectors are equal with a given tolerance. * * @param vec1 The first vector. * @param vec2 The second vector. * @param acceptableDifference The acceptable difference as threshold. Default is `Precision.FLOAT_EPSILON = 1e-3`. */ static almostEqualsVector(vec1: Vector2, vec2: Vector2, acceptableDifference?: number): boolean; /** * Checks whether two real numbers are almost equal. * * @param a The first number. * @param b The second number. * @param maximumError The accuracy required for being almost equal. Defaults to `10 * 2^(-53)`. * @returns Whether the two values differ by no more than 10 * 2^(-52). */ static almostEqualRelative(a: number, b: number, maximumError?: number): boolean; /** * Compares two numbers and determines if they are equal within the specified maximum error. * * @param a The norm of the first value (can be negative). * @param b The norm of the second value (can be negative). * @param diff The norm of the difference of the two values (can be negative). * @param maximumError The accuracy required for being almost equal. * @returns Whether both numbers are almost equal up to the specified maximum error. */ static almostEqualNormRelative(a: number, b: number, diff: number, maximumError: number): boolean; } /** * Represents an information about a hitobject-specific sample bank. */ declare class SampleBankInfo { /** * The name of the sample bank file, if this sample bank uses custom samples. */ filename: string; /** * The main sample bank. */ normal: SampleBank; /** * The addition sample bank. */ add: SampleBank; /** * The volume at which the sample bank is played. * * If this is 0, the control point's volume should be used instead. */ volume: number; /** * The index of the sample bank, if this sample bank uses custom samples. * * If this is 0, the control point's sample index should be used instead. */ customSampleBank: number; constructor(bankInfo?: SampleBankInfo); } /** * Represents a storyboard sprite. */ declare class StoryboardSprite extends StoryboardElement { /** * The loop commands of the sprite. */ readonly loops: CommandLoop[]; /** * The trigger commands of the sprite. */ readonly triggers: CommandTrigger[]; /** * The origin of the sprite. */ origin: Anchor; /** * The initial position of the sprite. */ initialPosition: Vector2; /** * The command timeline group of the sprite. */ readonly timelineGroup: CommandTimelineGroup; get startTime(): number; /** * The time at which the first transformation occurs. */ get earliestTransformTime(): number; get endTime(): number; /** * Whether this sprite has at least one command. */ get hasCommands(): boolean; constructor(path: string, origin: Anchor, initialPosition: Vector2); /** * Adds a loop command to the sprite. * * @param startTime The start time of the command. * @param repeatCount The total number of times this loop is played back. Must be greater than zero. * @returns The added command. */ addLoop(startTime: number, repeatCount: number): CommandLoop; /** * Adds a trigger command. * * @param triggerName The name of the trigger. * @param startTime The start time of the command. * @param endTime The end time of the command. * @param groupNumber The group number of the command. * @returns The added command. */ addTrigger(triggerName: string, startTime: number, endTime: number, groupNumber: number): CommandTrigger; toString(): string; } /** * Represents a storyboard's animation. */ declare class StoryboardAnimation extends StoryboardSprite { /** * The amount of frames that the animation has. */ frameCount: number; /** * The delay between frames, in milliseconds. */ frameDelay: number; /** * The loop type of the animation. */ loopType: AnimationLoopType; constructor(path: string, origin: Anchor, initialPosition: Vector2, frameCount: number, frameDelay: number, loopType: AnimationLoopType); } /** * A storyboard decoder. */ declare class StoryboardDecoder extends Decoder> { protected finalResult: Storyboard; protected decoders: Partial>>; constructor(formatVersion?: number); protected reset(): void; } /** * The base of per-section storyboard encoders. */ declare abstract class StoryboardBaseEncoder extends BaseEncoder { /** * The storyboard that is being encoded. */ readonly storyboard: Storyboard; constructor(storyboard: Storyboard, encodeSections?: boolean); } /** * A storyboard encoder. * * Note that this storyboard encoder does not encode storyboards, and as such equality with the * original beatmap or storyboard file is not guaranteed (and usually will not be equal). */ declare class StoryboardEncoder extends Encoder { protected finalResult: string; protected encoders: StoryboardBaseEncoder[]; private readonly encodeSections; constructor(target: Storyboard, encodeSections?: boolean); protected reset(): void; } /** * Types of storyboard events. */ declare enum StoryboardEventType { background = "Background", sprite = "Sprite", color = "Colour", sample = "Sample", animation = "Animation" } /** * Represents a storyboard sample. */ declare class StoryboardSample extends StoryboardElement { private _startTime; get startTime(): number; /** * The volume at which the sample is played. */ readonly volume: number; constructor(path: string, time: number, volume: number); } /** * Some utilities, no biggie. */ declare abstract class Utils { /** * Returns a random element of an array. * * @param array The array to get the element from. */ static getRandomArrayElement(array: T[]): T; /** * Deep copies an object. * * @param obj The object to deep copy. */ static deepCopy(obj: T): T; /** * Creates an array with specific length that's prefilled with an initial value. * * @param length The length of the array. * @param initialValue The initial value of each array value. */ static initializeArray(length: number, initialValue?: T): T[]; /** * Pauses the execution of a function for * the specified duration. * * @param duration The duration to pause for, in seconds. */ static sleep(duration: number): Promise; } declare abstract class ZeroCrossingBracketing { /** * Detect a range containing at least one root. * * This iterative method stops when two values with opposite signs are found. * * @param f The function to detect roots from. * @param bounds The upper and lower value of the range. * @param factor The growing factor of research. Defaults to 1.6. * @param maxIterations Maximum number of iterations. Defaults to 50. * @returns Whether the bracketing operation succeeded. */ static expand(f: (x: number) => number, bounds: RootBounds, factor?: number, maxIterations?: number): boolean; static reduce(f: (x: number) => number, bounds: RootBounds, subdivisions?: number): boolean; static expandReduce(f: (x: number) => number, bounds: RootBounds, expansionFactor?: number, expansionMaxIterations?: number, reduceSubdivisions?: number): boolean; } export { Accuracy, Anchor, AnimationLoopType, Beatmap, BeatmapBackground, BeatmapColor, BeatmapControlPoints, BeatmapCountdown, BeatmapDecoder, BeatmapDifficulty, BeatmapEditor, BeatmapEncoder, BeatmapEvents, BeatmapGeneral, BeatmapHitObjects, BeatmapMetadata, BeatmapOverlayPosition, BeatmapVideo, BlendingEquation, BlendingParameters, BlendingType, BreakPoint, Brent, Circle, CircleSizeCalculator, Command, CommandLoop, CommandTimeline, CommandTimelineGroup, CommandTimelineSelector, CommandTrigger, ControlPointManager, DifficultyControlPoint, DifficultyControlPointManager, DroidAPIRequestBuilder, DroidHitWindow, Easing, EditorGridSize, EffectControlPoint, EffectControlPointManager, ErrorFunction, GameMode, HitObject, HitObjectStackEvaluator, HitSampleInfo, HitSoundType, ICommandTimeline, IModApplicableToDroid, IModApplicableToOsu, If, Interpolation, MapInfo, MapStats, MathUtils, Mod, ModAuto, ModAutopilot, ModDoubleTime, ModEasy, ModFlashlight, ModHalfTime, ModHardRock, ModHidden, ModNightCore, ModNoFail, ModParseOptions, ModPerfect, ModPrecise, ModReallyEasy, ModRelax, ModScoreV2, ModSmallCircle, ModSpunOut, ModSuddenDeath, ModTouchDevice, ModUtil, Modes, NormalDistribution, ObjectTypes, OsuAPIRequestBuilder, OsuAPIResponse, OsuHitWindow, PathApproximator, PathType, PlaceableHitObject, Playfield, Polynomial, Precision, RGBColor, RankedStatus, RequestResponse, RootBounds, SampleBank, SampleBankInfo, SampleControlPoint, SampleControlPointManager, Slider, SliderHead, SliderNestedHitObject, SliderPath, SliderRepeat, SliderTail, SliderTick, Spinner, Storyboard, StoryboardAnimation, StoryboardCommandType, StoryboardDecoder, StoryboardElement, StoryboardEncoder, StoryboardEventType, StoryboardLayer, StoryboardLayerType, StoryboardParameterCommandType, StoryboardSample, StoryboardSprite, TimingControlPoint, TimingControlPointManager, Utils, Vector2, ZeroCrossingBracketing };