@@ -97,21 +97,44 @@ declare function GM_getResourceText(name: string): string | undefined;
9797
9898declare function GM_getResourceURL(name: string, isBlobUrl?: boolean): string | undefined;
9999
100- declare function GM_registerMenuCommand(
100+ function GM_registerMenuCommand(
101101 name: string,
102- listener: () => void,
102+ listener: (inputValue?: any ) => void,
103103 optionsOrAccessKey?:
104- | string
105104 | {
106- id?: number | string;
107- accessKey?: string;
105+ id?: number;
108106 autoClose?: boolean;
109107 title?: string;
108+ accessKey?: string;
110109 }
110+ | string
111111): number;
112112
113113declare function GM_unregisterMenuCommand(id: number): void;
114114
115+ /**
116+ * 注册一个菜单输入框, 允许用户输入值, 并在输入完成后用回调函数
117+ */
118+ declare function CAT_registerMenuInput(
119+ name: string,
120+ listener: (inputValue?: any) => void,
121+ optionsOrAccessKey?:
122+ | {
123+ id?: number;
124+ autoClose?: boolean;
125+ title?: string;
126+ accessKey?: string;
127+ // 可选输入框
128+ inputType?: " text" | " number" | " boolean" ;
129+ inputLabel?: string;
130+ inputDefaultValue?: string | number | boolean;
131+ inputPlaceholder?: string;
132+ }
133+ | string
134+ ): number;
135+
136+ declare const CAT_unregisterMenuInput: typeof GM_unregisterMenuCommand;
137+
115138declare function GM_openInTab(url: string, options: GMTypes.OpenTabOptions): tab;
116139declare function GM_openInTab(url: string, loadInBackground: boolean): tab;
117140declare function GM_openInTab(url: string): tab;
@@ -294,6 +317,10 @@ declare namespace GMTypes {
294317 [key: string]: string | boolean | number | undefined;
295318 } ;
296319
320+ interface CookieDetailsPartitionKeyType {
321+ topLevelSite?: string;
322+ }
323+
297324 interface CookieDetails {
298325 url?: string;
299326 name?: string;
@@ -304,6 +331,7 @@ declare namespace GMTypes {
304331 session?: boolean;
305332 httpOnly?: boolean;
306333 expirationDate?: number;
334+ partitionKey?: CookieDetailsPartitionKeyType;
307335 }
308336
309337 interface Cookie {
0 commit comments