diff --git a/api/phone/@internal/document.d.ts b/api/phone/@internal/document.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..b3766e0e1adbc251cbe911830923f86e12d8ff9d --- /dev/null +++ b/api/phone/@internal/document.d.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export declare class document { + /** + * create Element. + * @param tagName is tagName. + */ + static createElement(tagName: string): DynamicElement; + +} + +export interface DynamicElement { + + /** + * setAttr to Element. + * @param eg{"src":"common/images/bg-tv.jpg"}. + */ + setAttr(attrParmas: object): void; + + /** + * setStyle to Element. + * @param eg{"width":"300px","height":"300px"} + */ + setStyle(styleParmas: object): void; + + /** + * append child to element(div) + * @param child element + */ + appendChildren(child: DynamicElement): void; + +} + diff --git a/api/phone/@internal/index.d.ts b/api/phone/@internal/index.d.ts index 8712a2be0c6d8bd7db0dfa187cd0f1cfc2af817c..2752a2a8c3e92a3bf4ae7086670213a171b94147 100644 --- a/api/phone/@internal/index.d.ts +++ b/api/phone/@internal/index.d.ts @@ -16,4 +16,5 @@ export * from './viewmodel'; export * from './featureability'; export * from './console'; -export * from './global'; \ No newline at end of file +export * from './global'; +export * from './document'; \ No newline at end of file diff --git a/api/phone/@internal/viewmodel.d.ts b/api/phone/@internal/viewmodel.d.ts index cf357da91800da27d3e2315698d94920ba95773b..9a875a1cbe2414bd76e4f69f76a761c765c84b17 100644 --- a/api/phone/@internal/viewmodel.d.ts +++ b/api/phone/@internal/viewmodel.d.ts @@ -2026,6 +2026,11 @@ export interface DivElement extends Element { * Returns the offset of the current scrolling. The return value type is Object. */ getScrollOffset(): ScrollOffset; + + /** + * append a child, support dynamic add element. + */ + appendChildren(param: { child: object }): void; } export interface Application {