@@ -171,11 +171,11 @@ declare function GM_xmlhttpRequest(details: GMTypes.XHRDetails): GMTypes.AbortHa
171171declare function GM_download(details: GMTypes.DownloadDetails<string | Blob | File >): GMTypes.AbortHandle<boolean >;
172172declare function GM_download(url: string, filename: string): GMTypes.AbortHandle<boolean >;
173173
174- declare function GM_getTab(callback: (obj : object) => void): void;
174+ declare function GM_getTab(callback: (tab : object) => void): void;
175175
176- declare function GM_saveTab(obj : object): Promise<void >;
176+ declare function GM_saveTab(tab : object): Promise<void >;
177177
178- declare function GM_getTabs(callback: (objs : { [key: number]: object } ) => void): void;
178+ declare function GM_getTabs(callback: (tabs : { [key: number]: object } ) => void): void;
179179
180180declare function GM_notification(details: GMTypes.NotificationDetails, ondone?: GMTypes.NotificationOnDone): void;
181181declare function GM_notification(
@@ -191,8 +191,12 @@ declare function GM_updateNotification(id: string, details: GMTypes.Notification
191191
192192declare function GM_setClipboard(data: string, info?: string | { type?: string; mimetype?: string } ): void;
193193
194- declare function GM_addElement(tag: string, attributes: any): HTMLElement;
195- declare function GM_addElement(parentNode: Element, tag: string, attrs: any): HTMLElement;
194+ declare function GM_addElement(tag: string, attributes: Record<string , string | number | boolean >): HTMLElement;
195+ declare function GM_addElement(
196+ parentNode: Node,
197+ tag: string,
198+ attrs: Record<string , string | number | boolean >
199+ ): HTMLElement;
196200
197201declare function GM_addStyle(css: string): HTMLStyleElement;
198202
@@ -266,7 +270,7 @@ declare const GM: {
266270 unregisterMenuCommand(id: number | string): Promise<void >;
267271
268272 /** 样式注入 */
269- addStyle(css: string): Promise<void >;
273+ addStyle(css: string): Promise<HTMLStyleElement >;
270274
271275 /** 通知 */
272276 notification(details: GMTypes.NotificationDetails, ondone?: GMTypes.NotificationOnDone): Promise<void >;
@@ -278,8 +282,8 @@ declare const GM: {
278282 setClipboard(data: string, info?: string | { type?: string; mimetype?: string } ): Promise<void >;
279283
280284 /** 添加元素 */
281- addElement(tag: string, attributes: any ): Promise<HTMLElement >;
282- addElement(parentNode: Element , tag: string, attrs: any ): Promise<HTMLElement >;
285+ addElement(tag: string, attributes: Record< string , string | number | boolean > ): Promise<HTMLElement >;
286+ addElement(parentNode: Node , tag: string, attrs: Record< string , string | number | boolean > ): Promise<HTMLElement >;
283287
284288 /** XMLHttpRequest */
285289 xmlHttpRequest(details: GMTypes.XHRDetails): Promise<GMTypes .XHRResponse >;
@@ -290,7 +294,7 @@ declare const GM: {
290294
291295 /** Tab 存储 */
292296 getTab(): Promise<object >;
293- saveTab(obj : object): Promise<void >;
297+ saveTab(tab : object): Promise<void >;
294298 getTabs(): Promise<{ [key: number]: object } >;
295299
296300 /** 打开新标签页 */
0 commit comments