File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ export type Scrapbox =
2323 } ,
2424 ) => void ;
2525 } ;
26+ PageMenu : ( ( name : string ) => PageMenu ) & {
27+ addMenu : (
28+ props : { title : string ; image : string ; onClick ?: ( ) => void } ,
29+ ) => void ;
30+ addItem : ( props : AddItemProps ) => void ;
31+ addSeparator : ( ) => void ;
32+ removeAllItems : ( ) => void ;
33+ } ;
2634 addListener : ( type : string , listener : ( ) => void ) => void ;
2735 on : ( type : string , listener : ( ) => void ) => void ;
2836 removeListener : ( type : string , listener : ( ) => void ) => void ;
@@ -91,6 +99,30 @@ type TimeStamp = {
9199 removeAllFormat : ( ) => void ;
92100} ;
93101
102+ type AddItemProps = {
103+ title : string | ( ( ) => string ) ;
104+ image ?: string ;
105+ onClick : ( ) => void ;
106+ } ;
107+ type PageMenu = {
108+ addItem : (
109+ props : AddItemProps ,
110+ ) => void ;
111+ addSeparator : ( ) => void ;
112+ removeAllItems : ( ) => void ;
113+ menuName : string ;
114+ reset : ( ) => void ;
115+ emitChange : ( ) => void ;
116+ menus : Map <
117+ string ,
118+ {
119+ image : string | null ;
120+ onClick ?: ( ) => void ;
121+ items : ( AddItemProps & { separator : boolean } ) [ ] ;
122+ }
123+ > ;
124+ } ;
125+
94126export type eventName =
95127 | "lines:changed"
96128 | "page:changed"
You can’t perform that action at this time.
0 commit comments