Options
All
  • Public
  • Public/Protected
  • All
Menu

gd.js

Index

Type aliases

Award

Award: { position?: number; pretty: PrettyAward; raw: RawAward }

A level's award

Type declaration

  • Optional position?: number

    The level's position in the leaderboard. Note this will only exist if the

  • pretty: PrettyAward

    The pretty representation of the award

  • raw: RawAward

    The raw numeric representation of the award. 0 = none, 1 = star, 2 = feature, 3 = epic. Note this is also the amount of creator points earned from the level

BaseSearchConfig

BaseSearchConfig: { award?: 2 | 3 | "Feature" | "Epic"; coins?: boolean; demon?: boolean; difficulty?: RawDifficulty | Difficulty | (0 | 1 | 2 | 3 | 4 | 5 | "Any" | "Easy Demon" | "Medium Demon" | "Hard Demon" | "Insane Demon" | "Extreme Demon")[] | RawDemonDifficulty | DemonDifficulty; length?: RawLevelLength | PrettyLevelLength | (0 | 1 | 2 | 3 | 4 | "Tiny" | "Short" | "Medium" | "Long" | "XL")[]; orderBy?: Order | OrderInt; original?: boolean; query?: number | number[] | string; twoPlayer?: boolean }

A search configuration

Type declaration

  • Optional award?: 2 | 3 | "Feature" | "Epic"

    The award to filter levels by. 2 = Feature, 3 = Epic. Can also pass string value.

  • Optional coins?: boolean

    Whether to only get levels with coins

  • Optional demon?: boolean

    Whether the level to search for should be a demon. This will modify the behavior of the difficulty option.

  • Optional difficulty?: RawDifficulty | Difficulty | (0 | 1 | 2 | 3 | 4 | 5 | "Any" | "Easy Demon" | "Medium Demon" | "Hard Demon" | "Insane Demon" | "Extreme Demon")[] | RawDemonDifficulty | DemonDifficulty

    Difficulty level of levels to get. -1 = N/A, 0 = Auto, 1 = Easy, 2 = Normal, 3 = Hard, 4 = Harder, 5 = Insane. If searching for demons, 0 = Any, 1 = Easy, 2 = Medium, 3 = Hard, 4 = Insane, 5 = Extreme

  • Optional length?: RawLevelLength | PrettyLevelLength | (0 | 1 | 2 | 3 | 4 | "Tiny" | "Short" | "Medium" | "Long" | "XL")[]

    The lengths of the levels to get. Can pass a length ID, its pretty name, or an array containing lengths to get.

  • Optional orderBy?: Order | OrderInt

    How to order the levels. Some values currently unsupported. Can pass either a sorting ID or its pretty name. Misconfiguration of this setting will yield no results.

  • Optional original?: boolean

    Whether to only get original levels

  • Optional query?: number | number[] | string

    The search query string, number (for level ID) or array of numbers (for multiple level IDs)

  • Optional twoPlayer?: boolean

    Whether to only get levels with two-player support

Coins

Coins: { areSilver?: boolean; count: 0 | 1 | 2 | 3 }

A level's coins

Type declaration

  • Optional areSilver?: boolean

    Whether the coins are silver coins or not. Only exists if the level has coins

  • count: 0 | 1 | 2 | 3

    The number of coins in the level

Colors

Colors: { primary: GDColor; secondary: GDColor }

The colors in a Geometry Dash user's profile

Type declaration

Config

Config: { corsURL?: string; dbURL?: string; fetch?: typeof fetch; logLevel?: 0 | 1 | 2 }

Configuration for the GD Client

Type declaration

  • Optional corsURL?: string

    The URL to use as a CORS proxy when making requests from a browser. Note it should have a trailing slash.

  • Optional dbURL?: string

    The URL for the database. Defaults to http://www.boomlings.com/database.

  • Optional fetch?: typeof fetch

    The fetch polyfill to use. Only necessary when fetch is not supported in the target environment. Defaults to node-fetch (if installed)

  • Optional logLevel?: 0 | 1 | 2

    The level of logging. 2 = verbose, 1 = warnings, 0 = off. Defaults to 1.

ConvertibleToAccountID

ConvertibleToAccountID: number | string | User | StatlessSearchedUser

Types that can be converted to an account ID

Credentials

Credentials: { accountID: number; gjp: string; userName: string }

Credentials to use in requests to Geometry Dash servers

Type declaration

  • accountID: number

    The player's account ID

  • gjp: string

    The player's password, XOR-encrypted

  • userName: string

    The player's username

DemonDiffConfig

DemonDiffConfig: { demon: true; difficulty?: RawDemonDifficulty | DemonDifficulty }

Type declaration

DemonDifficulty

DemonDifficulty: "Any" | "Easy Demon" | "Medium Demon" | "Hard Demon" | "Insane Demon" | "Extreme Demon"

Difficulty

Difficulty: "N/A" | "Auto" | "Easy" | "Normal" | "Hard" | "Harder" | "Insane"

DifficultyLevel

DifficultyLevel: { pretty: Difficulty | DemonDifficulty; raw: RawDifficulty }

A level's difficulty

