• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16export class Model1 {
17  public message?: string | Resource | number = undefined //message是必填项
18  public duration?: string | Resource | number = undefined
19  public bottom?: string | Resource | number = undefined
20
21  constructor(message?: string | Resource, duration?: string | Resource, bottom?: string | Resource) {
22    this.message = message
23    this.duration = duration
24    this.bottom = bottom
25  }
26}
27
28//showDialog---title|message|buttons测试参数且无必填项
29export class Model2 {
30  public title?: string | Resource | number = undefined
31  public message?: string | Resource | number = undefined
32  public buttonText1?: string | Resource | number = undefined
33  public buttonColor1?: string | Resource | number = undefined
34  public buttonText2?: string | Resource = undefined
35  public buttonColor2?: string | Resource = undefined
36  public buttonText3?: string | Resource = undefined
37  public buttonColor3?: string | Resource = undefined
38
39  constructor(title?: string | Resource, message?: string | Resource, buttonText1?: string | Resource,
40    buttonColor1?: string | Resource, buttonText2?: string | Resource, buttonColor2?: string | Resource,
41    buttonText3?: string | Resource, buttonColor3?: string | Resource) {
42    this.title = title
43    this.message = message
44    this.buttonText1 = buttonText1
45    this.buttonColor1 = buttonColor1
46    this.buttonText2 = buttonText2
47    this.buttonColor2 = buttonColor2
48    this.buttonText3 = buttonText3
49    this.buttonColor3 = buttonColor3
50  }
51}
52
53//showActionMenu---title|buttons测试参数且buttons为必填项
54export class Model3 {
55  public title?: Resource | string | number = undefined
56  public buttonText?: string | Resource | number = undefined
57  public buttonColor?: string | Resource | number = undefined
58
59  constructor(title?: string | Resource, buttonText?: string | Resource, buttonColor?: string | Resource) {
60    this.title = title
61    this.buttonText = buttonText
62    this.buttonColor = buttonColor
63  }
64}
65
66export class TestListOption {
67  public title?: string = undefined
68  public url?: string = undefined
69  public key?: string = undefined
70}
71
72export class Stack<T> {
73  private items: T[];
74
75  constructor() {
76    this.items = [];
77  }
78
79  push(element: T) {
80    this.items.push(element);
81  }
82
83  pop(): T | undefined {
84    return this.items.pop();
85  }
86
87  top(): T | undefined {
88    return this.items[this.items.length - 1];
89  }
90
91  isEmpty(): boolean {
92    return this.items.length === 0;
93  }
94}
95
96export class SystemWindowOptions {
97  public decorVisible: boolean = true
98  public decorHeight: number = 48
99}
100