/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import d from 'assert';
enum A1 {
    prop1 = 1,
    prop2 = 2
}
d(A1.prop1 === 1);
d(A1.prop2 === 2);
enum e {
    up = 1,
    down,
    left,
    right
}
const f: e = e.up;
d(f === 1);
d(e.up === 1);
d(e.down === 2);
d(e.left === 3);
d(e.right === 4);
d(e[1] === 'up');
d(e[3] === 'left');
d(e[4] === 'right');
var g;
(function (p) {
    p[p["prop1"] = 1] = "prop1";
    p[p["prop2"] = 2] = "prop2";
})(g || (g = {}));
d(g.prop1 === 1);
d(g.prop2 === 2);
d(g[1] === 'prop1');
d(g[2] === 'prop2');
let h = 1;
enum i {
    prop1 = 1,
    prop2 = prop1 + h + 1
}
d(i.prop1 === 1);
d(i.prop2 === 3);
d(i[1] === 'prop1');
enum j {
    a = 2,
    b = 3
}
d(j.a === 2);
d(j.b === 3);
d(j[2] === 'a');
d(j[3] === 'b');
enum k {
    a = (1).valueOf(),
    b = j.a,
    c = j.b.valueOf()
}
d(k.a === 1);
d(k.b === 2);
d(k.c === 3);
d(k[1] === 'a');
d(k[2] === 'b');
d(k[3] === 'c');
module l {
    export namespace N {
        export enum E1 {
            a = 1
        }
    }
}
d(l.N.E1.a === 1);
d(l.N.E1[1] === 'a');
module l {
    export namespace N {
        export enum E1 {
            b = l.N.E1.a + 1
        }
    }
}
d(l.N.E1.b === 2);
d(l.N.E1[2] === 'b');
export enum m {
    LEFT_BUTTON = 1,
    RIGHT_BUTTON = 2,
    MIDDLE_BUTTON = 4,
    XBUTTON1_BUTTON = 5,
    XBUTTON2_BUTTON = 6,
    NO_BUTTON = 0
}
export const n = {
    '-1': m.NO_BUTTON,
    '0': m.LEFT_BUTTON,
    '1': m.MIDDLE_BUTTON,
    '2': m.RIGHT_BUTTON,
    '3': m.XBUTTON1_BUTTON,
    '4': m.XBUTTON2_BUTTON,
};
d(n['-1'] === 0);
d(n['0'] === 1);
d(n['1'] === 4);
d(n['2'] === 2);
d(n['3'] === 5);
d(n['4'] === 6);
export enum o {
    A = 1 << 1,
    B = 1 << 2
}
d(o.A === 2);
d(o.B === 4);
d(o[2] === 'A');
d(o[4] === 'B');
