-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5622d92
commit d13432e
Showing
1 changed file
with
67 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import components from "../src/api/components"; | ||
|
||
type HTMLParseResult = NodeListOf<ChildNode> | ChildNode; | ||
|
||
interface Client { | ||
/** | ||
* Completely relaunches the client. | ||
*/ | ||
relaunch(): void; | ||
} | ||
|
||
interface DiscordWindow { | ||
/** | ||
* Minimizes the window. | ||
*/ | ||
minimize(): void; | ||
/** | ||
* Restores the window, reopening the window if it is closed. | ||
*/ | ||
restore(): void; | ||
/** | ||
* Maximizes the window, restoring if it is minimized and reopening the window if it is closed. | ||
*/ | ||
maximize(): void; | ||
/** | ||
* Closes the window, remains in system tray. | ||
*/ | ||
close(): void; | ||
} | ||
|
||
interface StyleInjector { | ||
/** | ||
* Injects `css` into the Discord client. | ||
* @param css The CSS to be injected. | ||
*/ | ||
inject(css: string): void; | ||
} | ||
|
||
interface ComponentBuilder { | ||
/** | ||
* Creates a component. | ||
* | ||
* @param component The component to create. | ||
* @param options The options to pass to the component function. | ||
* @returns the output element of the component function. | ||
*/ | ||
createComponent(component: Function, options: any): HTMLElement; | ||
/** | ||
* | ||
* @param category The category, which can be something like "hello.world" to have hello as the category and world as the subcategory. | ||
* @param methodName The name of the method or component. | ||
* @param method | ||
* @param createCategory | ||
*/ | ||
createMethod(category: string, methodName: string, method: Function, createCategory: boolean): void; | ||
parseHTML(html: string, fragment: boolean): HTMLParseResult; | ||
} | ||
|
||
type NativeComponents = typeof components; | ||
|
||
export default interface OpenLoader { | ||
client: Client; | ||
window: DiscordWindow, | ||
styleInjector: StyleInjector, | ||
componentBuilder: ComponentBuilder, | ||
components: NativeComponents; | ||
} |