-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from Neodymium7/better-ts
Stricter TypeScript usage
- Loading branch information
Showing
51 changed files
with
568 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,16 @@ | ||
import { Webpack } from "betterdiscord"; | ||
import { expectModule, expectClasses, expectSelectors, expectIcon } from "@lib/utils/webpack"; | ||
import { expectClasses, expectSelectors, expectWithKey } from "@lib/utils/webpack"; | ||
import { AnyComponent } from "@lib/utils/react"; | ||
|
||
const { | ||
Filters: { byKeys, byStrings }, | ||
} = Webpack; | ||
|
||
const Error = (_props) => ( | ||
<div> | ||
<h1 style={{ color: "red" }}>Error: Component not found</h1> | ||
</div> | ||
); | ||
|
||
export const ActivityStatus: any = expectModule({ | ||
filter: byStrings("QuestsIcon", "hangStatusActivity"), | ||
export const ActivityStatus = expectWithKey<AnyComponent>({ | ||
filter: Webpack.Filters.byStrings("QuestsIcon", "hangStatusActivity"), | ||
name: "ActivityStatus", | ||
defaultExport: false, | ||
fatal: true, | ||
}); | ||
|
||
export const Icons = { | ||
Activity: expectIcon( | ||
"Activity", | ||
"M20.97 4.06c0 .18.08.35.24.43.55.28.9.82 1.04 1.42.3 1.24.75 3.7.75 7.09v4.91a3.09" | ||
), | ||
RichActivity: expectIcon("RichActivity", "M6,7 L2,7 L2,6 L6,6 L6,7 Z M8,5 L2,5 L2,4 L8,4"), | ||
Headset: expectIcon("Headset", "M12 3a9 9 0 0 0-8.95 10h1.87a5 5 0 0 1 4.1 2.13l1.37 1.97a3.1 3.1 0 0"), | ||
Screen: expectIcon("Screen", "M5 2a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5ZM13.5 20a.5.5"), | ||
}; | ||
|
||
export const Common = expectModule({ | ||
filter: byKeys("FormSwitch"), | ||
name: "Common", | ||
fallback: { | ||
FormSwitch: Error, | ||
}, | ||
}); | ||
|
||
export const Margins = expectClasses("Margins", ["marginBottom8"]); | ||
export const marginClasses = expectClasses("Margins", ["marginBottom8"]); | ||
|
||
export const peopleListItemSelector = expectSelectors("People List Classes", ["peopleListItem"]).peopleListItem; | ||
export const peopleListItemSelector = expectSelectors("People List Classes", ["peopleListItem"])?.peopleListItem; | ||
|
||
export const memberSelector = expectSelectors("Member Class", ["memberInner", "member"]).member; | ||
export const memberSelector = expectSelectors("Member Class", ["memberInner", "member"])?.member; | ||
|
||
export const privateChannelSelector = expectSelectors("Private Channel Classes", ["favoriteIcon", "channel"]).channel; | ||
export const privateChannelSelector = expectSelectors("Private Channel Classes", ["favoriteIcon", "channel"])?.channel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.