idlize

Форк
0
/
PeerGeneratorConfig.ts 
57 строк · 2.1 Кб
1
/*
2
 * Copyright (c) 2024 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

16
export class PeerGeneratorConfig {
17
    public static commonMethod = ["CommonMethod"]
18

19
    public static ignoreSerialization = ["Array", "Callback", "ErrorCallback", "Length", "AttributeModifier"]
20
    public static ignorePeerMethod = ["attributeModifier"]
21

22
    private static knownParametrized = ["Indicator", "AttributeModifier", "AnimationRange"]
23

24
    public static exports = [
25
        { file: "common", components: ["Common", "ScrollableCommon", "CommonShape"]},
26
        { file: "shape", components: ["Shape"] },
27
        { file: "security_component", components: ["SecurityComponent"] },
28
        { file: "column", components: ["Column"] },
29
        { file: "image", components: ["Image"] },
30
        { file: "span", components: ["BaseSpan"] },
31
    ]
32

33
    public static invalidAttributes = ["ArkScrollableCommon"]
34

35
    public static readonly rootComponents = [
36
        "CommonMethod",
37
        "SecurityComponentMethod"
38
    ]
39

40
    // Will figure out what to do with those later, currently will extend PeerNode
41
    public static readonly standaloneComponents = [
42
        "CalendarAttribute",
43
        "ContainerSpanAttribute"
44
    ]
45

46
    public static skipPeerGeneration = ["CommonAttribute"]
47

48
    static mapComponentName(originalName: string): string {
49
        if (originalName.endsWith("Attribute"))
50
            return originalName.substring(0, originalName.length - 9)
51
        return originalName
52
    }
53

54
    static isKnownParametrized(name: string | undefined) : boolean {
55
        return name != undefined && PeerGeneratorConfig.knownParametrized.includes(name)
56
    }
57
}
58

59

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.