idlize

Форк
0
46 строк · 2.7 Кб
1
import { AppStorage, ArkPageTransitionEnterComponent, ArkPageTransitionExitComponent, ArkStructBase, ArkText, CanvasRenderingContext2D, ESObject, ForEach, GestureGroup, IDataSource, ImageBitmap, Indicator, LazyForEach, LinearGradient, LocalStorage, LongPressGesture, MutableState, OffscreenCanvasRenderingContext2D, PanGesture, PanGestureOptions, PatternLockController, PinchGesture, RenderingContextSettings, RichEditorController, Scroller, SearchController, StorageLinkState, SwiperController, TabsController, TapGesture, TextAreaController, TextClockController, TextInputController, TextInputOptions, TextTimerController, TransitionEffect, VideoController, WebController, XComponentController, animateTo, observableProxy } from "@koalaui/arkoala-arkui";
2
import { registerArkuiEntry } from "@koalaui/arkoala-arkui/ohos.router";
3
/*
4
 * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
export const storage = new LocalStorage();
18
class ArkLocalStorageLinkExampleComponent extends ArkStructBase<ArkLocalStorageLinkExampleComponent> {
19
    private _entry_local_storage_ = storage;
20
    __initializeStruct(/**/
21
    /** @memo */
22
    content?: () => void, initializers?: Partial<ArkLocalStorageLinkExampleComponent>): void {
23
        this._link = StorageLinkState<string>(this._entry_local_storage_, "storage", "Start");
24
    }
25
    _link!: MutableState<string>;
26
    get link(): string {
27
        return this._link!.value;
28
    }
29
    set link(value: string) {
30
        this._link!.value = observableProxy(value);
31
    }
32
    /** @memo */
33
    _build(/**/
34
    /** @memo */
35
    builder: ((instance: ArkLocalStorageLinkExampleComponent) => void) | undefined) {
36
        ArkText(undefined, undefined, "LocalStorage entry = " + storage.get("storage"));
37
    }
38
}
39
/** @memo */
40
export function LocalStorageLinkExample(style?: any, /**/
41
/** @memo */
42
content?: () => void, initializers?: Partial<ArkLocalStorageLinkExampleComponent>): ArkLocalStorageLinkExampleComponent {
43
    return ArkLocalStorageLinkExampleComponent._instantiate(style, () => new ArkLocalStorageLinkExampleComponent, content, initializers);
44
}
45
registerArkuiEntry(LocalStorageLinkExample, "Rewrite2");
46
export const __Entry = LocalStorageLinkExample;
47

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

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

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

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