Skip to content

Fix filter typing on upgrades: #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ type Subscripts = Record<string, Record<string, (...args: any) => any>> & {

type UpgradeRarityString = "`0noob`" | "`1kiddie`" | "`2h4x0r`" | "`3h4rdc0r3`" | "`4|_|b3|2`" | "`531337`"
type UpgradeRarityNumber = 0 | 1 | 2 | 3 | 4 | 5
type UpgradeTypeString = "lock" | "script_space" | "chat" | "script" | "tool" | "bot_brain" | "glam"

type UpgradeBase = {
name: string
type: "lock" | "script_space" | "chat" | "script" | "tool" | "bot_brain" | "glam"
type: UpgradeTypeString
up_class?: -1 | 0 | 1 | 2 | 3
tier: 1 | 2 | 3 | 4
rarity: UpgradeRarityNumber
Expand Down Expand Up @@ -551,6 +552,17 @@ type Highsec = Fullsec & PlayerHighsec & {
[x: string]: null | boolean | number | string
rarity: UpgradeRarityString
})[] | ScriptFailure

(args: {
filter:
Partial<{
loaded: boolean
rarity: UpgradeRarityNumber | MongoQuerySelector<UpgradeRarityNumber>
name: string | MongoQuerySelector<string>
} & Omit<{
[k in keyof CliUpgrade]: CliUpgrade[k] | MongoQuerySelector<CliUpgrade[k]>
}, "rarity">>
}): { i: string, name: string, rarity: Upgrade["rarity"], cost: number, loaded: boolean }[] | ScriptFailure
}
}

Expand Down