• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/**
17 * @file Defines WithTheme component.
18 * @kit ArkUI
19 */
20
21/*** if arkts 1.2 */
22import { CustomTheme } from '../../@ohos.arkui.theme';
23import { ThemeColorMode } from './common';
24/*** endif */
25
26/**
27 * CustomTheme.
28 *
29 * @typedef {import('../api/@ohos.arkui.theme').CustomTheme} CustomTheme
30 * @syscap SystemCapability.ArkUI.ArkUI.Full
31 * @crossplatform
32 * @atomicservice
33 * @since 12
34 */
35declare type CustomTheme = import('../api/@ohos.arkui.theme').CustomTheme;
36
37/**
38 * Defines the struct of WithThemeOptions.
39 *
40 * @interface WithThemeOptions
41 * @syscap SystemCapability.ArkUI.ArkUI.Full
42 * @crossplatform
43 * @atomicservice
44 * @since arkts {'1.1':'12','1.2':'20'}
45 * @arkts 1.1&1.2
46 */
47declare interface WithThemeOptions {
48    /**
49    * Custom Theme.
50    *
51    * @type { ?CustomTheme }
52    * @syscap SystemCapability.ArkUI.ArkUI.Full
53    * @crossplatform
54    * @atomicservice
55    * @since arkts {'1.1':'12','1.2':'20'}
56    * @arkts 1.1&1.2
57    */
58    theme?: CustomTheme;
59
60    /**
61    * Theme Color Mode.
62    *
63    * @type { ?ThemeColorMode }
64    * @syscap SystemCapability.ArkUI.ArkUI.Full
65    * @crossplatform
66    * @atomicservice
67    * @since arkts {'1.1':'12','1.2':'20'}
68    * @arkts 1.1&1.2
69    */
70    colorMode?: ThemeColorMode;
71}
72
73/**
74* Define the function of WithThemeInterface.
75*
76* @typedef { function } WithThemeInterface
77* @param { WithThemeOptions } options
78* @returns { WithThemeAttribute } withThemeAttribute object
79* @syscap SystemCapability.ArkUI.ArkUI.Full
80* @crossplatform
81* @atomicservice
82* @since 12
83*/
84declare type WithThemeInterface = (options: WithThemeOptions) => WithThemeAttribute;
85
86/**
87* Defines the WithTheme attribute functions..
88*
89* @syscap SystemCapability.ArkUI.ArkUI.Full
90* @crossplatform
91* @atomicservice
92* @since arkts {'1.1':'12','1.2':'20'}
93* @arkts 1.1&1.2
94*/
95declare class WithThemeAttribute {
96}
97
98/**
99* Defines WithTheme Logic Component.
100*
101* @syscap SystemCapability.ArkUI.ArkUI.Full
102* @crossplatform
103* @atomicservice
104* @since 12
105*/
106declare const WithTheme: WithThemeInterface;
107
108/**
109* Defines WithTheme Logic Component Instance.
110*
111* @syscap SystemCapability.ArkUI.ArkUI.Full
112* @crossplatform
113* @atomicservice
114* @since 12
115*/
116declare const WithThemeInstance: WithThemeAttribute;