Type declaration

  • pretty: Difficulty | DemonDifficulty

    The difficulty level as a pretty string

  • raw: RawDifficulty

    The difficulty level as a number. -1 = N/A, 0 = Auto, 1 = Easy, 2 = Normal, 3 = Hard, 4 = Harder, 5 = Insane. If demon (i.e. the number of stars is 10), 1 = Easy, 2 = Medium, 3 = Hard, 4 = Insane, 5 = Extreme

FullLevelData

FullLevelData: LevelData & { parsed: { meta: ParsedData; objects: ParsedLevelData[] } }

Full data for a level

GDColor

GDColor: { parsed: string; raw: number }

A color used by a Geometry Dash player.

Type declaration

  • parsed: string

    The color in hexadecimal notation

  • raw: number

    The raw color number, as returned by the server

GDDate

GDDate: { date: Date; pretty: string }

A date from the Geometry Dash servers

Type declaration

  • date: Date

    The time as a date. Note that this may not be completely accurate.

  • pretty: string

    The human-readable time in the "how long ago" format.

GDRequestData

GDRequestData: {}

Parsed data returned from Geometry Dash requests

Type declaration

  • [k: string]: string | number

IconCosmetic

IconCosmetic: "cube" | "ship" | "ball" | "ufo" | "wave" | "spider" | "robot"

An icon type

LevelData

LevelData: { raw: string }

A level's raw data

Type declaration

  • raw: string

    The raw level string after decoding and decompressing. Only offered because gd.js is not primarily a level API, so this can be passed to your own manipulation program.

LevelLength

LevelLength: { pretty: PrettyLevelLength; raw: RawLevelLength }

The length of a level

Type declaration

MessageUser

MessageUser: { accountID: number; id: number; username: string }

Type declaration

  • accountID: number

    The player's account ID

  • id: number

    The player's user ID

  • username: string

    The player's username

NonDemonDiffConfig

NonDemonDiffConfig: { demon?: false; difficulty?: RawDifficulty | Difficulty | (0 | 1 | 2 | 3 | 4 | 5 | "Any" | "Easy Demon" | "Medium Demon" | "Hard Demon" | "Insane Demon" | "Extreme Demon")[] }

Type declaration

  • Optional demon?: false
  • Optional difficulty?: RawDifficulty | Difficulty | (0 | 1 | 2 | 3 | 4 | 5 | "Any" | "Easy Demon" | "Medium Demon" | "Hard Demon" | "Insane Demon" | "Extreme Demon")[]

Order

Order: "likes" | "downloads" | "trending" | "recent" | "featured" | "magic" | "awarded" | "hof"

OrderInt

OrderInt: 0 | 1 | 3 | 4 | 6 | 7 | 11 | 16

ParsedData

ParsedData: {}

A parsed response from the Geometry Dash servers

Type declaration

  • [k: string]: string

ParsedLevelData

ParsedLevelData: {}

A parsed Geometry Dash level object

Type declaration

  • [k: number]: number

Permission

Permission: { pretty: PermissionLevel; raw: 0 | 1 | 2 }

A permission level for a Geometry Dash player.

Type declaration

  • pretty: PermissionLevel

    A prettified string for the permission level. One of "User", "Moderator" or "Elder Moderator"

  • raw: 0 | 1 | 2

    The raw permission number, as returned by the server. 0 = user, 1 = mod, 2 = elder mod.

PermissionLevel

PermissionLevel: "User" | "Moderator" | "Elder Moderator"

PrettyAward

PrettyAward: "None" | "Star" | "Feature" | "Epic"

PrettyLevelLength

PrettyLevelLength: "Tiny" | "Short" | "Medium" | "Long" | "XL"

RawAward

RawAward: 0 | 1 | 2 | 3

RawDemonDifficulty

RawDemonDifficulty: 0 | 1 | 2 | 3 | 4 | 5

RawDifficulty

RawDifficulty: -1 | RawDemonDifficulty

RawLevelLength

RawLevelLength: 0 | 1 | 2 | 3 | 4

RequestConfig

RequestConfig: { body?: GDRequestParams; method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" }

Configuration for a request to the GD servers

Type declaration

  • Optional body?: GDRequestParams

    The parameters for the request

  • Optional method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"

    The method for the request

SearchConfig

SearchConfig: BaseSearchConfig & { demon?: false; difficulty?: RawDifficulty | Difficulty | (0 | 1 | 2 | 3 | 4 | 5 | "Any" | "Easy Demon" | "Medium Demon" | "Hard Demon" | "Insane Demon" | "Extreme Demon")[] } | { demon: true; difficulty?: RawDemonDifficulty | DemonDifficulty }

SocialURL

SocialURL: { fullURL: string; path: string }

A social media platform that a Geometry Dash player uses

Type declaration

  • fullURL: string

    The full URL path to the player's social media

  • path: string

    The path to the player's social media from the platform's base URL

Socials

Socials: { twitch?: SocialURL; twitter?: SocialURL; youtube?: SocialURL }

The social media platforms a Geometry Dash player uses

Type declaration

  • Optional twitch?: SocialURL

    The player's Twitch channel

  • Optional twitter?: SocialURL

    The player's Twitter account

  • Optional youtube?: SocialURL

    The player's YouTube channel

Song

UserCredentials

UserCredentials: { password: string; username: string }

Credentials provided by a user

Type declaration

  • password: string

    The player's password

  • username: string

    The player's username

Generated using TypeDoc