chromium/third_party/blink/renderer/modules/screen_orientation/screen_orientation.idl

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://w3c.github.io/screen-orientation/#screenorientation-interface

enum OrientationLockType {
    "any",
    "natural",
    "landscape",
    "portrait",
    "portrait-primary",
    "portrait-secondary",
    "landscape-primary",
    "landscape-secondary"
};

enum OrientationType {
    "portrait-primary",
    "portrait-secondary",
    "landscape-primary",
    "landscape-secondary"
};

[Exposed=Window]
interface ScreenOrientation : EventTarget {
    [HighEntropy=Direct, MeasureAs=ScreenOrientationAngle] readonly attribute unsigned short angle;
    [HighEntropy=Direct, MeasureAs=ScreenOrientationType] readonly attribute DOMString type;

    [CallWith=ScriptState, MeasureAs=ScreenOrientationLock, RaisesException] Promise<undefined> lock(OrientationLockType orientation);
    [MeasureAs=ScreenOrientationUnlock] void unlock();

    attribute EventHandler onchange;
};