Interface ScreenOrientation
angle: number;
onchange: ((this: ScreenOrientation, ev: Event) => any) | null;
type: OrientationType;
addEventListener<K extends "change">(
type: K,
listener: (
this: ScreenOrientation,
ev: ScreenOrientationEventMap[K],
) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;
dispatchEvent(event: Event): boolean;
removeEventListener<K extends "change">(
type: K,
listener: (
this: ScreenOrientation,
ev: ScreenOrientationEventMap[K],
) => any,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;
unlock(): void;
}
Hierarchy
- EventTarget
- ScreenOrientation
Index
Properties
Methods
Properties
Readonlyangle
The angle read-only property of the angle.
onchange
Readonlytype
The type read-only property of the type, one of portrait-primary, portrait-secondary, landscape-primary, or landscape-secondary.
Methods
addEventListener
- addEventListener<K extends "change">(
type: K,
listener: (
this: ScreenOrientation,
ev: ScreenOrientationEventMap[K],
) => any,
options?: boolean | AddEventListenerOptions,
): voidThe
addEventListener()method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.Type Parameters
- K extends "change"
Parameters
- type: K
- listener: (this: ScreenOrientation, ev: ScreenOrientationEventMap[K]) => any
Optionaloptions: boolean | AddEventListenerOptions
Returns void
- addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): voidThe
addEventListener()method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optionaloptions: boolean | AddEventListenerOptions
Returns void
dispatchEvent
The
dispatchEvent()method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.Parameters
- event: Event
Returns boolean
removeEventListener
- removeEventListener<K extends "change">(
type: K,
listener: (
this: ScreenOrientation,
ev: ScreenOrientationEventMap[K],
) => any,
options?: boolean | EventListenerOptions,
): voidThe
removeEventListener()method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.Type Parameters
- K extends "change"
Parameters
- type: K
- listener: (this: ScreenOrientation, ev: ScreenOrientationEventMap[K]) => any
Optionaloptions: boolean | EventListenerOptions
Returns void
- removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): voidThe
removeEventListener()method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optionaloptions: boolean | EventListenerOptions
Returns void
unlock
The
unlock()method of the document from its default orientation.Returns void
The
ScreenOrientationinterface of the Screen Orientation API provides information about the current orientation of the document.MDN Reference