@@ -12,6 +12,7 @@ api.patcher; // $ExpectType Readonly<ScopedPatcherApi>
1212api . plugins ; // $ExpectType Readonly<PluginsApi>
1313api . rewriter ; // $ExpectType Readonly<ScopedRewriterApi>
1414api . storage ; // $ExpectType Readonly<ScopedStorageApi>
15+ api . commands ; // $ExpectType Readonly<ScopedCommandsApi>
1516
1617GL . React ; // $ExpectType typeof React
1718GL . UI ; // $ExpectType Readonly<UIApi>
@@ -22,6 +23,7 @@ GL.patcher; // $ExpectType Readonly<PatcherApi>
2223GL . plugins ; // $ExpectType Readonly<PluginsApi>
2324GL . rewriter ; // $ExpectType Readonly<RewriterApi>
2425GL . storage ; // $ExpectType Readonly<StorageApi>
26+ GL . commands ; // $ExpectType Readonly<CommandsApi>
2527
2628// @ts -expect-error
2729GL . onStop ;
@@ -48,6 +50,38 @@ api.net.modifyFetchRequest("/path/*/thing", (options) => null);
4850api . net . modifyFetchRequest ( "/path/*/thing" , ( options ) => options ) ;
4951api . net . modifyFetchResponse ( "/path/*/thing" , ( response ) => response ) ;
5052
53+ api . commands . addCommand ( {
54+ text : "test" ,
55+ hidden : ( ) => false ,
56+ keywords : [ "thing" , "thing" ] ,
57+ } , async ( context ) => {
58+ await context . number ( {
59+ title : "Number" ,
60+ decimal : false ,
61+ max : 6 ,
62+ min : 1 ,
63+ } ) ;
64+ await context . select ( {
65+ title : "Select" ,
66+ options : [
67+ {
68+ label : "Option 1" ,
69+ value : "option1" ,
70+ } ,
71+ {
72+ label : "Option 2" ,
73+ value : "option2" ,
74+ } ,
75+ ] ,
76+ } ) ;
77+ await context . string ( {
78+ title : "String" ,
79+ maxLength : 10 ,
80+ } ) ;
81+ } ) ;
82+
83+ api . commands . addCommand ( { text : ( ) => "something" } , ( ) => { } ) ;
84+
5185GL . stores . phaser ; // $ExpectType Phaser
5286window . stores . phaser ; // $ExpectType Phaser
5387let worldManagerInstance ! : Gimloader . Stores . WorldManager ;
0 commit comments