idlize
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
16export class PeerGeneratorConfig {
17public static commonMethod = ["CommonMethod"]
18
19public static ignoreSerialization = ["Array", "Callback", "ErrorCallback", "Length", "AttributeModifier"]
20public static ignorePeerMethod = ["attributeModifier"]
21
22private static knownParametrized = ["Indicator", "AttributeModifier", "AnimationRange"]
23
24public 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
33public static invalidAttributes = ["ArkScrollableCommon"]
34
35public static readonly rootComponents = [
36"CommonMethod",
37"SecurityComponentMethod"
38]
39
40// Will figure out what to do with those later, currently will extend PeerNode
41public static readonly standaloneComponents = [
42"CalendarAttribute",
43"ContainerSpanAttribute"
44]
45
46public static skipPeerGeneration = ["CommonAttribute"]
47
48static mapComponentName(originalName: string): string {
49if (originalName.endsWith("Attribute"))
50return originalName.substring(0, originalName.length - 9)
51return originalName
52}
53
54static isKnownParametrized(name: string | undefined) : boolean {
55return name != undefined && PeerGeneratorConfig.knownParametrized.includes(name)
56}
57}
58
59