Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
PPpro committed Aug 7, 2023
1 parent a288e5a commit ad8f459
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cocos/core/platform/screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { IScreenOptions, screenAdapter } from 'pal/screen-adapter';
import { legacyCC } from '../global-exports';
import { Size } from '../math';
import { Settings, settings } from '../settings';
import { error, warnID } from './debug';
import { error, warn, warnID } from './debug';
import { PalScreenEvent } from '../../../pal/screen-adapter/enum-type';
/**
* @en The screen API provides an easy way to do some screen managing stuff.
Expand Down Expand Up @@ -180,7 +180,7 @@ export class Screen {
* @deprecated since v3.3, please use screen.requestFullScreen() instead.
*/
public autoFullScreen (element: HTMLElement, onFullScreenChange: (this: Document, ev: any) => any): void {
this.requestFullScreen(element, onFullScreenChange)?.catch((e): void => {});
this.requestFullScreen(element, onFullScreenChange)?.catch((e): void => { warn(e); });
}

/**
Expand All @@ -198,7 +198,7 @@ export class Screen {
* @zh
* 注册screen事件回调。
*/
public on (type: PalScreenEvent, callback: any, target?: any): void {
public on (type: PalScreenEvent, callback: (...args: any) => void, target?: any): void {
screenAdapter.on(type, callback, target);
}

Expand All @@ -208,7 +208,7 @@ export class Screen {
* @zh
* 注册单次的screen事件回调。
*/
public once (type: PalScreenEvent, callback?: any, target?: any): void {
public once (type: PalScreenEvent, callback: (...args: any) => void, target?: any): void {
screenAdapter.once(type, callback, target);
}

Expand All @@ -218,7 +218,7 @@ export class Screen {
* @zh
* 取消注册screen事件回调。
*/
public off (type: PalScreenEvent, callback?: any, target?: any): void {
public off (type: PalScreenEvent, callback?: (...args: any) => void, target?: any): void {
screenAdapter.off(type, callback, target);
}
}
Expand Down

0 comments on commit ad8f459

Please sign in to comment.