Skip to content
Merged
Show file tree
Hide file tree
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
34 changes: 34 additions & 0 deletions types/gimloader/gimloader-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ api.patcher; // $ExpectType Readonly<ScopedPatcherApi>
api.plugins; // $ExpectType Readonly<PluginsApi>
api.rewriter; // $ExpectType Readonly<ScopedRewriterApi>
api.storage; // $ExpectType Readonly<ScopedStorageApi>
api.commands; // $ExpectType Readonly<ScopedCommandsApi>

GL.React; // $ExpectType typeof React
GL.UI; // $ExpectType Readonly<UIApi>
Expand All @@ -22,6 +23,7 @@ GL.patcher; // $ExpectType Readonly<PatcherApi>
GL.plugins; // $ExpectType Readonly<PluginsApi>
GL.rewriter; // $ExpectType Readonly<RewriterApi>
GL.storage; // $ExpectType Readonly<StorageApi>
GL.commands; // $ExpectType Readonly<CommandsApi>

// @ts-expect-error
GL.onStop;
Expand All @@ -48,6 +50,38 @@ api.net.modifyFetchRequest("/path/*/thing", (options) => null);
api.net.modifyFetchRequest("/path/*/thing", (options) => options);
api.net.modifyFetchResponse("/path/*/thing", (response) => response);

api.commands.addCommand({
text: "test",
hidden: () => false,
keywords: ["thing", "thing"],
}, async (context) => {
await context.number({
title: "Number",
decimal: false,
max: 6,
min: 1,
});
await context.select({
title: "Select",
options: [
{
label: "Option 1",
value: "option1",
},
{
label: "Option 2",
value: "option2",
},
],
});
await context.string({
title: "String",
maxLength: 10,
});
});

api.commands.addCommand({ text: () => "something" }, () => {});

GL.stores.phaser; // $ExpectType Phaser
window.stores.phaser; // $ExpectType Phaser
let worldManagerInstance!: Gimloader.Stores.WorldManager;
Expand Down
Loading