nwo
stringclasses 304
values | sha
stringclasses 304
values | path
stringlengths 9
214
| language
stringclasses 1
value | identifier
stringlengths 0
49
| docstring
stringlengths 1
34.2k
| function
stringlengths 8
59.4k
| ast_function
stringlengths 71
497k
| obf_function
stringlengths 8
39.4k
| url
stringlengths 102
324
| function_sha
stringlengths 40
40
| source
stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
openharmony/arkui_ace_engine
|
30c7d1ee12fbedf0fabece54291d75897e2ad44f
|
interfaces/ets/ani/animator/ets/arkui.component.common.ets
|
arkts
|
Copyright (c) 2025 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 interface ExpectedFrameRateRange {
min: number,
max: number,
expected: number,
}
|
AST#export_declaration#Left export AST#interface_declaration#Left interface ExpectedFrameRateRange AST#object_type#Left { AST#type_member#Left min : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , AST#type_member#Left max : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , AST#type_member#Left expected : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
|
export interface ExpectedFrameRateRange {
min: number,
max: number,
expected: number,
}
|
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/interfaces/ets/ani/animator/ets/arkui.component.common.ets#L16-L23
|
040c585084fe276b8c828c01791571f06444c590
|
gitee
|
|
openharmony-tpc/ohos_mpchart
|
4fb43a7137320ef2fee2634598f53d93975dfb4a
|
library/src/main/ets/components/data/Paint.ets
|
arkts
|
画笔属性类,用于绘制时使用画笔属性
@param value
|
export default class Paint {
styleType: Style = Style.FILL_AND_STROKE;
globalAlpha: number | undefined = undefined;
globalCompositeOperation: string = 'source-over'
fillStyle: string | number | CanvasGradient | CanvasPattern = Color.White;
strokeStyle: string | number | CanvasGradient | CanvasPattern = Color.Black;
imageSmoothingEnabled: boolean = true;
imageSmoothingQuality: ImageSmoothingQuality = 'low';
lineCap: CanvasLineCap = 'butt'
lineDashOffset: number = 0.0;
lineJoin: CanvasLineJoin = 'miter'
lineWidth: number = 1;
miterLimit: number = 10;
shadowBlur: number = 0.0;
shadowColor: string = '#00000000';
shadowOffsetX: number = 0;
shadowOffsetY: number = 0;
direction: CanvasDirection = 'inherit';
fontStyle: FontStyleType = 'normal';
fontWeight: FontWeightType = 'normal';
fontSize: number = 14;
fontSizeUnit: FontSizeUnit = 'vp';
fontFamily: FontFamily = '';
font: string = 'normal normal 14vp '
textAlign: CanvasTextAlign = 'left';
textBaseline: CanvasTextBaseline = 'alphabetic';
lineDash: number[] = [];
dashPathEffect: DashPathEffect | null = null;
constructor(paint?: Paint) {
if (paint != null && paint != undefined) {
this.set(paint);
}
}
public set(paint: Paint) {
this.styleType = paint.styleType;
this.globalAlpha = paint.globalAlpha
this.globalCompositeOperation = paint.globalCompositeOperation;
this.fillStyle = paint.fillStyle;
this.strokeStyle = paint.strokeStyle;
this.imageSmoothingEnabled = paint.imageSmoothingEnabled;
this.imageSmoothingQuality = paint.imageSmoothingQuality;
this.lineCap = paint.lineCap;
this.lineDashOffset = paint.lineDashOffset;
this.lineJoin = paint.lineJoin;
this.lineWidth = paint.lineWidth;
this.miterLimit = paint.miterLimit;
this.shadowBlur = paint.shadowBlur;
this.shadowColor = paint.shadowColor;
this.shadowOffsetX = paint.shadowOffsetX;
this.shadowOffsetY = paint.shadowOffsetY;
this.direction = paint.direction;
this.fontStyle = paint.fontStyle;
this.fontWeight = paint.fontWeight;
this.fontSize = paint.fontSize;
this.fontSizeUnit = paint.fontSizeUnit;
this.fontFamily = paint.fontFamily;
this.font = paint.font;
this.textAlign = paint.textAlign;
this.textBaseline = paint.textBaseline;
this.lineDash = paint.lineDash;
this.dashPathEffect = paint.dashPathEffect;
}
public setColor(color: string | number | CanvasGradient | CanvasPattern) {
this.fillStyle = color;
this.strokeStyle = color;
}
public getColor(): string | number | CanvasGradient | CanvasPattern {
return this.fillStyle;
}
public setStyle(styleType: Style) {
this.styleType = styleType;
}
public getStyle(): Style {
return this.styleType;
}
public setGlobalAlpha(alpha: number) {
this.globalAlpha = alpha;
}
public getGlobalAlpha() {
return this.globalAlpha;
}
public setGlobalCompositeOperation(composite: string) {
this.globalCompositeOperation = composite;
}
public getGlobalCompositeOperation() {
return this.globalCompositeOperation;
}
public setFillStyle(fillStyle: string | number | CanvasGradient | CanvasPattern) {
this.fillStyle = fillStyle;
}
public getFillStyle(): string | number | CanvasGradient | CanvasPattern {
return this.fillStyle;
}
public setStrokeStyle(strokeStyle: string | number | CanvasGradient | CanvasPattern) {
this.strokeStyle = strokeStyle;
}
public getStrokeStyle(): string | number | CanvasGradient | CanvasPattern {
return this.fillStyle;
}
public setImageSmoothingEnabled(enable: boolean) {
this.imageSmoothingEnabled = enable;
}
public getImageSmoothingEnabled(): boolean {
return this.imageSmoothingEnabled;
}
public setImageSmoothingQuality(quality: ImageSmoothingQuality) {
this.imageSmoothingQuality = quality;
}
public getImageSmoothingQuality(): ImageSmoothingQuality {
return this.imageSmoothingQuality;
}
public setLineCap(lineCap: CanvasLineCap) {
this.lineCap = lineCap;
}
public getLineCap(): CanvasLineCap {
return this.lineCap;
}
public setLineDashOffset(offset: number) {
this.lineDashOffset = offset;
}
public getLineDashOffset(): number {
return this.lineDashOffset;
}
public setLineJoin(lineJoin: CanvasLineJoin) {
this.lineJoin = lineJoin;
}
public getLineJoin(): CanvasLineJoin {
return this.lineJoin;
}
public setStrokeWidth(lineWidth: number) {
this.lineWidth = lineWidth;
}
public getStrokeWidth(): number {
return this.lineWidth;
}
public setMiterLimit(miterLimit: number) {
this.miterLimit = miterLimit;
}
public getMiterLimit(): number {
return this.miterLimit;
}
public setShadowBlur(shadowBlur: number) {
this.shadowBlur = shadowBlur;
}
public getShadowBlur(): number {
return this.miterLimit;
}
public setShadowColor(shadowColor: string) {
this.shadowColor = shadowColor;
}
public getShadowColor(): string {
return this.shadowColor;
}
public setShadowOffsetX(shadowOffsetX: number) {
this.shadowOffsetX = shadowOffsetX;
}
public getShadowOffsetX(): number {
return this.shadowOffsetX;
}
public setShadowOffsetY(shadowOffsetY: number) {
this.shadowOffsetY = shadowOffsetY;
}
public getShadowOffsetY(): number {
return this.shadowOffsetY;
}
public setDirection(direction: CanvasDirection) {
this.direction = direction;
}
public getDirection(): CanvasDirection {
return this.direction;
}
public setTextSize(textSize: number, textSizeUnit?: FontSizeUnit): void {
this.fontSize = textSize;
if (textSizeUnit) {
this.fontSizeUnit = textSizeUnit;
}
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getTextSize(): number {
return this.fontSize;
}
public setFontStyle(fontStyle: FontStyleType): void {
this.fontStyle = fontStyle;
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getFontStyle(): FontStyleType {
return this.fontStyle;
}
public setFontWeight(fontWeight: FontWeightType): void {
this.fontWeight = fontWeight;
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getFontWeight(): FontWeightType {
return this.fontWeight;
}
public setFontFamily(fontFamily: FontFamily): void {
this.fontFamily = fontFamily;
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getFontFamily(): FontFamily {
return this.fontFamily;
}
public setFont(fontStyle?: FontStyleType, fontWeight?: FontWeightType, fontSize?: number, fontSizeUnit?: FontSizeUnit, fontFamily?: FontFamily) {
if (!fontStyle) {
this.fontStyle = 'normal';
}
if (!fontWeight) {
this.fontWeight = 'normal'
}
if (!fontSize) {
this.fontSize = 14;
}
if (!fontSizeUnit) {
this.fontSizeUnit = 'px';
}
if (!fontFamily) {
this.fontFamily = '';
}
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getFont(): string {
return this.font;
}
public setTextAlign(textAlign: CanvasTextAlign) {
this.textAlign = textAlign;
}
public getTextAlign(): CanvasTextAlign {
return this.textAlign;
}
public setTextBaseline(textBaseline: CanvasTextBaseline) {
this.textBaseline = textBaseline;
}
public getTextBaseline(): CanvasTextBaseline {
return this.textBaseline;
}
public setLineDash(lineDash: number[]) {
this.lineDash = lineDash;
}
public getLineDash(): number[] {
return this.lineDash;
}
public setDashPathEffect(dashEffect: DashPathEffect | null) {
this.dashPathEffect = dashEffect;
}
public getDashPathEffect(): DashPathEffect | null {
return this.dashPathEffect;
}
}
|
AST#export_declaration#Left export default AST#class_declaration#Left class Paint AST#class_body#Left { AST#property_declaration#Left styleType : AST#type_annotation#Left AST#primary_type#Left Style AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left Style AST#expression#Right . FILL_AND_STROKE AST#member_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left globalAlpha : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left undefined AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left globalCompositeOperation : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 'source-over' AST#expression#Right AST#ERROR#Left fillStyle : string AST#ERROR#Right | AST#expression#Left number AST#expression#Right AST#binary_expression#Right AST#expression#Right | AST#expression#Left CanvasGradient AST#expression#Right AST#binary_expression#Right AST#expression#Right | AST#expression#Left AST#assignment_expression#Left CanvasPattern = AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left strokeStyle : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left CanvasGradient AST#primary_type#Right | AST#primary_type#Left CanvasPattern AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Black AST#member_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left imageSmoothingEnabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left imageSmoothingQuality : AST#type_annotation#Left AST#primary_type#Left ImageSmoothingQuality AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'low' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left lineCap : AST#type_annotation#Left AST#primary_type#Left CanvasLineCap AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left 'butt' AST#expression#Right AST#ERROR#Left l AST#ERROR#Right in AST#expression#Left AST#assignment_expression#Left eDashOffset AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right = AST#expression#Left 0.0 AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left lineJoin : AST#type_annotation#Left AST#primary_type#Left CanvasLineJoin AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left 'miter' AST#expression#Right AST#ERROR#Left l AST#ERROR#Right in AST#expression#Left AST#assignment_expression#Left eWidth AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right = AST#expression#Left 1 AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left miterLimit : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 10 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left shadowBlur : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left shadowColor : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#00000000' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left shadowOffsetX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left shadowOffsetY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left direction : AST#type_annotation#Left AST#primary_type#Left CanvasDirection AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'inherit' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left fontStyle : AST#type_annotation#Left AST#primary_type#Left FontStyleType AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'normal' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left fontWeight : AST#type_annotation#Left AST#primary_type#Left FontWeightType AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'normal' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left fontSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 14 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left fontSizeUnit : AST#type_annotation#Left AST#primary_type#Left FontSizeUnit AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'vp' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left fontFamily : AST#type_annotation#Left AST#primary_type#Left FontFamily AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left font AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'normal normal 14vp ' AST#expression#Right textAlign AST#ERROR#Right : AST#type_annotation#Left AST#primary_type#Left CanvasTextAlign AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'left' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left textBaseline : AST#type_annotation#Left AST#primary_type#Left CanvasTextBaseline AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'alphabetic' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left lineDash : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left dashPathEffect : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left DashPathEffect AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left paint ? : AST#type_annotation#Left AST#primary_type#Left Paint AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left paint AST#expression#Right != AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left paint AST#expression#Right != AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left paint AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right AST#method_declaration#Left public set AST#parameter_list#Left ( AST#parameter#Left paint : AST#type_annotation#Left AST#primary_type#Left Paint AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . styleType AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . styleType AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . globalAlpha AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . globalAlpha AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . globalCompositeOperation AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . globalCompositeOperation AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillStyle AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . fillStyle AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . strokeStyle AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . strokeStyle AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . imageSmoothingEnabled AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . imageSmoothingEnabled AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . imageSmoothingQuality AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . imageSmoothingQuality AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineCap AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . lineCap AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineDashOffset AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . lineDashOffset AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineJoin AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . lineJoin AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineWidth AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . lineWidth AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . miterLimit AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . miterLimit AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowBlur AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . shadowBlur AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowColor AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . shadowColor AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowOffsetX AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . shadowOffsetX AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowOffsetY AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . shadowOffsetY AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . direction AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . direction AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . fontStyle AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontWeight AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . fontWeight AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontSize AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . fontSize AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontSizeUnit AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . fontSizeUnit AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontFamily AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . fontFamily AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . font AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . font AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textAlign AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . textAlign AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textBaseline AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . textBaseline AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineDash AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . lineDash AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dashPathEffect AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left paint AST#expression#Right . dashPathEffect AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public setColor AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left CanvasGradient AST#primary_type#Right | AST#primary_type#Left CanvasPattern AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillStyle AST#member_expression#Right = AST#expression#Left color AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . strokeStyle AST#member_expression#Right = AST#expression#Left color AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getColor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left CanvasGradient AST#primary_type#Right | AST#primary_type#Left CanvasPattern AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillStyle AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setStyle AST#parameter_list#Left ( AST#parameter#Left styleType : AST#type_annotation#Left AST#primary_type#Left Style AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . styleType AST#member_expression#Right = AST#expression#Left styleType AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getStyle AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Style AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . styleType AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setGlobalAlpha AST#parameter_list#Left ( AST#parameter#Left alpha : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . globalAlpha AST#member_expression#Right = AST#expression#Left alpha AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getGlobalAlpha AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . globalAlpha AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setGlobalCompositeOperation AST#parameter_list#Left ( AST#parameter#Left composite : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . globalCompositeOperation AST#member_expression#Right = AST#expression#Left composite AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getGlobalCompositeOperation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . globalCompositeOperation AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setFillStyle AST#parameter_list#Left ( AST#parameter#Left fillStyle : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left CanvasGradient AST#primary_type#Right | AST#primary_type#Left CanvasPattern AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillStyle AST#member_expression#Right = AST#expression#Left fillStyle AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getFillStyle AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left CanvasGradient AST#primary_type#Right | AST#primary_type#Left CanvasPattern AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillStyle AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setStrokeStyle AST#parameter_list#Left ( AST#parameter#Left strokeStyle : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left CanvasGradient AST#primary_type#Right | AST#primary_type#Left CanvasPattern AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . strokeStyle AST#member_expression#Right = AST#expression#Left strokeStyle AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getStrokeStyle AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left CanvasGradient AST#primary_type#Right | AST#primary_type#Left CanvasPattern AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillStyle AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setImageSmoothingEnabled AST#parameter_list#Left ( AST#parameter#Left enable : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . imageSmoothingEnabled AST#member_expression#Right = AST#expression#Left enable AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getImageSmoothingEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . imageSmoothingEnabled AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setImageSmoothingQuality AST#parameter_list#Left ( AST#parameter#Left quality : AST#type_annotation#Left AST#primary_type#Left ImageSmoothingQuality AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . imageSmoothingQuality AST#member_expression#Right = AST#expression#Left quality AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getImageSmoothingQuality AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ImageSmoothingQuality AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . imageSmoothingQuality AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setLineCap AST#parameter_list#Left ( AST#parameter#Left lineCap : AST#type_annotation#Left AST#primary_type#Left CanvasLineCap AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineCap AST#member_expression#Right = AST#expression#Left lineCap AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getLineCap AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CanvasLineCap AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineCap AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setLineDashOffset AST#parameter_list#Left ( AST#parameter#Left offset : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineDashOffset AST#member_expression#Right = AST#expression#Left offset AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getLineDashOffset AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineDashOffset AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setLineJoin AST#parameter_list#Left ( AST#parameter#Left lineJoin : AST#type_annotation#Left AST#primary_type#Left CanvasLineJoin AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineJoin AST#member_expression#Right = AST#expression#Left lineJoin AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getLineJoin AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CanvasLineJoin AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineJoin AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setStrokeWidth AST#parameter_list#Left ( AST#parameter#Left lineWidth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineWidth AST#member_expression#Right = AST#expression#Left lineWidth AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getStrokeWidth AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineWidth AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setMiterLimit AST#parameter_list#Left ( AST#parameter#Left miterLimit : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . miterLimit AST#member_expression#Right = AST#expression#Left miterLimit AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getMiterLimit AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . miterLimit AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setShadowBlur AST#parameter_list#Left ( AST#parameter#Left shadowBlur : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowBlur AST#member_expression#Right = AST#expression#Left shadowBlur AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getShadowBlur AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . miterLimit AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setShadowColor AST#parameter_list#Left ( AST#parameter#Left shadowColor : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowColor AST#member_expression#Right = AST#expression#Left shadowColor AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getShadowColor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowColor AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setShadowOffsetX AST#parameter_list#Left ( AST#parameter#Left shadowOffsetX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowOffsetX AST#member_expression#Right = AST#expression#Left shadowOffsetX AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getShadowOffsetX AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowOffsetX AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setShadowOffsetY AST#parameter_list#Left ( AST#parameter#Left shadowOffsetY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowOffsetY AST#member_expression#Right = AST#expression#Left shadowOffsetY AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getShadowOffsetY AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shadowOffsetY AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setDirection AST#parameter_list#Left ( AST#parameter#Left direction : AST#type_annotation#Left AST#primary_type#Left CanvasDirection AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . direction AST#member_expression#Right = AST#expression#Left direction AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getDirection AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CanvasDirection AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . direction AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setTextSize AST#parameter_list#Left ( AST#parameter#Left textSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left textSizeUnit ? : AST#type_annotation#Left AST#primary_type#Left FontSizeUnit AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontSize AST#member_expression#Right = AST#expression#Left textSize AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left textSizeUnit AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontSizeUnit AST#member_expression#Right = AST#expression#Left textSizeUnit AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . font AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontWeight AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSize AST#member_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSizeUnit AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontFamily AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getTextSize AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontSize AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setFontStyle AST#parameter_list#Left ( AST#parameter#Left fontStyle : AST#type_annotation#Left AST#primary_type#Left FontStyleType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right = AST#expression#Left fontStyle AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . font AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontWeight AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSize AST#member_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSizeUnit AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontFamily AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getFontStyle AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left FontStyleType AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setFontWeight AST#parameter_list#Left ( AST#parameter#Left fontWeight : AST#type_annotation#Left AST#primary_type#Left FontWeightType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontWeight AST#member_expression#Right = AST#expression#Left fontWeight AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . font AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontWeight AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSize AST#member_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSizeUnit AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontFamily AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getFontWeight AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left FontWeightType AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontWeight AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setFontFamily AST#parameter_list#Left ( AST#parameter#Left fontFamily : AST#type_annotation#Left AST#primary_type#Left FontFamily AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontFamily AST#member_expression#Right = AST#expression#Left fontFamily AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . font AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontWeight AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSize AST#member_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSizeUnit AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontFamily AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getFontFamily AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left FontFamily AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontFamily AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setFont AST#parameter_list#Left ( AST#parameter#Left fontStyle ? : AST#type_annotation#Left AST#primary_type#Left FontStyleType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fontWeight ? : AST#type_annotation#Left AST#primary_type#Left FontWeightType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fontSize ? : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fontSizeUnit ? : AST#type_annotation#Left AST#primary_type#Left FontSizeUnit AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fontFamily ? : AST#type_annotation#Left AST#primary_type#Left FontFamily AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left fontStyle AST#expression#Right AST#unary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right = AST#expression#Left 'normal' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left fontWeight AST#expression#Right AST#unary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontWeight AST#member_expression#Right = AST#expression#Left 'normal' AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left fontSize AST#expression#Right AST#unary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontSize AST#member_expression#Right = AST#expression#Left 14 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left fontSizeUnit AST#expression#Right AST#unary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontSizeUnit AST#member_expression#Right = AST#expression#Left 'px' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left fontFamily AST#expression#Right AST#unary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontFamily AST#member_expression#Right = AST#expression#Left '' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . font AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fontStyle AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontWeight AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSize AST#member_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontSizeUnit AST#member_expression#Right AST#expression#Right + AST#expression#Left " " AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . fontFamily AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getFont AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . font AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setTextAlign AST#parameter_list#Left ( AST#parameter#Left textAlign : AST#type_annotation#Left AST#primary_type#Left CanvasTextAlign AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textAlign AST#member_expression#Right = AST#expression#Left textAlign AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getTextAlign AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CanvasTextAlign AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textAlign AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setTextBaseline AST#parameter_list#Left ( AST#parameter#Left textBaseline : AST#type_annotation#Left AST#primary_type#Left CanvasTextBaseline AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textBaseline AST#member_expression#Right = AST#expression#Left textBaseline AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getTextBaseline AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CanvasTextBaseline AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textBaseline AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setLineDash AST#parameter_list#Left ( AST#parameter#Left lineDash : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineDash AST#member_expression#Right = AST#expression#Left lineDash AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getLineDash AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lineDash AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public setDashPathEffect AST#parameter_list#Left ( AST#parameter#Left dashEffect : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left DashPathEffect AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dashPathEffect AST#member_expression#Right = AST#expression#Left dashEffect AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getDashPathEffect AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left DashPathEffect AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dashPathEffect AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export default class Paint {
styleType: Style = Style.FILL_AND_STROKE;
globalAlpha: number | undefined = undefined;
globalCompositeOperation: string = 'source-over'
fillStyle: string | number | CanvasGradient | CanvasPattern = Color.White;
strokeStyle: string | number | CanvasGradient | CanvasPattern = Color.Black;
imageSmoothingEnabled: boolean = true;
imageSmoothingQuality: ImageSmoothingQuality = 'low';
lineCap: CanvasLineCap = 'butt'
lineDashOffset: number = 0.0;
lineJoin: CanvasLineJoin = 'miter'
lineWidth: number = 1;
miterLimit: number = 10;
shadowBlur: number = 0.0;
shadowColor: string = '#00000000';
shadowOffsetX: number = 0;
shadowOffsetY: number = 0;
direction: CanvasDirection = 'inherit';
fontStyle: FontStyleType = 'normal';
fontWeight: FontWeightType = 'normal';
fontSize: number = 14;
fontSizeUnit: FontSizeUnit = 'vp';
fontFamily: FontFamily = '';
font: string = 'normal normal 14vp '
textAlign: CanvasTextAlign = 'left';
textBaseline: CanvasTextBaseline = 'alphabetic';
lineDash: number[] = [];
dashPathEffect: DashPathEffect | null = null;
constructor(paint?: Paint) {
if (paint != null && paint != undefined) {
this.set(paint);
}
}
public set(paint: Paint) {
this.styleType = paint.styleType;
this.globalAlpha = paint.globalAlpha
this.globalCompositeOperation = paint.globalCompositeOperation;
this.fillStyle = paint.fillStyle;
this.strokeStyle = paint.strokeStyle;
this.imageSmoothingEnabled = paint.imageSmoothingEnabled;
this.imageSmoothingQuality = paint.imageSmoothingQuality;
this.lineCap = paint.lineCap;
this.lineDashOffset = paint.lineDashOffset;
this.lineJoin = paint.lineJoin;
this.lineWidth = paint.lineWidth;
this.miterLimit = paint.miterLimit;
this.shadowBlur = paint.shadowBlur;
this.shadowColor = paint.shadowColor;
this.shadowOffsetX = paint.shadowOffsetX;
this.shadowOffsetY = paint.shadowOffsetY;
this.direction = paint.direction;
this.fontStyle = paint.fontStyle;
this.fontWeight = paint.fontWeight;
this.fontSize = paint.fontSize;
this.fontSizeUnit = paint.fontSizeUnit;
this.fontFamily = paint.fontFamily;
this.font = paint.font;
this.textAlign = paint.textAlign;
this.textBaseline = paint.textBaseline;
this.lineDash = paint.lineDash;
this.dashPathEffect = paint.dashPathEffect;
}
public setColor(color: string | number | CanvasGradient | CanvasPattern) {
this.fillStyle = color;
this.strokeStyle = color;
}
public getColor(): string | number | CanvasGradient | CanvasPattern {
return this.fillStyle;
}
public setStyle(styleType: Style) {
this.styleType = styleType;
}
public getStyle(): Style {
return this.styleType;
}
public setGlobalAlpha(alpha: number) {
this.globalAlpha = alpha;
}
public getGlobalAlpha() {
return this.globalAlpha;
}
public setGlobalCompositeOperation(composite: string) {
this.globalCompositeOperation = composite;
}
public getGlobalCompositeOperation() {
return this.globalCompositeOperation;
}
public setFillStyle(fillStyle: string | number | CanvasGradient | CanvasPattern) {
this.fillStyle = fillStyle;
}
public getFillStyle(): string | number | CanvasGradient | CanvasPattern {
return this.fillStyle;
}
public setStrokeStyle(strokeStyle: string | number | CanvasGradient | CanvasPattern) {
this.strokeStyle = strokeStyle;
}
public getStrokeStyle(): string | number | CanvasGradient | CanvasPattern {
return this.fillStyle;
}
public setImageSmoothingEnabled(enable: boolean) {
this.imageSmoothingEnabled = enable;
}
public getImageSmoothingEnabled(): boolean {
return this.imageSmoothingEnabled;
}
public setImageSmoothingQuality(quality: ImageSmoothingQuality) {
this.imageSmoothingQuality = quality;
}
public getImageSmoothingQuality(): ImageSmoothingQuality {
return this.imageSmoothingQuality;
}
public setLineCap(lineCap: CanvasLineCap) {
this.lineCap = lineCap;
}
public getLineCap(): CanvasLineCap {
return this.lineCap;
}
public setLineDashOffset(offset: number) {
this.lineDashOffset = offset;
}
public getLineDashOffset(): number {
return this.lineDashOffset;
}
public setLineJoin(lineJoin: CanvasLineJoin) {
this.lineJoin = lineJoin;
}
public getLineJoin(): CanvasLineJoin {
return this.lineJoin;
}
public setStrokeWidth(lineWidth: number) {
this.lineWidth = lineWidth;
}
public getStrokeWidth(): number {
return this.lineWidth;
}
public setMiterLimit(miterLimit: number) {
this.miterLimit = miterLimit;
}
public getMiterLimit(): number {
return this.miterLimit;
}
public setShadowBlur(shadowBlur: number) {
this.shadowBlur = shadowBlur;
}
public getShadowBlur(): number {
return this.miterLimit;
}
public setShadowColor(shadowColor: string) {
this.shadowColor = shadowColor;
}
public getShadowColor(): string {
return this.shadowColor;
}
public setShadowOffsetX(shadowOffsetX: number) {
this.shadowOffsetX = shadowOffsetX;
}
public getShadowOffsetX(): number {
return this.shadowOffsetX;
}
public setShadowOffsetY(shadowOffsetY: number) {
this.shadowOffsetY = shadowOffsetY;
}
public getShadowOffsetY(): number {
return this.shadowOffsetY;
}
public setDirection(direction: CanvasDirection) {
this.direction = direction;
}
public getDirection(): CanvasDirection {
return this.direction;
}
public setTextSize(textSize: number, textSizeUnit?: FontSizeUnit): void {
this.fontSize = textSize;
if (textSizeUnit) {
this.fontSizeUnit = textSizeUnit;
}
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getTextSize(): number {
return this.fontSize;
}
public setFontStyle(fontStyle: FontStyleType): void {
this.fontStyle = fontStyle;
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getFontStyle(): FontStyleType {
return this.fontStyle;
}
public setFontWeight(fontWeight: FontWeightType): void {
this.fontWeight = fontWeight;
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getFontWeight(): FontWeightType {
return this.fontWeight;
}
public setFontFamily(fontFamily: FontFamily): void {
this.fontFamily = fontFamily;
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getFontFamily(): FontFamily {
return this.fontFamily;
}
public setFont(fontStyle?: FontStyleType, fontWeight?: FontWeightType, fontSize?: number, fontSizeUnit?: FontSizeUnit, fontFamily?: FontFamily) {
if (!fontStyle) {
this.fontStyle = 'normal';
}
if (!fontWeight) {
this.fontWeight = 'normal'
}
if (!fontSize) {
this.fontSize = 14;
}
if (!fontSizeUnit) {
this.fontSizeUnit = 'px';
}
if (!fontFamily) {
this.fontFamily = '';
}
this.font = this.fontStyle + " " + this.fontWeight + " " + this.fontSize + this.fontSizeUnit + " " + this.fontFamily;
}
public getFont(): string {
return this.font;
}
public setTextAlign(textAlign: CanvasTextAlign) {
this.textAlign = textAlign;
}
public getTextAlign(): CanvasTextAlign {
return this.textAlign;
}
public setTextBaseline(textBaseline: CanvasTextBaseline) {
this.textBaseline = textBaseline;
}
public getTextBaseline(): CanvasTextBaseline {
return this.textBaseline;
}
public setLineDash(lineDash: number[]) {
this.lineDash = lineDash;
}
public getLineDash(): number[] {
return this.lineDash;
}
public setDashPathEffect(dashEffect: DashPathEffect | null) {
this.dashPathEffect = dashEffect;
}
public getDashPathEffect(): DashPathEffect | null {
return this.dashPathEffect;
}
}
|
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/Paint.ets#L20-L324
|
1388f55021eca9123554705aa7178c8ddb4260cf
|
gitee
|
|
common-apps/ZRouter
|
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
|
RouterApi/src/main/ets/api/Router.ets
|
arkts
|
registerNavStack
|
注册关联一个路由栈到ZRouter中,通常情况使用不上,一般用于第三方的Navigation的路由栈关联到ZRouter中
@param stackName
@param pathStack
|
public static registerNavStack(stackName: string = DEFAULT_STACK_NAME, pathStack: NavPathStack): void {
ZRouter.getRouterMgr().registerNavStack(stackName, pathStack)
}
|
AST#method_declaration#Left public static registerNavStack AST#parameter_list#Left ( AST#parameter#Left stackName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left DEFAULT_STACK_NAME AST#expression#Right AST#parameter#Right , AST#parameter#Left pathStack : AST#type_annotation#Left AST#primary_type#Left NavPathStack AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left ZRouter AST#expression#Right . getRouterMgr AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . registerNavStack AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left stackName AST#expression#Right , AST#expression#Left pathStack AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
public static registerNavStack(stackName: string = DEFAULT_STACK_NAME, pathStack: NavPathStack): void {
ZRouter.getRouterMgr().registerNavStack(stackName, pathStack)
}
|
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/api/Router.ets#L227-L229
|
1fa59343598776003cb03b8b64bc3e9bdfdab011
|
gitee
|
harmonyos-cases/cases
|
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
|
CommonAppDevelopment/feature/h5cache/src/main/ets/common/OfflineResourceManager.ets
|
arkts
|
fetchFromOfflineResource
|
从离线包资源中取回数据
@param url 文件名
@param filesDir 离线包文件路径
|
fetchFromOfflineResource(url: string, filesDir: string): null | ResponseDataType {
let srcFile = fs.openSync(filesDir + '/' + url, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
let stat = fs.statSync(filesDir + '/' + url);
let bufSize = stat.size;
// 如果资源不存在,直接返回null
if (bufSize === 0) {
return null;
}
let readSize = 0;
let arrayBuffer = new ArrayBuffer(bufSize);
let readOptions: ReadOptions = {
offset: readSize,
length: bufSize
}
fs.readSync(srcFile.fd, arrayBuffer, readOptions);
return arrayBuffer;
}
|
AST#method_declaration#Left fetchFromOfflineResource AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left filesDir : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left null AST#primary_type#Right | AST#primary_type#Left ResponseDataType AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left srcFile = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . openSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left filesDir AST#expression#Right + AST#expression#Left '/' AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left url AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . READ_WRITE AST#member_expression#Right AST#expression#Right | AST#expression#Left fs AST#expression#Right AST#binary_expression#Right AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . CREATE AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left stat = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . statSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left filesDir AST#expression#Right + AST#expression#Left '/' AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left url AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left bufSize = AST#expression#Left AST#member_expression#Left AST#expression#Left stat AST#expression#Right . size AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 如果资源不存在,直接返回null AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left bufSize AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left readSize = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left arrayBuffer = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ArrayBuffer AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left bufSize AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left readOptions : AST#type_annotation#Left AST#primary_type#Left ReadOptions AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left offset AST#property_name#Right : AST#expression#Left readSize AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left length AST#property_name#Right : AST#expression#Left bufSize AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#ERROR#Left fs AST#ERROR#Right . readSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left srcFile AST#expression#Right . fd AST#member_expression#Right AST#expression#Right , AST#expression#Left arrayBuffer AST#expression#Right , AST#expression#Left readOptions AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left arrayBuffer AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
fetchFromOfflineResource(url: string, filesDir: string): null | ResponseDataType {
let srcFile = fs.openSync(filesDir + '/' + url, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
let stat = fs.statSync(filesDir + '/' + url);
let bufSize = stat.size;
if (bufSize === 0) {
return null;
}
let readSize = 0;
let arrayBuffer = new ArrayBuffer(bufSize);
let readOptions: ReadOptions = {
offset: readSize,
length: bufSize
}
fs.readSync(srcFile.fd, arrayBuffer, readOptions);
return arrayBuffer;
}
|
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/h5cache/src/main/ets/common/OfflineResourceManager.ets#L116-L133
|
d3b1fcd06f4865db0161d1d3272b2d481b3dbc97
|
gitee
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/services/web/WebSearchService.ets
|
arkts
|
getPriceRanges
|
获取价格区间建议
|
public getPriceRanges(): PriceRangeOption[] {
return [
{ label: '50元以下', min: 0, max: 50 },
{ label: '50-100元', min: 50, max: 100 },
{ label: '100-200元', min: 100, max: 200 },
{ label: '200-500元', min: 200, max: 500 },
{ label: '500-1000元', min: 500, max: 1000 },
{ label: '1000元以上', min: 1000, max: 999999 }
];
}
|
AST#method_declaration#Left public getPriceRanges AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left PriceRangeOption [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '50元以下' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left min AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left max AST#property_name#Right : AST#expression#Left 50 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '50-100元' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left min AST#property_name#Right : AST#expression#Left 50 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left max AST#property_name#Right : AST#expression#Left 100 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '100-200元' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left min AST#property_name#Right : AST#expression#Left 100 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left max AST#property_name#Right : AST#expression#Left 200 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '200-500元' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left min AST#property_name#Right : AST#expression#Left 200 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left max AST#property_name#Right : AST#expression#Left 500 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '500-1000元' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left min AST#property_name#Right : AST#expression#Left 500 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left max AST#property_name#Right : AST#expression#Left 1000 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '1000元以上' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left min AST#property_name#Right : AST#expression#Left 1000 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left max AST#property_name#Right : AST#expression#Left 999999 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
public getPriceRanges(): PriceRangeOption[] {
return [
{ label: '50元以下', min: 0, max: 50 },
{ label: '50-100元', min: 50, max: 100 },
{ label: '100-200元', min: 100, max: 200 },
{ label: '200-500元', min: 200, max: 500 },
{ label: '500-1000元', min: 500, max: 1000 },
{ label: '1000元以上', min: 1000, max: 999999 }
];
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/web/WebSearchService.ets#L146-L155
|
b7ec0cd89ecce753e2013f09458eb3ed4f238d6e
|
github
|
WinWang/HarmoneyOpenEye.git
|
57f0542795336009aa0d46fd9fa5b07facc2ae87
|
entry/src/main/ets/event/EventKeys.ets
|
arkts
|
事件的EventNum
|
export class EventKeys {
//展示loading的事件处理EventID
static readonly LOADING_DIALOG_EVENT = 0x10000
}
|
AST#export_declaration#Left export AST#class_declaration#Left class EventKeys AST#class_body#Left { //展示loading的事件处理EventID AST#property_declaration#Left static readonly LOADING_DIALOG_EVENT = AST#expression#Left 0x10000 AST#expression#Right AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export class EventKeys {
static readonly LOADING_DIALOG_EVENT = 0x10000
}
|
https://github.com/WinWang/HarmoneyOpenEye.git/blob/57f0542795336009aa0d46fd9fa5b07facc2ae87/entry/src/main/ets/event/EventKeys.ets#L4-L7
|
0a8a9e1a41e14a0b4a02d2c3e8ec84b3e844e7f0
|
github
|
|
Joker-x-dev/HarmonyKit.git
|
f97197ce157df7f303244fba42e34918306dfb08
|
core/data/src/main/ets/repository/DemoRepository.ets
|
arkts
|
updateDemo
|
更新 Demo 记录
@param {DemoEntity} entity - 待更新的实体
@returns {Promise<void>} Promise<void>
|
async updateDemo(entity: DemoEntity): Promise<void> {
return this.demoLocalDataSource.updateItem(entity);
}
|
AST#method_declaration#Left async updateDemo AST#parameter_list#Left ( AST#parameter#Left entity : AST#type_annotation#Left AST#primary_type#Left DemoEntity AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . demoLocalDataSource AST#member_expression#Right AST#expression#Right . updateItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left entity AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
async updateDemo(entity: DemoEntity): Promise<void> {
return this.demoLocalDataSource.updateItem(entity);
}
|
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/data/src/main/ets/repository/DemoRepository.ets#L36-L38
|
b342790ae883bba4254e3c09aaaad8640c5c00c1
|
github
|
wasd09090030/MyHongmengProject.git
|
a8ed386b658ceeac69ef5bc42a92d78c7980821c
|
entry/src/main/ets/viewmodels/ReviewViewModel.ets
|
arkts
|
getTimeDistribution
|
获取时间分布数据
|
static getTimeDistribution(completedTasks: TaskItem[]): TimeDistributionItem[] {
const distribution: TimeDistributionItem[] = [
{ label: '今天', hours: 0, color: '#007DFF' },
{ label: '昨天', hours: 0, color: '#5AC8FA' },
{ label: '本周', hours: 0, color: '#34C759' },
{ label: '本月', hours: 0, color: '#FF9500' }
];
const now = Date.now();
const dayMs = 24 * 60 * 60 * 1000;
completedTasks.forEach(task => {
const elapsed = now - (task.completedTime || 0);
const hours = (task.actualTime || 0) / 3600;
if (elapsed < dayMs) {
distribution[0].hours += hours;
distribution[2].hours += hours;
distribution[3].hours += hours;
} else if (elapsed < 2 * dayMs) {
distribution[1].hours += hours;
distribution[2].hours += hours;
distribution[3].hours += hours;
} else if (elapsed < 7 * dayMs) {
distribution[2].hours += hours;
distribution[3].hours += hours;
} else if (elapsed < 30 * dayMs) {
distribution[3].hours += hours;
}
});
return distribution;
}
|
AST#method_declaration#Left static getTimeDistribution AST#parameter_list#Left ( AST#parameter#Left completedTasks : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TaskItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TimeDistributionItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left distribution : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TimeDistributionItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '今天' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left hours AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left color AST#property_name#Right : AST#expression#Left '#007DFF' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '昨天' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left hours AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left color AST#property_name#Right : AST#expression#Left '#5AC8FA' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '本周' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left hours AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left color AST#property_name#Right : AST#expression#Left '#34C759' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left label AST#property_name#Right : AST#expression#Left '本月' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left hours AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left color AST#property_name#Right : AST#expression#Left '#FF9500' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left now = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Date AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left dayMs = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 24 AST#expression#Right * AST#expression#Left 60 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 60 AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left 1000 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left completedTasks AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left task => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left elapsed = AST#expression#Left AST#binary_expression#Left AST#expression#Left now AST#expression#Right - AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left task AST#expression#Right . completedTime AST#member_expression#Right AST#expression#Right || AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left hours = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left task AST#expression#Right . actualTime AST#member_expression#Right AST#expression#Right || AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#expression#Left 3600 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left elapsed AST#expression#Right < AST#expression#Left dayMs AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 2 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 3 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left elapsed AST#expression#Right < AST#expression#Left AST#binary_expression#Left AST#expression#Left 2 AST#expression#Right * AST#expression#Left dayMs AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 2 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 3 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left elapsed AST#expression#Right < AST#expression#Left AST#binary_expression#Left AST#expression#Left 7 AST#expression#Right * AST#expression#Left dayMs AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 2 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 3 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left elapsed AST#expression#Right < AST#expression#Left AST#binary_expression#Left AST#expression#Left 30 AST#expression#Right * AST#expression#Left dayMs AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left distribution AST#expression#Right [ AST#expression#Left 3 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . hours AST#member_expression#Right += AST#expression#Left hours AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left distribution AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static getTimeDistribution(completedTasks: TaskItem[]): TimeDistributionItem[] {
const distribution: TimeDistributionItem[] = [
{ label: '今天', hours: 0, color: '#007DFF' },
{ label: '昨天', hours: 0, color: '#5AC8FA' },
{ label: '本周', hours: 0, color: '#34C759' },
{ label: '本月', hours: 0, color: '#FF9500' }
];
const now = Date.now();
const dayMs = 24 * 60 * 60 * 1000;
completedTasks.forEach(task => {
const elapsed = now - (task.completedTime || 0);
const hours = (task.actualTime || 0) / 3600;
if (elapsed < dayMs) {
distribution[0].hours += hours;
distribution[2].hours += hours;
distribution[3].hours += hours;
} else if (elapsed < 2 * dayMs) {
distribution[1].hours += hours;
distribution[2].hours += hours;
distribution[3].hours += hours;
} else if (elapsed < 7 * dayMs) {
distribution[2].hours += hours;
distribution[3].hours += hours;
} else if (elapsed < 30 * dayMs) {
distribution[3].hours += hours;
}
});
return distribution;
}
|
https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/viewmodels/ReviewViewModel.ets#L67-L99
|
116bf27f0f7cf1bd70c39a07ee313daaffee22e2
|
github
|
openharmony/applications_settings
|
aac607310ec30e30d1d54db2e04d055655f72730
|
product/phone/src/main/ets/pages/bluetooth.ets
|
arkts
|
getConnectionStateText
|
Get connection state text
@param device
|
getConnectionStateText(device: BluetoothDevice): string {
let stateText: string = '';
switch (device.connectionState) {
case ProfileConnectionState.STATE_DISCONNECTED:
stateText = '';
|
AST#method_declaration#Left getConnectionStateText AST#parameter_list#Left ( AST#parameter#Left device : AST#type_annotation#Left AST#primary_type#Left BluetoothDevice AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right { AST#ERROR#Left AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left stateText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left switch AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left device AST#expression#Right . connectionState AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right { AST#property_name#Left case AST#property_name#Right ProfileConnection State AST#ERROR#Right AST#modifier_chain_expression#Left . STATE_DISCONNECTED AST#modifier_chain_expression#Right AST#ERROR#Right : AST#type_annotation#Left AST#primary_type#Left stateText AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Left = '' AST#ERROR#Right ; AST#method_declaration#Right
|
getConnectionStateText(device: BluetoothDevice): string {
let stateText: string = '';
switch (device.connectionState) {
case ProfileConnectionState.STATE_DISCONNECTED:
stateText = '';
|
https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/product/phone/src/main/ets/pages/bluetooth.ets#L314-L318
|
ba22b0c9d0aec61cd3686831a0d999ddcc1f56cb
|
gitee
|
Joker-x-dev/CoolMallArkTS.git
|
9f3fabf89fb277692cb82daf734c220c7282919c
|
feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets
|
arkts
|
addAddress
|
新增地址
@param {Address} address - 地址数据
@returns {void} 无返回值
|
private addAddress(address: Address): void {
RequestHelper.repository(this.repository.addAddress(address))
.start((): void => {
this.isSaving = true;
})
.execute()
.then((): void => {
this.onSaveSuccess();
})
.finally((): void => {
this.isSaving = false;
});
}
|
AST#method_declaration#Left private addAddress AST#parameter_list#Left ( AST#parameter#Left address : AST#type_annotation#Left AST#primary_type#Left Address AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left RequestHelper AST#expression#Right . repository AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . repository AST#member_expression#Right AST#expression#Right . addAddress AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left address AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . start AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isSaving AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . execute AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . then AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . onSaveSuccess AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . finally AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isSaving AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
private addAddress(address: Address): void {
RequestHelper.repository(this.repository.addAddress(address))
.start((): void => {
this.isSaving = true;
})
.execute()
.then((): void => {
this.onSaveSuccess();
})
.finally((): void => {
this.isSaving = false;
});
}
|
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets#L382-L394
|
c49ca37886f6749e674b240d1ec1a95cf4129596
|
github
|
wuyuanwuhui999/harmony-arkts-chat-app-ui.git
|
128861bc002adae9c34c6ce8fbf12686c26e51ec
|
entry/src/main/ets/components/GlobalLoading.ets
|
arkts
|
showLoading
|
显示/隐藏方法
|
public showLoading(message?: string) {
this.isShow = true
if (message) {
this.message = message
}
}
|
AST#method_declaration#Left public showLoading AST#parameter_list#Left ( AST#parameter#Left message ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isShow AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left message AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . message AST#member_expression#Right = AST#expression#Left message AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
public showLoading(message?: string) {
this.isShow = true
if (message) {
this.message = message
}
}
|
https://github.com/wuyuanwuhui999/harmony-arkts-chat-app-ui.git/blob/128861bc002adae9c34c6ce8fbf12686c26e51ec/entry/src/main/ets/components/GlobalLoading.ets#L18-L23
|
e95531e592e81895182fd11acfe4db40c7cbfbdb
|
github
|
tongyuyan/harmony-utils
|
697472f011a43e783eeefaa28ef9d713c4171726
|
harmony_dialog/src/main/ets/dialog/DialogHelper.ets
|
arkts
|
showToastLong
|
显示长吐司
@param message 吐司内容
@param options
|
static showToastLong(message: string | Resource, options?: ToastOptions) {
options = options ?? {};
options.message = message;
ActionParameter.initToastDefault(options, 2);
ActionBaseCore.getInstance().showToast(options);
}
|
AST#method_declaration#Left static showToastLong AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left ToastOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left options = AST#expression#Left AST#binary_expression#Left AST#expression#Left options AST#expression#Right ?? AST#expression#Left AST#object_literal#Left { } AST#object_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . message AST#member_expression#Right = AST#expression#Left message AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left ActionParameter AST#expression#Right . initToastDefault AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left options AST#expression#Right , AST#expression#Left 2 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left ActionBaseCore AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left options AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
static showToastLong(message: string | Resource, options?: ToastOptions) {
options = options ?? {};
options.message = message;
ActionParameter.initToastDefault(options, 2);
ActionBaseCore.getInstance().showToast(options);
}
|
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogHelper.ets#L407-L412
|
940d5754b65a6deb4883728901d2916653c1caf2
|
gitee
|
openharmony/applications_app_samples
|
a826ab0e75fe51d028c1c5af58188e908736b53b
|
code/BasicFeature/Media/QRCodeScan/Feature/src/main/ets/qrcodescan/QRCodeScanConst.ets
|
arkts
|
二维码扫描解析常量
|
export class QRCodeScanConst {
// 扫描框距离头部高度
static readonly SCAN_TO_TOP_HEIGHT: number = 120
// 相机是否已开启标记
static readonly HAS_CAMERA_PERMISSION: string = 'hasCameraPermission'
// 二维码扫描解析结果
static readonly QR_CODE_PARSE_RESULT: string = 'qrCodeParseResult'
// 二维码图片自定义文件前缀
static readonly IMG_FILE_PREFIX = 'IMG_QR_CODE_'
// 二维码图片自定义文件后缀--当前支持jpg
static readonly IMG_SUFFIX_JPG = '.jpg'
// 二维码的大小
static readonly QR_CODE_SIZE: number = px2vp(300)
// 图片默认大小
static readonly IMG_DEFAULT_SIZE_WIDTH = 1920;
static readonly IMG_DEFAULT_SIZE_HEIGHT = 1080;
// 同时访问的最大图像数
static readonly MAX_IMAGE_CAPACITY = 8
}
|
AST#export_declaration#Left export AST#class_declaration#Left class QRCodeScanConst AST#class_body#Left { // 扫描框距离头部高度 AST#property_declaration#Left static readonly SCAN_TO_TOP_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 120 AST#expression#Right // 相机是否已开启标记 AST#property_declaration#Right AST#property_declaration#Left static readonly HAS_CAMERA_PERMISSION : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'hasCameraPermission' AST#expression#Right // 二维码扫描解析结果 AST#property_declaration#Right AST#property_declaration#Left static readonly QR_CODE_PARSE_RESULT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'qrCodeParseResult' AST#expression#Right // 二维码图片自定义文件前缀 AST#property_declaration#Right AST#property_declaration#Left static readonly IMG_FILE_PREFIX = AST#expression#Left 'IMG_QR_CODE_' AST#expression#Right // 二维码图片自定义文件后缀--当前支持jpg AST#property_declaration#Right AST#property_declaration#Left static readonly IMG_SUFFIX_JPG = AST#expression#Left '.jpg' AST#expression#Right // 二维码的大小 AST#property_declaration#Right AST#property_declaration#Left static readonly QR_CODE_SIZE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left px2vp AST#expression#Right AST#argument_list#Left ( AST#expression#Left 300 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right // 图片默认大小 AST#property_declaration#Right AST#property_declaration#Left static readonly IMG_DEFAULT_SIZE_WIDTH = AST#expression#Left 1920 AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly IMG_DEFAULT_SIZE_HEIGHT = AST#expression#Left 1080 AST#expression#Right ; AST#property_declaration#Right // 同时访问的最大图像数 AST#property_declaration#Left static readonly MAX_IMAGE_CAPACITY = AST#expression#Left 8 AST#expression#Right AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export class QRCodeScanConst {
static readonly SCAN_TO_TOP_HEIGHT: number = 120
static readonly HAS_CAMERA_PERMISSION: string = 'hasCameraPermission'
static readonly QR_CODE_PARSE_RESULT: string = 'qrCodeParseResult'
static readonly IMG_FILE_PREFIX = 'IMG_QR_CODE_'
static readonly IMG_SUFFIX_JPG = '.jpg'
static readonly QR_CODE_SIZE: number = px2vp(300)
static readonly IMG_DEFAULT_SIZE_WIDTH = 1920;
static readonly IMG_DEFAULT_SIZE_HEIGHT = 1080;
static readonly MAX_IMAGE_CAPACITY = 8
}
|
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/QRCodeScan/Feature/src/main/ets/qrcodescan/QRCodeScanConst.ets#L20-L45
|
bb8beea2575ea4fe741e443e222cc0ea9bc74dd9
|
gitee
|
|
Delsin-Yu/JustPDF.git
|
d53f566e02820dac46e1752151750144acbed50a
|
entry/src/main/ets/components/PageInfo.ets
|
arkts
|
deleteGroup
|
Deletes a page group from the data source.
Removes all pages in the group, updates global page indices, and notifies listeners.
@param pageGroup The PageGroup to delete
|
public deleteGroup(pageGroup: PageGroup): void {
const groupIndex = this.pageGroups.indexOf(pageGroup);
if (groupIndex < 0) {
throw new Error(`PageGroup not found for deletion`);
}
// Clean up resources for all pages in the group
for (const pageInfo of pageGroup.pages) {
pageInfo.evictViewerCache();
pageInfo.releaseThumbnail();
pageInfo.associatedSource = undefined;
pageInfo.globalPageIndex = undefined;
}
// Remove the group from the array
this.pageGroups.splice(groupIndex, 1);
// Recalculate global page indices for remaining pages
this.recalculateGlobalIndices();
// Notify listeners about the deletion
this.listeners.forEach(listener => listener.onDataDelete(groupIndex));
hilog.info(0, 'PDFView', `删除 PageGroup ${groupIndex} (${pageGroup.groupName})`);
}
|
AST#method_declaration#Left public deleteGroup AST#parameter_list#Left ( AST#parameter#Left pageGroup : AST#type_annotation#Left AST#primary_type#Left PageGroup AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left groupIndex = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . pageGroups AST#member_expression#Right AST#expression#Right . indexOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left pageGroup AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left groupIndex AST#expression#Right < AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` PageGroup not found for deletion ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // Clean up resources for all pages in the group AST#statement#Left AST#for_statement#Left for ( const pageInfo of AST#expression#Left AST#member_expression#Left AST#expression#Left pageGroup AST#expression#Right . pages AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left pageInfo AST#expression#Right . evictViewerCache AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left pageInfo AST#expression#Right . releaseThumbnail AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left pageInfo AST#expression#Right . associatedSource AST#member_expression#Right = AST#expression#Left undefined AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left pageInfo AST#expression#Right . globalPageIndex AST#member_expression#Right = AST#expression#Left undefined AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right // Remove the group from the array AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . pageGroups AST#member_expression#Right AST#expression#Right . splice AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left groupIndex AST#expression#Right , AST#expression#Left 1 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // Recalculate global page indices for remaining pages AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . recalculateGlobalIndices AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // Notify listeners about the deletion AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataDelete AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left groupIndex AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0 AST#expression#Right , AST#expression#Left 'PDFView' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` 删除 PageGroup AST#template_substitution#Left $ { AST#expression#Left groupIndex AST#expression#Right } AST#template_substitution#Right ( AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left pageGroup AST#expression#Right . groupName AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ) ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
public deleteGroup(pageGroup: PageGroup): void {
const groupIndex = this.pageGroups.indexOf(pageGroup);
if (groupIndex < 0) {
throw new Error(`PageGroup not found for deletion`);
}
for (const pageInfo of pageGroup.pages) {
pageInfo.evictViewerCache();
pageInfo.releaseThumbnail();
pageInfo.associatedSource = undefined;
pageInfo.globalPageIndex = undefined;
}
this.pageGroups.splice(groupIndex, 1);
this.recalculateGlobalIndices();
this.listeners.forEach(listener => listener.onDataDelete(groupIndex));
hilog.info(0, 'PDFView', `删除 PageGroup ${groupIndex} (${pageGroup.groupName})`);
}
|
https://github.com/Delsin-Yu/JustPDF.git/blob/d53f566e02820dac46e1752151750144acbed50a/entry/src/main/ets/components/PageInfo.ets#L688-L712
|
4f631770434482d8c62c171129929642f550adbd
|
github
|
shubai-xixi/DistributeNewsArkts.git
|
7a527c5f4121612c8070d809824b0f2615d1b238
|
entry/src/main/ets/utils/HttpSyncService.ets
|
arkts
|
将本地选择同步到服务器
|
export async function pushLocalNewsId(newsId: string): Promise<void> {
const req = http.createHttp();
try {
await req.request(SERVER_URL, {
method: http.RequestMethod.PUT,
header: { 'Content-Type': 'application/json' },
extraData: JSON.stringify({ id: newsId })
});
} catch (e) {
console.warn('Push local state failed:', e);
} finally {
req.destroy();
}
}
|
AST#export_declaration#Left export AST#function_declaration#Left async function pushLocalNewsId AST#parameter_list#Left ( AST#parameter#Left newsId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left req = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left http AST#expression#Right . createHttp AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left req AST#expression#Right AST#await_expression#Right AST#expression#Right . request AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left SERVER_URL AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left method AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left http AST#expression#Right . RequestMethod AST#member_expression#Right AST#expression#Right . PUT AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left header AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left 'Content-Type' AST#property_name#Right : AST#expression#Left 'application/json' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left extraData AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left id AST#property_name#Right : AST#expression#Left newsId AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( e ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . warn AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Push local state failed:' AST#expression#Right , AST#expression#Left e AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#finally_clause#Left finally AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left req AST#expression#Right . destroy AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#finally_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
|
export async function pushLocalNewsId(newsId: string): Promise<void> {
const req = http.createHttp();
try {
await req.request(SERVER_URL, {
method: http.RequestMethod.PUT,
header: { 'Content-Type': 'application/json' },
extraData: JSON.stringify({ id: newsId })
});
} catch (e) {
console.warn('Push local state failed:', e);
} finally {
req.destroy();
}
}
|
https://github.com/shubai-xixi/DistributeNewsArkts.git/blob/7a527c5f4121612c8070d809824b0f2615d1b238/entry/src/main/ets/utils/HttpSyncService.ets#L55-L68
|
b364715c280a37b67c617ca4aec677624cd52c06
|
github
|
|
Joker-x-dev/HarmonyKit.git
|
f97197ce157df7f303244fba42e34918306dfb08
|
feature/demo/src/main/ets/view/NetworkRequestPage.ets
|
arkts
|
NetworkRequestContent
|
通用网络请求示例页内容视图
@returns {void} 无返回值
|
@Builder
private NetworkRequestContent() {
MediumPaddingVerticalScroll() {
ColumnBase({ widthValue: P100 }) {
IBestButton({
text: $r("app.string.demo_network_request_get_action"),
type: "primary",
buttonSize: "normal",
btnWidth: P100,
round: true,
loading: this.vm.getLoading,
disabled: this.vm.getLoading,
onBtnClick: (): void => {
this.vm.requestGoodsDetail();
}
});
SpaceVerticalLarge();
IBestButton({
text: $r("app.string.demo_network_request_post_action"),
type: "default",
plain: true,
buttonSize: "normal",
btnWidth: P100,
round: true,
loading: this.vm.postLoading,
disabled: this.vm.postLoading,
onBtnClick: (): void => {
this.vm.requestGoodsList();
}
});
};
};
}
|
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private NetworkRequestContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left MediumPaddingVerticalScroll ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ColumnBase ( AST#component_parameters#Left { AST#component_parameter#Left widthValue : AST#expression#Left P100 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#ui_custom_component_statement#Left IBestButton ( AST#component_parameters#Left { AST#component_parameter#Left text : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.demo_network_request_get_action" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left type : AST#expression#Left "primary" AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left buttonSize : AST#expression#Left "normal" AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left btnWidth : AST#expression#Left P100 AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left round : AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left loading : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . getLoading AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left disabled : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . getLoading AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onBtnClick : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . requestGoodsDetail AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) ; AST#ui_custom_component_statement#Right AST#ui_custom_component_statement#Left SpaceVerticalLarge ( ) ; AST#ui_custom_component_statement#Right AST#ui_custom_component_statement#Left IBestButton ( AST#component_parameters#Left { AST#component_parameter#Left text : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.demo_network_request_post_action" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left type : AST#expression#Left "default" AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left plain : AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left buttonSize : AST#expression#Left "normal" AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left btnWidth : AST#expression#Left P100 AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left round : AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left loading : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . postLoading AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left disabled : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . postLoading AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onBtnClick : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . requestGoodsList AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) ; AST#ui_custom_component_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
@Builder
private NetworkRequestContent() {
MediumPaddingVerticalScroll() {
ColumnBase({ widthValue: P100 }) {
IBestButton({
text: $r("app.string.demo_network_request_get_action"),
type: "primary",
buttonSize: "normal",
btnWidth: P100,
round: true,
loading: this.vm.getLoading,
disabled: this.vm.getLoading,
onBtnClick: (): void => {
this.vm.requestGoodsDetail();
}
});
SpaceVerticalLarge();
IBestButton({
text: $r("app.string.demo_network_request_post_action"),
type: "default",
plain: true,
buttonSize: "normal",
btnWidth: P100,
round: true,
loading: this.vm.postLoading,
disabled: this.vm.postLoading,
onBtnClick: (): void => {
this.vm.requestGoodsList();
}
});
};
};
}
|
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/NetworkRequestPage.ets#L35-L69
|
f424a8dabf5aba015cb52f172c74eaa1ea594715
|
github
|
KoStudio/ArkTS-WordTree.git
|
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
|
entry/src/main/ets/common/utils/DbFileUtility.ets
|
arkts
|
handleZipFile
|
处理ZIP文件(使用HarmonyOS官方解压API)
@param zipData ZIP文件数据
@param targetPath 解压目标路径
|
private static async handleZipFile(
zipData: Uint8Array,
targetPath: string,
context: common.Context
): Promise<void> {
const tempPath = `${context.cacheDir}/temp_${Date.now()}.zip`;
// 使用标准异步API写入
await new Promise<void>((resolve, reject) => {
const fd = fs.openSync(tempPath, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE);
fs.write(fd.fd, zipData.buffer, (err) => {
fs.closeSync(fd);
err ? reject(err) : resolve();
});
});
// 解压操作
await new Promise<void>((resolve, reject) => {
const dirPath = DbFileUtility.getFolderPath(targetPath)
zlib.decompressFile(tempPath, dirPath, (err) => {
fs.unlink(tempPath, () => {}); // 清理临时文件
err ? reject(err) : resolve();
});
});
}
|
AST#method_declaration#Left private static async handleZipFile AST#parameter_list#Left ( AST#parameter#Left zipData : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left targetPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . Context AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left tempPath = AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left context AST#expression#Right . cacheDir AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right /temp_ AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Date AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right .zip ` AST#template_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 使用标准异步API写入 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left AST#new_expression#Left new AST#expression#Left Promise AST#expression#Right AST#new_expression#Right AST#expression#Right AST#await_expression#Right AST#expression#Right AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left resolve AST#parameter#Right , AST#parameter#Left reject AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left fd = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . openSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left tempPath AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . CREATE AST#member_expression#Right AST#expression#Right | AST#expression#Left fs AST#expression#Right AST#binary_expression#Right AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . READ_WRITE AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . write AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left fd AST#expression#Right . fd AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left zipData AST#expression#Right . buffer AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left err AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . closeSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left fd AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left err AST#expression#Right ? AST#expression#Left AST#call_expression#Left AST#expression#Left reject AST#expression#Right AST#argument_list#Left ( AST#expression#Left err AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right : AST#expression#Left resolve AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 解压操作 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left AST#new_expression#Left new AST#expression#Left Promise AST#expression#Right AST#new_expression#Right AST#expression#Right AST#await_expression#Right AST#expression#Right AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left resolve AST#parameter#Right , AST#parameter#Left reject AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left dirPath = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DbFileUtility AST#expression#Right . getFolderPath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left targetPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#ERROR#Left zlib AST#ERROR#Right . decompressFile AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left tempPath AST#expression#Right , AST#expression#Left dirPath AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left err AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . unlink AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left tempPath AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#expression#Left AST#object_literal#Left { } AST#object_literal#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 清理临时文件 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left err AST#expression#Right ? AST#expression#Left AST#call_expression#Left AST#expression#Left reject AST#expression#Right AST#argument_list#Left ( AST#expression#Left err AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right : AST#expression#Left resolve AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
private static async handleZipFile(
zipData: Uint8Array,
targetPath: string,
context: common.Context
): Promise<void> {
const tempPath = `${context.cacheDir}/temp_${Date.now()}.zip`;
await new Promise<void>((resolve, reject) => {
const fd = fs.openSync(tempPath, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE);
fs.write(fd.fd, zipData.buffer, (err) => {
fs.closeSync(fd);
err ? reject(err) : resolve();
});
});
await new Promise<void>((resolve, reject) => {
const dirPath = DbFileUtility.getFolderPath(targetPath)
zlib.decompressFile(tempPath, dirPath, (err) => {
fs.unlink(tempPath, () => {});
err ? reject(err) : resolve();
});
});
}
|
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/DbFileUtility.ets#L124-L148
|
31cc7444ea6a6117ab7cc4d5295c506aeb70a2b9
|
github
|
mayuanwei/harmonyOS_bilibili
|
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
|
HCIA/framework/ArkData/KVManagerDemo/entry/src/main/ets/database/KVManager.ets
|
arkts
|
showToastMessage
|
获取一个KVManager实例,创建并获取键值数据库 TODO 数据的增删改查操作 1、调用put()方法向键值数据库中插入数据(新增或修改数据) TODO 2、调用get()方法获取指定键的值(查询数据) TODO 3、调用delete()方法删除指定键值的数据(删除数据) TODO 创建数据库 TODO 信息提示
|
showToastMessage(message: Resource) {
promptAction.showToast({
message: message,
duration: CommonConstants.DURATION
});
}
|
AST#method_declaration#Left showToastMessage AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left message AST#property_name#Right : AST#expression#Left message AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left duration AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left CommonConstants AST#expression#Right . DURATION AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
showToastMessage(message: Resource) {
promptAction.showToast({
message: message,
duration: CommonConstants.DURATION
});
}
|
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/framework/ArkData/KVManagerDemo/entry/src/main/ets/database/KVManager.ets#L26-L31
|
bfdab41456ef8316f6cf3c1341ceb7cc4ee76ded
|
gitee
|
harmonyos-cases/cases
|
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
|
CommonAppDevelopment/feature/chatwithexpression/src/main/ets/view/EmojiKeyboard.ets
|
arkts
|
EmojiKeyboard
|
表情键盘
|
@Component
export struct EmojiKeyboard {
// 控制器,用以将表情添加到输入框
controllerRich: RichEditorController | undefined = undefined;
msgFontSize: number = 0;
// 最近使用的表情数据,点击表情之后添加到数据中
@Link lastEmojiData: LastEmojiData;
// 表情键盘的表情数据列表
emojiList: Array<EmojiModel> = [];
build() {
Grid() {
// TODO: 性能知识点:使用ForEach组件循环渲染数据
ForEach(this.emojiList, (item: EmojiModel) => {
GridItem() {
// 表情明细组件
EmojiDetail({
controllerRich: this.controllerRich,
EmojiItem: item,
msgFontSize: this.msgFontSize,
lastEmojiData: this.lastEmojiData
})
}
.id('faceGridId')
})
}
.maxCount(FaceGridConstants.GRID_MAX_COUNT)
.columnsTemplate("1fr 1fr 1fr 1fr 1fr 1fr") // 分成6份
.rowsGap(FaceGridConstants.ROWS_GAP)
.margin($r('app.integer.chat_with_expression_grid_item_margin'))
.width($r('app.string.chat_with_expression_layout_100'))
}
}
|
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct EmojiKeyboard AST#component_body#Left { // 控制器,用以将表情添加到输入框 AST#property_declaration#Left controllerRich : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left RichEditorController AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left undefined AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left msgFontSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right // 最近使用的表情数据,点击表情之后添加到数据中 AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right lastEmojiData : AST#type_annotation#Left AST#primary_type#Left LastEmojiData AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // 表情键盘的表情数据列表 AST#property_declaration#Left emojiList : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left EmojiModel AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Grid ( ) AST#container_content_body#Left { // TODO: 性能知识点:使用ForEach组件循环渲染数据 AST#ui_control_flow#Left AST#for_each_statement#Left ForEach ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . emojiList AST#member_expression#Right AST#expression#Right , AST#ui_builder_arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left EmojiModel AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#ui_arrow_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left GridItem ( ) AST#container_content_body#Left { // 表情明细组件 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left EmojiDetail ( AST#component_parameters#Left { AST#component_parameter#Left controllerRich : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . controllerRich AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left EmojiItem : AST#expression#Left item AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left msgFontSize : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . msgFontSize AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left lastEmojiData : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lastEmojiData AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'faceGridId' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_arrow_function_body#Right AST#ui_builder_arrow_function#Right ) AST#for_each_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . maxCount ( AST#expression#Left AST#member_expression#Left AST#expression#Left FaceGridConstants AST#expression#Right . GRID_MAX_COUNT AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . columnsTemplate ( AST#expression#Left "1fr 1fr 1fr 1fr 1fr 1fr" AST#expression#Right ) // 分成6份 AST#modifier_chain_expression#Left . rowsGap ( AST#expression#Left AST#member_expression#Left AST#expression#Left FaceGridConstants AST#expression#Right . ROWS_GAP AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.chat_with_expression_grid_item_margin' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.chat_with_expression_layout_100' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#build_body#Right AST#build_method#Right } AST#component_body#Right AST#decorated_export_declaration#Right
|
@Component
export struct EmojiKeyboard {
controllerRich: RichEditorController | undefined = undefined;
msgFontSize: number = 0;
@Link lastEmojiData: LastEmojiData;
emojiList: Array<EmojiModel> = [];
build() {
Grid() {
ForEach(this.emojiList, (item: EmojiModel) => {
GridItem() {
EmojiDetail({
controllerRich: this.controllerRich,
EmojiItem: item,
msgFontSize: this.msgFontSize,
lastEmojiData: this.lastEmojiData
})
}
.id('faceGridId')
})
}
.maxCount(FaceGridConstants.GRID_MAX_COUNT)
.columnsTemplate("1fr 1fr 1fr 1fr 1fr 1fr")
.rowsGap(FaceGridConstants.ROWS_GAP)
.margin($r('app.integer.chat_with_expression_grid_item_margin'))
.width($r('app.string.chat_with_expression_layout_100'))
}
}
|
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/chatwithexpression/src/main/ets/view/EmojiKeyboard.ets#L21-L53
|
aab803a002b3e84ab463e6397c656b4d707094c3
|
gitee
|
awa_Liny/LinysBrowser_NEXT
|
a5cd96a9aa8114cae4972937f94a8967e55d4a10
|
home/src/main/ets/processes/init_process.ets
|
arkts
|
ensure_extensions_folder
|
Checks and ensures there is a /extensions directory in sandbox.
|
function ensure_extensions_folder(context: common.UIAbilityContext) {
let filesDir = context.filesDir;
try {
fileIo.mkdirSync(context.tempDir + '/extensions', true);
} catch (e) {
console.error('[Index] mkdirSync temp/extensions failed! ' + e);
}
try {
if (!fileIo.accessSync(filesDir + '/extensions-disabled')) {
fileIo.mkdirSync(filesDir + '/extensions-disabled', true);
} else {
console.log('[init][ensure_extensions_disabled_folder] Found disabled extensions folder! ');
}
} catch (e) {
console.error('[init][ensure_extensions_disabled_folder] Error: ' + e);
}
try {
if (!fileIo.accessSync(filesDir + '/extensions')) {
fileIo.mkdirSync(filesDir + '/extensions', true);
} else {
// extensions exist
refresh_AppStorage_extensions(context);
console.log('[init][ensure_extensions_folder] Found extensions: ' + (AppStorage.get('extensions_ids') as string[]));
}
} catch (e) {
console.error('[init][ensure_extensions_folder] Error: ' + e);
}
}
|
AST#function_declaration#Left function ensure_extensions_folder AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left filesDir = AST#expression#Left AST#member_expression#Left AST#expression#Left context AST#expression#Right . filesDir AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . mkdirSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left context AST#expression#Right . tempDir AST#member_expression#Right AST#expression#Right + AST#expression#Left '/extensions' AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( e ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left '[Index] mkdirSync temp/extensions failed! ' AST#expression#Right + AST#expression#Left e AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left fileIo AST#expression#Right AST#unary_expression#Right AST#expression#Right . accessSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left filesDir AST#expression#Right + AST#expression#Left '/extensions-disabled' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . mkdirSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left filesDir AST#expression#Right + AST#expression#Left '/extensions-disabled' AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '[init][ensure_extensions_disabled_folder] Found disabled extensions folder! ' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( e ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left '[init][ensure_extensions_disabled_folder] Error: ' AST#expression#Right + AST#expression#Left e AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left fileIo AST#expression#Right AST#unary_expression#Right AST#expression#Right . accessSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left filesDir AST#expression#Right + AST#expression#Left '/extensions' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . mkdirSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left filesDir AST#expression#Right + AST#expression#Left '/extensions' AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { // extensions exist AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left refresh_AppStorage_extensions AST#expression#Right AST#argument_list#Left ( AST#expression#Left context AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left '[init][ensure_extensions_folder] Found extensions: ' AST#expression#Right + AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AppStorage AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'extensions_ids' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( e ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left '[init][ensure_extensions_folder] Error: ' AST#expression#Right + AST#expression#Left e AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right
|
function ensure_extensions_folder(context: common.UIAbilityContext) {
let filesDir = context.filesDir;
try {
fileIo.mkdirSync(context.tempDir + '/extensions', true);
} catch (e) {
console.error('[Index] mkdirSync temp/extensions failed! ' + e);
}
try {
if (!fileIo.accessSync(filesDir + '/extensions-disabled')) {
fileIo.mkdirSync(filesDir + '/extensions-disabled', true);
} else {
console.log('[init][ensure_extensions_disabled_folder] Found disabled extensions folder! ');
}
} catch (e) {
console.error('[init][ensure_extensions_disabled_folder] Error: ' + e);
}
try {
if (!fileIo.accessSync(filesDir + '/extensions')) {
fileIo.mkdirSync(filesDir + '/extensions', true);
} else {
refresh_AppStorage_extensions(context);
console.log('[init][ensure_extensions_folder] Found extensions: ' + (AppStorage.get('extensions_ids') as string[]));
}
} catch (e) {
console.error('[init][ensure_extensions_folder] Error: ' + e);
}
}
|
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/processes/init_process.ets#L118-L145
|
b8a441d8e7539a18fcf5bca480ee17e942d2637f
|
gitee
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/pages/greetings/GreetingSendPage.ets
|
arkts
|
sendGreeting
|
发送祝福语
|
private async sendGreeting(): Promise<void> {
try {
if (!this.customContent.trim()) {
// TODO: 显示提示信息
return;
}
this.sending = true;
const request: GreetingSendRequest = {
contactId: this.contactId,
greetingId: this.selectedGreeting?.id,
content: this.customContent.trim(),
occasion: this.selectedOccasion,
style: this.selectedStyle,
method: this.sendMethod
};
const result = await this.greetingService.sendGreeting(request);
if (result.success) {
// TODO: 显示发送成功提示
appRouter.back();
} else {
// TODO: 显示发送失败提示
}
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to send greeting: ${error}`);
} finally {
this.sending = false;
}
}
|
AST#method_declaration#Left private async sendGreeting AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right . customContent AST#member_expression#Right AST#expression#Right . trim AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { // TODO: 显示提示信息 AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . sending AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left request : AST#type_annotation#Left AST#primary_type#Left GreetingSendRequest AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left contactId AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . contactId AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left greetingId AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . selectedGreeting AST#member_expression#Right AST#expression#Right ?. id AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left content AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customContent AST#member_expression#Right AST#expression#Right . trim AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left occasion AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . selectedOccasion AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left style AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . selectedStyle AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left method AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . sendMethod AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left result = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . greetingService AST#member_expression#Right AST#expression#Right . sendGreeting AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left request AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . success AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // TODO: 显示发送成功提示 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left appRouter AST#expression#Right . back AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { // TODO: 显示发送失败提示 } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to send greeting: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#finally_clause#Left finally AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . sending AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#finally_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
private async sendGreeting(): Promise<void> {
try {
if (!this.customContent.trim()) {
return;
}
this.sending = true;
const request: GreetingSendRequest = {
contactId: this.contactId,
greetingId: this.selectedGreeting?.id,
content: this.customContent.trim(),
occasion: this.selectedOccasion,
style: this.selectedStyle,
method: this.sendMethod
};
const result = await this.greetingService.sendGreeting(request);
if (result.success) {
appRouter.back();
} else {
}
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to send greeting: ${error}`);
} finally {
this.sending = false;
}
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/greetings/GreetingSendPage.ets#L134-L165
|
206576a6e61d430b573a8da88a95649d4269a13e
|
github
|
harmonyos-cases/cases
|
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
|
CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets
|
arkts
|
构造器
@param list
|
constructor(list: CardInfo[]) {
this.list = list;
}
|
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left list : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CardInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . list AST#member_expression#Right = AST#expression#Left list AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right
|
constructor(list: CardInfo[]) {
this.list = list;
}
|
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets#L27-L29
|
ebbef5e808c4bdb0ac43264c4816aadd8c83919b
|
gitee
|
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
harmonyos/src/main/ets/common/types/SettingsTypes.ets
|
arkts
|
备份频率枚举
|
export enum BackupFrequency {
DAILY = 'daily',
WEEKLY = 'weekly',
MONTHLY = 'monthly'
}
|
AST#export_declaration#Left export AST#enum_declaration#Left enum BackupFrequency AST#enum_body#Left { AST#enum_member#Left DAILY = AST#expression#Left 'daily' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left WEEKLY = AST#expression#Left 'weekly' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left MONTHLY = AST#expression#Left 'monthly' AST#expression#Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
|
export enum BackupFrequency {
DAILY = 'daily',
WEEKLY = 'weekly',
MONTHLY = 'monthly'
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/SettingsTypes.ets#L641-L645
|
6a6e6440a58febb53b89a9b715dc0108fa51b28e
|
github
|
|
openharmony/arkui_ace_engine
|
30c7d1ee12fbedf0fabece54291d75897e2ad44f
|
examples/Select/entry/src/main/ets/pages/components/select/selectDividerNormal.ets
|
arkts
|
SelectDividerOptionsBuilder
|
Copyright (c) 2025 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.
|
@Builder
export function SelectDividerOptionsBuilder(name: string, param: Object) {
SelectDividerOptionsExample()
}
|
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function SelectDividerOptionsBuilder AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left param : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left SelectDividerOptionsExample ( ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#decorated_export_declaration#Right
|
@Builder
export function SelectDividerOptionsBuilder(name: string, param: Object) {
SelectDividerOptionsExample()
}
|
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/select/selectDividerNormal.ets#L16-L19
|
1cf51ff2966168339c6289db69c93863062d861b
|
gitee
|
harmonyos-cases/cases
|
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
|
CommonAppDevelopment/feature/dragtoswitchpictures/src/main/ets/components/datasource/BasicDataSource.ets
|
arkts
|
实现IDataSource接口的对象
|
export abstract class BasicDataSource<T> implements IDataSource {
private listeners: DataChangeListener[] = [];
public totalCount(): number {
return 0;
}
public getData(index: number): T | void {
console.info('getData, index:'+index);
}
/**
* 该方法为框架侧调用,为LazyForEach组件向其数据源处添加listener监听
*/
registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
this.listeners.push(listener);
}
}
/**
* 该方法为框架侧调用,为对应的LazyForEach组件在数据源处去除listener监听
*/
unregisterDataChangeListener(listener: DataChangeListener): void {
const pos = this.listeners.indexOf(listener);
if (pos >= 0) {
this.listeners.splice(pos, 1);
}
}
/**
* 通知LazyForEach组件需要重载所有子组件
*/
notifyDataReload(): void {
this.listeners.forEach(listener => {
listener.onDataReloaded();
})
}
/**
* 通知LazyForEach组件需要在index对应索引处添加子组件
*/
notifyDataAdd(index: number): void {
this.listeners.forEach(listener => {
listener.onDataAdd(index);
})
}
/**
* 通知LazyForEach组件在index对应索引处数据有变化,需要重建该子组件
*/
notifyDataChange(index: number): void {
this.listeners.forEach(listener => {
listener.onDataChange(index);
})
}
/**
* 通知LazyForEach组件需要在index对应索引处删除该子组件
*/
notifyDataDelete(index: number): void {
this.listeners.forEach(listener => {
listener.onDataDelete(index);
})
}
/**
* 通知控制器数据位置变化
* @param from 起始位置
* @param to 最终位置
*/
notifyDataMove(from: number, to: number): void {
this.listeners.forEach(listener => {
listener.onDataMove(from, to);
})
}
}
|
AST#export_declaration#Left export AST#class_declaration#Left abstract class BasicDataSource AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#implements_clause#Left implements IDataSource AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left private listeners : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DataChangeListener [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#method_declaration#Left public totalCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left 0 AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left T AST#primary_type#Right | AST#primary_type#Left void AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left 'getData, index:' AST#expression#Right + AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /**
* 该方法为框架侧调用,为LazyForEach组件向其数据源处添加listener监听
*/ AST#method_declaration#Left registerDataChangeListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left DataChangeListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . indexOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right < AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right /**
* 该方法为框架侧调用,为对应的LazyForEach组件在数据源处去除listener监听
*/ AST#method_declaration#Left unregisterDataChangeListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left DataChangeListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left pos = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . indexOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left pos AST#expression#Right >= AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . splice AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left pos AST#expression#Right , AST#expression#Left 1 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /**
* 通知LazyForEach组件需要重载所有子组件
*/ AST#method_declaration#Left notifyDataReload AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataReloaded AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /**
* 通知LazyForEach组件需要在index对应索引处添加子组件
*/ AST#method_declaration#Left notifyDataAdd AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataAdd AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /**
* 通知LazyForEach组件在index对应索引处数据有变化,需要重建该子组件
*/ AST#method_declaration#Left notifyDataChange AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataChange AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /**
* 通知LazyForEach组件需要在index对应索引处删除该子组件
*/ AST#method_declaration#Left notifyDataDelete AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataDelete AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right /**
* 通知控制器数据位置变化
* @param from 起始位置
* @param to 最终位置
*/ AST#method_declaration#Left notifyDataMove AST#parameter_list#Left ( AST#parameter#Left from : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left to : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataMove AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left from AST#expression#Right , AST#expression#Left to AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export abstract class BasicDataSource<T> implements IDataSource {
private listeners: DataChangeListener[] = [];
public totalCount(): number {
return 0;
}
public getData(index: number): T | void {
console.info('getData, index:'+index);
}
registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
this.listeners.push(listener);
}
}
unregisterDataChangeListener(listener: DataChangeListener): void {
const pos = this.listeners.indexOf(listener);
if (pos >= 0) {
this.listeners.splice(pos, 1);
}
}
notifyDataReload(): void {
this.listeners.forEach(listener => {
listener.onDataReloaded();
})
}
notifyDataAdd(index: number): void {
this.listeners.forEach(listener => {
listener.onDataAdd(index);
})
}
notifyDataChange(index: number): void {
this.listeners.forEach(listener => {
listener.onDataChange(index);
})
}
notifyDataDelete(index: number): void {
this.listeners.forEach(listener => {
listener.onDataDelete(index);
})
}
notifyDataMove(from: number, to: number): void {
this.listeners.forEach(listener => {
listener.onDataMove(from, to);
})
}
}
|
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/dragtoswitchpictures/src/main/ets/components/datasource/BasicDataSource.ets#L19-L95
|
966faf0b3f9d9d809fdf0c3ded9107f407a38a4f
|
gitee
|
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/services/calendar/LunarSolarMappingService.ets
|
arkts
|
getLunarBirthdaysInSolarMonth
|
获取指定月份的所有农历生日
|
async getLunarBirthdaysInSolarMonth(year: number, solarMonth: number): Promise<LunarSolarMapping[]> {
await this.ensureYearMapping(year);
const yearData = this.mappingCache.get(year);
if (!yearData) return [];
const result: LunarSolarMapping[] = [];
for (const mapping of yearData.solarToLunar.values()) {
if (mapping.solarMonth === solarMonth) {
result.push(mapping);
}
}
return result.sort((a, b) => a.solarDay - b.solarDay);
}
|
AST#method_declaration#Left async getLunarBirthdaysInSolarMonth AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left solarMonth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left LunarSolarMapping [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . ensureYearMapping AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left year AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left yearData = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mappingCache AST#member_expression#Right AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left year AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left yearData AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left result : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left LunarSolarMapping [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( const mapping of AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left yearData AST#expression#Right . solarToLunar AST#member_expression#Right AST#expression#Right . values AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left mapping AST#expression#Right . solarMonth AST#member_expression#Right AST#expression#Right === AST#expression#Left solarMonth AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left mapping AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . sort AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left a AST#parameter#Right , AST#parameter#Left b AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left a AST#expression#Right . solarDay AST#member_expression#Right AST#expression#Right - AST#expression#Left b AST#expression#Right AST#binary_expression#Right AST#expression#Right . solarDay AST#member_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
async getLunarBirthdaysInSolarMonth(year: number, solarMonth: number): Promise<LunarSolarMapping[]> {
await this.ensureYearMapping(year);
const yearData = this.mappingCache.get(year);
if (!yearData) return [];
const result: LunarSolarMapping[] = [];
for (const mapping of yearData.solarToLunar.values()) {
if (mapping.solarMonth === solarMonth) {
result.push(mapping);
}
}
return result.sort((a, b) => a.solarDay - b.solarDay);
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/calendar/LunarSolarMappingService.ets#L243-L258
|
709735b593475b77befe13b1f3f9fb31918c3096
|
github
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
harmonyos/src/main/ets/pages/CalendarPage.ets
|
arkts
|
getLunarDay
|
获取农历日期
|
private getLunarDay(dateString: string): string {
try {
const lunarDate = this.lunarService.solarToLunar(dateString);
return lunarDate ? lunarDate.dayName : '';
} catch (error) {
return '';
}
}
|
AST#method_declaration#Left private getLunarDay AST#parameter_list#Left ( AST#parameter#Left dateString : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left lunarDate = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lunarService AST#member_expression#Right AST#expression#Right . solarToLunar AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left dateString AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#conditional_expression#Left AST#expression#Left lunarDate AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left lunarDate AST#expression#Right . dayName AST#member_expression#Right AST#expression#Right : AST#expression#Left '' AST#expression#Right AST#conditional_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left '' AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
private getLunarDay(dateString: string): string {
try {
const lunarDate = this.lunarService.solarToLunar(dateString);
return lunarDate ? lunarDate.dayName : '';
} catch (error) {
return '';
}
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/CalendarPage.ets#L146-L153
|
9cce6cb02bc22585383595e73bacaaa3d8c37590
|
github
|
tongyuyan/harmony-utils
|
697472f011a43e783eeefaa28ef9d713c4171726
|
harmony_web/src/main/ets/utils/FileUtils.ets
|
arkts
|
writeEasy
|
将数据写入文件,并关闭文件。
@param path string 文件的应用沙箱路径或URI。
@param buffer ArrayBuffer|string 待写入文件的数据,可来自缓冲区或字符串。
@param append 是否追加,true-追加,false-不追加(直接覆盖)
@returns Promise对象。返回实际写入的数据长度,单位字节。
|
static async writeEasy(path: string, buffer: ArrayBuffer | string, append: boolean = true): Promise<number> {
const file = FileUtils.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
const offset = append ? FileUtils.statSync(file.fd).size : 0
const options: WriteOptions = { offset: offset, encoding: 'utf-8' };
let result = await FileUtils.write(file.fd, buffer, options);
FileUtils.close(file.fd); //关闭文件
return result;
}
|
AST#method_declaration#Left static async writeEasy AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left buffer : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left append : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left file = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left FileUtils AST#expression#Right . openSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left path AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . READ_WRITE AST#member_expression#Right AST#expression#Right | AST#expression#Left fs AST#expression#Right AST#binary_expression#Right AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . CREATE AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left offset = AST#expression#Left AST#conditional_expression#Left AST#expression#Left append AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left FileUtils AST#expression#Right . statSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left file AST#expression#Right . fd AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . size AST#member_expression#Right AST#expression#Right : AST#expression#Left 0 AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left options : AST#type_annotation#Left AST#primary_type#Left WriteOptions AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left offset AST#property_name#Right : AST#expression#Left offset AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left encoding AST#property_name#Right : AST#expression#Left 'utf-8' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left result = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left FileUtils AST#expression#Right AST#await_expression#Right AST#expression#Right . write AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left file AST#expression#Right . fd AST#member_expression#Right AST#expression#Right , AST#expression#Left buffer AST#expression#Right , AST#expression#Left options AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left FileUtils AST#expression#Right . close AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left file AST#expression#Right . fd AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right //关闭文件 AST#statement#Left AST#return_statement#Left return AST#expression#Left result AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static async writeEasy(path: string, buffer: ArrayBuffer | string, append: boolean = true): Promise<number> {
const file = FileUtils.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
const offset = append ? FileUtils.statSync(file.fd).size : 0
const options: WriteOptions = { offset: offset, encoding: 'utf-8' };
let result = await FileUtils.write(file.fd, buffer, options);
FileUtils.close(file.fd);
return result;
}
|
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/FileUtils.ets#L491-L498
|
7f59742c43d740c62f5ad96816875a5b40266be0
|
gitee
|
Joker-x-dev/HarmonyKit.git
|
f97197ce157df7f303244fba42e34918306dfb08
|
core/network/src/main/ets/interceptors/LogInterceptor.ets
|
arkts
|
logLines
|
按行与长度分割日志,避免单条日志过长被截断
@param {"info" | "error"} level - 日志级别
@param {string[]} lines - 日志行
@returns {void} 无返回值
|
function logLines(level: "info" | "error", lines: string[]): void {
const logger: (domain: number, tag: string, format: string, content: string) => void =
level === "error" ? hilog.error : hilog.info;
lines.forEach((line: string) => {
splitLines(line).forEach((segment: string) => {
splitChunks(segment, MAX_LOG_LENGTH).forEach((chunk: string) => {
logger(DOMAIN, TAG, "%{public}s", chunk);
});
});
});
}
|
AST#function_declaration#Left function logLines AST#parameter_list#Left ( AST#parameter#Left level AST#parameter#Right AST#ERROR#Left : "info" | "error" AST#ERROR#Right , AST#parameter#Left lines : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left logger : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left domain : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left tag : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left format : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left content : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left level AST#expression#Right === AST#expression#Left "error" AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right : AST#expression#Left hilog AST#expression#Right AST#conditional_expression#Right AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left lines AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left line : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left splitLines AST#expression#Right AST#argument_list#Left ( AST#expression#Left line AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left segment : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left splitChunks AST#expression#Right AST#argument_list#Left ( AST#expression#Left segment AST#expression#Right , AST#expression#Left MAX_LOG_LENGTH AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left chunk : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left logger AST#expression#Right AST#argument_list#Left ( AST#expression#Left DOMAIN AST#expression#Right , AST#expression#Left TAG AST#expression#Right , AST#expression#Left "%{public}s" AST#expression#Right , AST#expression#Left chunk AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right
|
function logLines(level: "info" | "error", lines: string[]): void {
const logger: (domain: number, tag: string, format: string, content: string) => void =
level === "error" ? hilog.error : hilog.info;
lines.forEach((line: string) => {
splitLines(line).forEach((segment: string) => {
splitChunks(segment, MAX_LOG_LENGTH).forEach((chunk: string) => {
logger(DOMAIN, TAG, "%{public}s", chunk);
});
});
});
}
|
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/network/src/main/ets/interceptors/LogInterceptor.ets#L194-L204
|
4ed9ced63e65ea8ca68bfb97fb0164d84e18fac0
|
github
|
RicardoWesleyli/HarmonyNEXT_Examples.git
|
6a9cc1a06e3c7b126faa61ccf1b91ac6cea47670
|
Chapter6/entry/src/main/ets/pages/Index.ets
|
arkts
|
futureWeatherItem
|
时段天气组件代码块
|
@Builder
futureWeatherItem(timeSlot:string,weather:string,temp:string){
Column({space:10}){
this.textView(timeSlot,22,600,Color.White)
this.textView(weather,22,600,Color.White)
this.textView(temp,22,600,Color.White)
}
}
|
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right futureWeatherItem AST#parameter_list#Left ( AST#parameter#Left timeSlot : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left weather : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left temp : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 10 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textView AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left timeSlot AST#expression#Right , AST#expression#Left 22 AST#expression#Right , AST#expression#Left 600 AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textView AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left weather AST#expression#Right , AST#expression#Left 22 AST#expression#Right , AST#expression#Left 600 AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textView AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left temp AST#expression#Right , AST#expression#Left 22 AST#expression#Right , AST#expression#Left 600 AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
@Builder
futureWeatherItem(timeSlot:string,weather:string,temp:string){
Column({space:10}){
this.textView(timeSlot,22,600,Color.White)
this.textView(weather,22,600,Color.White)
this.textView(temp,22,600,Color.White)
}
}
|
https://github.com/RicardoWesleyli/HarmonyNEXT_Examples.git/blob/6a9cc1a06e3c7b126faa61ccf1b91ac6cea47670/Chapter6/entry/src/main/ets/pages/Index.ets#L65-L72
|
6b7e597605c578b6e32e07a765dbeee8f27da02a
|
github
|
Joker-x-dev/HarmonyKit.git
|
f97197ce157df7f303244fba42e34918306dfb08
|
core/navigation/src/main/ets/NavigationService.ets
|
arkts
|
@file 全局导航服务:集中存放 NavPathStack,提供统一跳转 API,方便 ViewModel 直接调用
@author Joker.X
Provider / Consumer 共享的键名
|
export const NAV_PATH_STACK_KEY: string = "navStack";
|
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left NAV_PATH_STACK_KEY : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "navStack" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
|
export const NAV_PATH_STACK_KEY: string = "navStack";
|
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/navigation/src/main/ets/NavigationService.ets#L14-L14
|
58206e28c695c752e5100d0d7f49ee39db79b8ca
|
github
|
|
tongyuyan/harmony-utils
|
697472f011a43e783eeefaa28ef9d713c4171726
|
harmony_utils/src/main/ets/utils/TypeUtil.ets
|
arkts
|
isWeakMap
|
检查是否为WeakMap类型。
@param value
@returns
|
static isWeakMap(value: Object): boolean {
return new util.types().isWeakMap(value);
}
|
AST#method_declaration#Left static isWeakMap AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left util AST#expression#Right AST#new_expression#Right AST#expression#Right . types AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . isWeakMap AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static isWeakMap(value: Object): boolean {
return new util.types().isWeakMap(value);
}
|
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/TypeUtil.ets#L106-L108
|
84290f227c79f94c532810741ad8deb46ea1f885
|
gitee
|
common-apps/ZRouter
|
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
|
RouterApi/src/main/ets/animation/NavAnimationMgr.ets
|
arkts
|
registerAnimParam
|
注册路由转场动画,设置相关参数
@param modifier
@param ctx
@param param
|
public registerAnimParam(component: object, ctx: NavDestinationContext): NavAnimParamBuilder {
return NavAnimationStore.getInstance().buildAnimParam(component, ctx)
}
|
AST#method_declaration#Left public registerAnimParam AST#parameter_list#Left ( AST#parameter#Left component : AST#type_annotation#Left AST#primary_type#Left object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left ctx : AST#type_annotation#Left AST#primary_type#Left NavDestinationContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left NavAnimParamBuilder AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left NavAnimationStore AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . buildAnimParam AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left component AST#expression#Right , AST#expression#Left ctx AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
public registerAnimParam(component: object, ctx: NavDestinationContext): NavAnimParamBuilder {
return NavAnimationStore.getInstance().buildAnimParam(component, ctx)
}
|
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/NavAnimationMgr.ets#L82-L84
|
b2b2a270c90a53d16bf210232c0baa35afd6f6d5
|
gitee
|
yunkss/ef-tool
|
75f6761a0f2805d97183504745bf23c975ae514d
|
ef_crypto/src/main/ets/crypto/util/CryptoUtil.ets
|
arkts
|
encodeECB
|
加密-ECB模式
@param str 待加密的字符串
@param key 给定秘钥规格密钥
@param symAlgName 秘钥规格
@param symEncryptName 加密规格
@returns
|
static async encodeECB(str: string, key: string, symAlgName: string, symEncryptName: string,
keyName: number): Promise<string> {
//转换key
let symKey = await CryptoUtil.convertKeyFromStr(key, symAlgName, keyName);
// 初始化加解密操作环境
let mode = crypto.CryptoMode.ENCRYPT_MODE;
//创建加密器
let cipher = crypto.createCipher(symEncryptName);
//初始化加密
await cipher.init(mode, symKey, null);
//封装加密所需数据
let encode = new util.TextEncoder();
//开始加密
let updateOutput = await cipher.doFinal({ data: encode.encodeInto(str) });
//转换字符串
return StrAndUintUtil.unitArray2String(updateOutput.data);
}
|
AST#method_declaration#Left static async encodeECB AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symAlgName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symEncryptName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left keyName : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { //转换key AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left symKey = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left CryptoUtil AST#expression#Right AST#await_expression#Right AST#expression#Right . convertKeyFromStr AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left key AST#expression#Right , AST#expression#Left symAlgName AST#expression#Right , AST#expression#Left keyName AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 初始化加解密操作环境 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left mode = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left crypto AST#expression#Right . CryptoMode AST#member_expression#Right AST#expression#Right . ENCRYPT_MODE AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //创建加密器 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left cipher = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left crypto AST#expression#Right . createCipher AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left symEncryptName AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //初始化加密 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left cipher AST#expression#Right AST#await_expression#Right AST#expression#Right . init AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left mode AST#expression#Right , AST#expression#Left symKey AST#expression#Right , AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right //封装加密所需数据 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left encode = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left util AST#expression#Right AST#new_expression#Right AST#expression#Right . TextEncoder AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //开始加密 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left updateOutput = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left cipher AST#expression#Right AST#await_expression#Right AST#expression#Right . doFinal AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left data AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left encode AST#expression#Right . encodeInto AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //转换字符串 AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left StrAndUintUtil AST#expression#Right . unitArray2String AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left updateOutput AST#expression#Right . data AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static async encodeECB(str: string, key: string, symAlgName: string, symEncryptName: string,
keyName: number): Promise<string> {
let symKey = await CryptoUtil.convertKeyFromStr(key, symAlgName, keyName);
let mode = crypto.CryptoMode.ENCRYPT_MODE;
let cipher = crypto.createCipher(symEncryptName);
await cipher.init(mode, symKey, null);
let encode = new util.TextEncoder();
let updateOutput = await cipher.doFinal({ data: encode.encodeInto(str) });
return StrAndUintUtil.unitArray2String(updateOutput.data);
}
|
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/util/CryptoUtil.ets#L147-L163
|
f39e2977681ee577c15c39af65e2edc0234dafd1
|
gitee
|
openharmony-tpc/ImageKnife
|
bc55de9e2edd79ed4646ce37177ad94b432874f7
|
library/src/main/ets/ImageKnife.ets
|
arkts
|
deleteHeader
|
删除单个请求头header
@param key 请求头属性
|
deleteHeader(key: string) {
this.headerMap.delete(key)
}
|
AST#method_declaration#Left deleteHeader AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . headerMap AST#member_expression#Right AST#expression#Right . delete AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left key AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
deleteHeader(key: string) {
this.headerMap.delete(key)
}
|
https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/ImageKnife.ets#L116-L118
|
63c5133b9f62de1f680067afa74b2ff2d455edc5
|
gitee
|
openharmony/applications_app_samples
|
a826ab0e75fe51d028c1c5af58188e908736b53b
|
code/BasicFeature/Connectivity/MultipleFilesDownload/casesfeature/multiplefilesdownload/src/main/ets/view/MultipleFilesDownload.ets
|
arkts
|
loadInitializationDataSource
|
读取historyDownloadResourceData.json中的数据源
|
loadInitializationDataSource() {
const context: Context = getContext(this);
// 读取historyDownloadResourceData.json中的数据
let jsonData: Uint8Array = context.resourceManager.getRawFileContentSync('historyDownloadResourceData.json');
// 将数据解码,转成字符串
let stringData: string = util.TextDecoder.create('utf-8').decodeToString(jsonData);
let data: [] = JSON.parse(stringData) as [];
for (let i = 0; i < data.length; i++) {
const downloadItemData = data[i] as downloadFilesData;
let downloadData: downloadFilesData = new downloadFilesData(downloadItemData.url, downloadItemData.fileStatus,
downloadItemData.downloadTime);
// 将数据存入下载列表
this.downloadFileArray.push(downloadData);
}
}
|
AST#method_declaration#Left loadInitializationDataSource AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left getContext AST#expression#Right AST#argument_list#Left ( AST#expression#Left this AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 读取historyDownloadResourceData.json中的数据 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left jsonData : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left context AST#expression#Right . resourceManager AST#member_expression#Right AST#expression#Right . getRawFileContentSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'historyDownloadResourceData.json' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 将数据解码,转成字符串 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left stringData : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left util AST#expression#Right . TextDecoder AST#member_expression#Right AST#expression#Right . create AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'utf-8' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . decodeToString AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left jsonData AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left data : AST#type_annotation#Left AST#primary_type#Left AST#tuple_type#Left [ ] AST#tuple_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . parse AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left stringData AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left AST#tuple_type#Left [ ] AST#tuple_type#Right AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left data AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left downloadItemData = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left data AST#expression#Right [ AST#expression#Left i AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left downloadFilesData AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left downloadData : AST#type_annotation#Left AST#primary_type#Left downloadFilesData AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left downloadFilesData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left downloadItemData AST#expression#Right . url AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left downloadItemData AST#expression#Right . fileStatus AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left downloadItemData AST#expression#Right . downloadTime AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 将数据存入下载列表 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . downloadFileArray AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left downloadData AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
loadInitializationDataSource() {
const context: Context = getContext(this);
let jsonData: Uint8Array = context.resourceManager.getRawFileContentSync('historyDownloadResourceData.json');
let stringData: string = util.TextDecoder.create('utf-8').decodeToString(jsonData);
let data: [] = JSON.parse(stringData) as [];
for (let i = 0; i < data.length; i++) {
const downloadItemData = data[i] as downloadFilesData;
let downloadData: downloadFilesData = new downloadFilesData(downloadItemData.url, downloadItemData.fileStatus,
downloadItemData.downloadTime);
this.downloadFileArray.push(downloadData);
}
}
|
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/MultipleFilesDownload/casesfeature/multiplefilesdownload/src/main/ets/view/MultipleFilesDownload.ets#L125-L140
|
557790deb268607f7ab9cd55dbbc35ad3c53f462
|
gitee
|
KoStudio/ArkTS-WordTree.git
|
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
|
entry/src/main/ets/app/constants/AppTheme.ets
|
arkts
|
========================== 绿色配色实现 ==========================
|
export class ColorGreen implements ColorPalette {
primary : ResourceColor = $r('app.color.colorPrimary') // '#2AA940'
secondary : ResourceColor = $r('app.color.colorPrimaryDark') // '#37633F'
accent : ResourceColor = $r('app.color.colorAccent') // '#DD4236'
accent2 : ResourceColor = $r('app.color.colorAccent2') // '#F9948C'
obscure : ResourceColor = $r('app.color.color_obscure') // '#EFEFF4'
background : ResourceColor = $r('app.color.color_background') // '#EFEFF4'
light : ResourceColor = $r('app.color.color_light') // '#FFFFFF'
clear : ResourceColor = $r('app.color.color_clear') // '#00000000'
link : ResourceColor = $r('app.color.color_link') // '#5C8AC0'
line : ResourceColor = $r('app.color.color_line') // '#D3D4D7'
dark : ResourceColor = $r('app.color.color_dark') // '#000000'
text : ResourceColor = $r('app.color.color_text') // '#000000'
text2 : ResourceColor = $r('app.color.color_text2') // '#A9A9A9' 替代 lightGray
}
|
AST#export_declaration#Left export AST#class_declaration#Left class ColorGreen AST#implements_clause#Left implements ColorPalette AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left primary AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.colorPrimary' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#2AA940' secondary : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.colorPrimaryDark' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#37633F' accent : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.colorAccent' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#DD4236' accent 2 : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.colorAccent2' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#F9948C' obscure : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_obscure' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#EFEFF4' background : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_background' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#EFEFF4' light : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_light' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#FFFFFF' clear AST#ERROR#Right : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_clear' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#00000000' AST#ERROR#Left l AST#ERROR#Right in AST#expression#Left AST#assignment_expression#Left k AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_link' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#5C8AC0' AST#ERROR#Left l AST#ERROR#Right in AST#expression#Left AST#assignment_expression#Left e AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_line' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#D3D4D7' dark : ResourceColor = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_dark' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#000000' text : ResourceColor = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_text' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right // '#000000' text 2 : ResourceColor AST#ERROR#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.color_text2' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right // '#A9A9A9' 替代 lightGray AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export class ColorGreen implements ColorPalette {
primary : ResourceColor = $r('app.color.colorPrimary')
secondary : ResourceColor = $r('app.color.colorPrimaryDark')
accent : ResourceColor = $r('app.color.colorAccent')
accent2 : ResourceColor = $r('app.color.colorAccent2')
obscure : ResourceColor = $r('app.color.color_obscure')
background : ResourceColor = $r('app.color.color_background')
light : ResourceColor = $r('app.color.color_light')
clear : ResourceColor = $r('app.color.color_clear')
link : ResourceColor = $r('app.color.color_link')
line : ResourceColor = $r('app.color.color_line')
dark : ResourceColor = $r('app.color.color_dark')
text : ResourceColor = $r('app.color.color_text')
text2 : ResourceColor = $r('app.color.color_text2')
}
|
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/constants/AppTheme.ets#L35-L50
|
a5dfd7f90a50f8c8ef02da44f8a95257d1df276e
|
github
|
|
Huarrrr/MiShop_HarmonyOS.git
|
a94d941f50550522c8324416afe4551ed4a2df93
|
entry/src/main/ets/widgets/BannerBuilder.ets
|
arkts
|
BannerBuilder
|
轮播图组件
|
@Component
export struct BannerBuilder {
private swiperController: SwiperController = new SwiperController()
@State private bannerPosition: number = 0
bannerList: Array<Banner>
build() {
Swiper(this.swiperController) {
ForEach(this.bannerList, (item) => {
this.BannerItemBuilder(item)
})
}
.autoPlay(true)
.index(this.bannerPosition)
.loop(true)
.indicatorStyle({
size: 12,
color: $r("app.color.hot_key_bg"),
selectedColor: $r("app.color.navi_tab_unselect"),
bottom: 0
})
.onChange((index) => {
this.bannerPosition = index;
})
.width('100%')
.height(180)
}
@Builder
BannerItemBuilder(data: Banner) {
Stack({ alignContent: Alignment.Bottom }) {
//TODO 模拟器无法显示png,等官方处理
Image("https://lmg.jj20.com/up/allimg/1112/04051Z03929/1Z405003929-4-1200.jpg") //getBaseImgUrl(data.pic)
.objectFit(ImageFit.Cover).alt($r('app.media.icon'))
.width('100%')
.height('100%')
}
.width('100%')
.height('100%')
.onClick(() => {
toast(data.url)
})
}
}
|
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct BannerBuilder AST#component_body#Left { AST#property_declaration#Left private swiperController : AST#type_annotation#Left AST#primary_type#Left SwiperController AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left SwiperController AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right private bannerPosition AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right banner List AST#ERROR#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left Banner AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Swiper ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . swiperController AST#member_expression#Right AST#expression#Right ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#for_each_statement#Left ForEach ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . bannerList AST#member_expression#Right AST#expression#Right , AST#ui_builder_arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left item AST#parameter#Right ) AST#parameter_list#Right => AST#ui_arrow_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . BannerItemBuilder AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left item AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#ui_arrow_function_body#Right AST#ui_builder_arrow_function#Right ) AST#for_each_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . autoPlay ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . index ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . bannerPosition AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . loop ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . indicatorStyle ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left size AST#property_name#Right : AST#expression#Left 12 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left color AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.color.hot_key_bg" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left selectedColor AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.color.navi_tab_unselect" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onChange ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left index AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . bannerPosition AST#member_expression#Right = AST#expression#Left index AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 180 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#build_body#Right AST#build_method#Right AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right BannerItemBuilder AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Banner AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Stack ( AST#component_parameters#Left { AST#component_parameter#Left alignContent : AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . Bottom AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { //TODO 模拟器无法显示png,等官方处理 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left "https://lmg.jj20.com/up/allimg/1112/04051Z03929/1Z405003929-4-1200.jpg" AST#expression#Right ) AST#ui_component#Right //getBaseImgUrl(data.pic) AST#modifier_chain_expression#Left . objectFit ( AST#expression#Left AST#member_expression#Left AST#expression#Left ImageFit AST#expression#Right . Cover AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . alt ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.icon' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left toast AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . url AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right } AST#component_body#Right AST#decorated_export_declaration#Right
|
@Component
export struct BannerBuilder {
private swiperController: SwiperController = new SwiperController()
@State private bannerPosition: number = 0
bannerList: Array<Banner>
build() {
Swiper(this.swiperController) {
ForEach(this.bannerList, (item) => {
this.BannerItemBuilder(item)
})
}
.autoPlay(true)
.index(this.bannerPosition)
.loop(true)
.indicatorStyle({
size: 12,
color: $r("app.color.hot_key_bg"),
selectedColor: $r("app.color.navi_tab_unselect"),
bottom: 0
})
.onChange((index) => {
this.bannerPosition = index;
})
.width('100%')
.height(180)
}
@Builder
BannerItemBuilder(data: Banner) {
Stack({ alignContent: Alignment.Bottom }) {
Image("https://lmg.jj20.com/up/allimg/1112/04051Z03929/1Z405003929-4-1200.jpg")
.objectFit(ImageFit.Cover).alt($r('app.media.icon'))
.width('100%')
.height('100%')
}
.width('100%')
.height('100%')
.onClick(() => {
toast(data.url)
})
}
}
|
https://github.com/Huarrrr/MiShop_HarmonyOS.git/blob/a94d941f50550522c8324416afe4551ed4a2df93/entry/src/main/ets/widgets/BannerBuilder.ets#L5-L48
|
e035d514c67dc008c96b0103b559e8e50ce014f8
|
github
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/common/types/SettingsTypes.ets
|
arkts
|
高级配置接口
|
export interface AdvancedConfig {
developer: DeveloperConfig;
experimental: ExperimentalConfig;
network: NetworkConfig;
performance: PerformanceConfig;
}
|
AST#export_declaration#Left export AST#interface_declaration#Left interface AdvancedConfig AST#object_type#Left { AST#type_member#Left developer : AST#type_annotation#Left AST#primary_type#Left DeveloperConfig AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left experimental : AST#type_annotation#Left AST#primary_type#Left ExperimentalConfig AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left network : AST#type_annotation#Left AST#primary_type#Left NetworkConfig AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left performance : AST#type_annotation#Left AST#primary_type#Left PerformanceConfig AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
|
export interface AdvancedConfig {
developer: DeveloperConfig;
experimental: ExperimentalConfig;
network: NetworkConfig;
performance: PerformanceConfig;
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L448-L453
|
91ba74ca007a4c4641c391a1833c0a4d824079d5
|
github
|
|
openharmony/applications_app_samples
|
a826ab0e75fe51d028c1c5af58188e908736b53b
|
code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets
|
arkts
|
createRouter
|
通过名称注册router
|
public static createRouter(routerName: string, router: NavPathStack): void{
RouterModule.routerMap.set(routerName, router);
}
|
AST#method_declaration#Left public static createRouter AST#parameter_list#Left ( AST#parameter#Left routerName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left router : AST#type_annotation#Left AST#primary_type#Left NavPathStack AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left RouterModule AST#expression#Right . routerMap AST#member_expression#Right AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left routerName AST#expression#Right , AST#expression#Left router AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
public static createRouter(routerName: string, router: NavPathStack): void{
RouterModule.routerMap.set(routerName, router);
}
|
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets#L31-L33
|
38cd47489a0a9106aa9115beecea871c39c5699a
|
gitee
|
openharmony/applications_app_samples
|
a826ab0e75fe51d028c1c5af58188e908736b53b
|
code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/controller/LoginController.ets
|
arkts
|
closeSocket
|
关闭Socket
|
public closeSocket(): void {
this.mSocket?.closeSocket();
}
|
AST#method_declaration#Left public closeSocket AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mSocket AST#member_expression#Right AST#expression#Right ?. closeSocket AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
public closeSocket(): void {
this.mSocket?.closeSocket();
}
|
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/controller/LoginController.ets#L113-L115
|
45d2f6edcbd06dd852dcef18a9790723035ea7e5
|
gitee
|
liuchao0739/arkTS_universal_starter.git
|
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
|
entry/src/main/ets/utils/CommonUtils.ets
|
arkts
|
throttle
|
节流函数
|
static throttle<T extends (...args: any[]) => any>(
func: T,
wait: number
): (...args: Parameters<T>) => void {
let lastTime = 0;
return function (this: any, ...args: Parameters<T>) {
const now = Date.now();
if (now - lastTime >= wait) {
lastTime = now;
func.apply(this, args);
}
};
}
|
AST#method_declaration#Left static throttle AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left ... args : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left any [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left any AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left func : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left wait : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left ... args : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Parameters AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left lastTime = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#function_expression#Left function AST#parameter_list#Left ( AST#parameter#Left this : AST#type_annotation#Left AST#primary_type#Left any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left ... args : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Parameters AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left now = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Date AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left now AST#expression#Right - AST#expression#Left lastTime AST#expression#Right AST#binary_expression#Right AST#expression#Right >= AST#expression#Left wait AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left lastTime = AST#expression#Left now AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left func AST#expression#Right . apply AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left this AST#expression#Right , AST#expression#Left args AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static throttle<T extends (...args: any[]) => any>(
func: T,
wait: number
): (...args: Parameters<T>) => void {
let lastTime = 0;
return function (this: any, ...args: Parameters<T>) {
const now = Date.now();
if (now - lastTime >= wait) {
lastTime = now;
func.apply(this, args);
}
};
}
|
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/CommonUtils.ets#L45-L57
|
5b93c07d5b40fbafda7fb88d848bcd071ff64f40
|
github
|
tongyuyan/harmony-utils
|
697472f011a43e783eeefaa28ef9d713c4171726
|
harmony_utils/src/main/ets/action/DialogUtil.ets
|
arkts
|
initDialogDefault
|
初始化DialogOptions参数
@param options
|
private static initDialogDefault(options: DialogOptions) {
options.title = options.title ?? DialogUtil.defaultConfig.title;
options.subtitle = options.subtitle ?? DialogUtil.defaultConfig.subtitle;
options.alignment = options.alignment ?? DialogUtil.defaultConfig.alignment;
options.offset = options.offset ?? DialogUtil.defaultConfig.offset;
options.gridCount = options.gridCount ?? DialogUtil.defaultConfig.gridCount;
options.maskRect = options.maskRect ?? DialogUtil.defaultConfig.maskRect;
options.showInSubWindow = options.showInSubWindow ?? DialogUtil.defaultConfig.showInSubWindow;
options.isModal = options.isModal ?? DialogUtil.defaultConfig.isModal;
options.backgroundColor = options.backgroundColor ?? DialogUtil.defaultConfig.backgroundColor;
options.backgroundBlurStyle = options.backgroundBlurStyle ?? DialogUtil.defaultConfig.backgroundBlurStyle;
options.cornerRadius = options.cornerRadius ?? DialogUtil.defaultConfig.cornerRadius;
options.borderWidth = options.borderWidth ?? DialogUtil.defaultConfig.borderWidth;
options.borderColor = options.borderColor ?? DialogUtil.defaultConfig.borderColor;
options.borderStyle = options.borderStyle ?? DialogUtil.defaultConfig.borderStyle;
options.shadow = options.shadow ?? DialogUtil.defaultConfig.shadow;
options.textStyle = options.textStyle ?? DialogUtil.defaultConfig.textStyle;
options.transition = options.transition ?? DialogUtil.defaultConfig.transition;
options.width = options.width ?? DialogUtil.defaultConfig.width;
options.height = options.height ?? DialogUtil.defaultConfig.height;
options.autoCancel = options.autoCancel ?? DialogUtil.defaultConfig.autoCancel; //点击遮障层时,是否关闭弹窗。
options.backCancel = options.backCancel ?? DialogUtil.defaultConfig.backCancel; //点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。
options.enableHoverMode = options.enableHoverMode ?? DialogUtil.defaultConfig.enableHoverMode;
options.hoverModeArea = options.hoverModeArea ?? DialogUtil.defaultConfig.hoverModeArea;
options.levelMode = options.levelMode ?? DialogUtil.defaultConfig.levelMode;
options.immersiveMode = options.immersiveMode ?? DialogUtil.defaultConfig.immersiveMode;
const cancelFun = options.cancel;
options.cancel = () => {
if (cancelFun) {
cancelFun()
}
};
const onWillDismissFun = options.onWillDismiss;
options.onWillDismiss = (action: DismissDialogAction) => {
if (onWillDismissFun) {
onWillDismissFun(action);
} else {
if (action.reason == DismissReason.PRESS_BACK && options.backCancel) {
action.dismiss()
} else if (action.reason == DismissReason.TOUCH_OUTSIDE && options.autoCancel) {
action.dismiss()
}
}
};
}
|
AST#method_declaration#Left private static initDialogDefault AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left DialogOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . title AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . title AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . title AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . subtitle AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . subtitle AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . subtitle AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . alignment AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . alignment AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . alignment AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . offset AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . offset AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . offset AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . gridCount AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . gridCount AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . gridCount AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . maskRect AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . maskRect AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . maskRect AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . showInSubWindow AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . showInSubWindow AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . showInSubWindow AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . isModal AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . isModal AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . isModal AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . backgroundColor AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . backgroundColor AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . backgroundColor AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . backgroundBlurStyle AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . backgroundBlurStyle AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . backgroundBlurStyle AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . cornerRadius AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . cornerRadius AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . cornerRadius AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . borderWidth AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . borderWidth AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . borderWidth AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . borderColor AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . borderColor AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . borderColor AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . borderStyle AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . borderStyle AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . borderStyle AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . shadow AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . shadow AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . shadow AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . textStyle AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . textStyle AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . textStyle AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . transition AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . transition AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . transition AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . width AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . width AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . height AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . height AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . autoCancel AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . autoCancel AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . autoCancel AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right //点击遮障层时,是否关闭弹窗。 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . backCancel AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . backCancel AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . backCancel AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right //点击返回键或手势返回时,是否关闭弹窗;实现onWillDismiss函数时,该参数不起作用。 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . enableHoverMode AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . enableHoverMode AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . enableHoverMode AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . hoverModeArea AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . hoverModeArea AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . hoverModeArea AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . levelMode AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . levelMode AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . levelMode AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . immersiveMode AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . immersiveMode AST#member_expression#Right AST#expression#Right ?? AST#expression#Left DialogUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . defaultConfig AST#member_expression#Right AST#expression#Right . immersiveMode AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left const AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left cancelFun = AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . cancel AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . cancel AST#member_expression#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left cancelFun AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left cancelFun AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left const AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left onWillDismissFun = AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . onWillDismiss AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . onWillDismiss AST#member_expression#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left action : AST#type_annotation#Left AST#primary_type#Left DismissDialogAction AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left onWillDismissFun AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left onWillDismissFun AST#expression#Right AST#argument_list#Left ( AST#expression#Left action AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left action AST#expression#Right . reason AST#member_expression#Right AST#expression#Right == AST#expression#Left DismissReason AST#expression#Right AST#binary_expression#Right AST#expression#Right . PRESS_BACK AST#member_expression#Right AST#expression#Right && AST#expression#Left options AST#expression#Right AST#binary_expression#Right AST#expression#Right . backCancel AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left action AST#expression#Right . dismiss AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left action AST#expression#Right . reason AST#member_expression#Right AST#expression#Right == AST#expression#Left DismissReason AST#expression#Right AST#binary_expression#Right AST#expression#Right . TOUCH_OUTSIDE AST#member_expression#Right AST#expression#Right && AST#expression#Left options AST#expression#Right AST#binary_expression#Right AST#expression#Right . autoCancel AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left action AST#expression#Right . dismiss AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
private static initDialogDefault(options: DialogOptions) {
options.title = options.title ?? DialogUtil.defaultConfig.title;
options.subtitle = options.subtitle ?? DialogUtil.defaultConfig.subtitle;
options.alignment = options.alignment ?? DialogUtil.defaultConfig.alignment;
options.offset = options.offset ?? DialogUtil.defaultConfig.offset;
options.gridCount = options.gridCount ?? DialogUtil.defaultConfig.gridCount;
options.maskRect = options.maskRect ?? DialogUtil.defaultConfig.maskRect;
options.showInSubWindow = options.showInSubWindow ?? DialogUtil.defaultConfig.showInSubWindow;
options.isModal = options.isModal ?? DialogUtil.defaultConfig.isModal;
options.backgroundColor = options.backgroundColor ?? DialogUtil.defaultConfig.backgroundColor;
options.backgroundBlurStyle = options.backgroundBlurStyle ?? DialogUtil.defaultConfig.backgroundBlurStyle;
options.cornerRadius = options.cornerRadius ?? DialogUtil.defaultConfig.cornerRadius;
options.borderWidth = options.borderWidth ?? DialogUtil.defaultConfig.borderWidth;
options.borderColor = options.borderColor ?? DialogUtil.defaultConfig.borderColor;
options.borderStyle = options.borderStyle ?? DialogUtil.defaultConfig.borderStyle;
options.shadow = options.shadow ?? DialogUtil.defaultConfig.shadow;
options.textStyle = options.textStyle ?? DialogUtil.defaultConfig.textStyle;
options.transition = options.transition ?? DialogUtil.defaultConfig.transition;
options.width = options.width ?? DialogUtil.defaultConfig.width;
options.height = options.height ?? DialogUtil.defaultConfig.height;
options.autoCancel = options.autoCancel ?? DialogUtil.defaultConfig.autoCancel;
options.backCancel = options.backCancel ?? DialogUtil.defaultConfig.backCancel;
options.enableHoverMode = options.enableHoverMode ?? DialogUtil.defaultConfig.enableHoverMode;
options.hoverModeArea = options.hoverModeArea ?? DialogUtil.defaultConfig.hoverModeArea;
options.levelMode = options.levelMode ?? DialogUtil.defaultConfig.levelMode;
options.immersiveMode = options.immersiveMode ?? DialogUtil.defaultConfig.immersiveMode;
const cancelFun = options.cancel;
options.cancel = () => {
if (cancelFun) {
cancelFun()
}
};
const onWillDismissFun = options.onWillDismiss;
options.onWillDismiss = (action: DismissDialogAction) => {
if (onWillDismissFun) {
onWillDismissFun(action);
} else {
if (action.reason == DismissReason.PRESS_BACK && options.backCancel) {
action.dismiss()
} else if (action.reason == DismissReason.TOUCH_OUTSIDE && options.autoCancel) {
action.dismiss()
}
}
};
}
|
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/action/DialogUtil.ets#L205-L249
|
729aa66e8a19995e2335a4329362ad55b28737d3
|
gitee
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/pages/CalendarPage.ets
|
arkts
|
initializePage
|
初始化页面
|
private async initializePage(): Promise<void> {
try {
this.loading = true;
await this.loadAllContacts();
await this.loadCalendarData();
await this.loadUpcomingBirthdays();
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to initialize calendar page: ${error}`);
} finally {
this.loading = false;
}
}
|
AST#method_declaration#Left private async initializePage AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . loading AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . loadAllContacts AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . loadCalendarData AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . loadUpcomingBirthdays AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to initialize calendar page: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#finally_clause#Left finally AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . loading AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#finally_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
private async initializePage(): Promise<void> {
try {
this.loading = true;
await this.loadAllContacts();
await this.loadCalendarData();
await this.loadUpcomingBirthdays();
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to initialize calendar page: ${error}`);
} finally {
this.loading = false;
}
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/CalendarPage.ets#L77-L88
|
1037d6e4d5664b58ad59efe8da7ea98e6cc8087d
|
github
|
openharmony/interface_sdk-js
|
c349adc73e2ec1f61f6fca489b5af059e3ed6999
|
api/arkui/component/customComponent.d.ets
|
arkts
|
Definition of V2 custom component class.
@extends BaseCustomComponent
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 20
|
export declare abstract class CustomComponentV2<T extends CustomComponentV2<T, T_Options>, T_Options> extends BaseCustomComponent {
/**
* Define the constructor of custom component
*
* @param { () => T } factory - factory to create instance of custom component
* @param { T_Options } initializers - initial data for all the fields in custom component
* @param { string } reuseId - reuse id for reusable. Only valid if custom component decorated with @Reusable
* @param { @Builder () => void } content - tail closure for custom component
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
*/
@ComponentBuilder
static $_instantiate(
factory: () => T,
initializers?: T_Options,
reuseId?: string,
@Builder content?: () => void
): T
/**
* aboutToReuse Method
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
*/
aboutToReuse(): void;
}
|
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left abstract class CustomComponentV2 AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left CustomComponentV2 AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left T_Options AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right , AST#type_parameter#Left T_Options AST#type_parameter#Right > AST#type_parameters#Right extends AST#type_annotation#Left AST#primary_type#Left BaseCustomComponent AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { /**
* Define the constructor of custom component
*
* @param { () => T } factory - factory to create instance of custom component
* @param { T_Options } initializers - initial data for all the fields in custom component
* @param { string } reuseId - reuse id for reusable. Only valid if custom component decorated with @Reusable
* @param { @Builder () => void } content - tail closure for custom component
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
*/ AST#property_declaration#Left AST#decorator#Left @ ComponentBuilder AST#decorator#Right AST#ERROR#Left static $_instantiate ( AST#parameter#Left factory : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left initializers ? : AST#type_annotation#Left AST#primary_type#Left T_Options AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left reuseId ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#ERROR#Right AST#decorator#Left @ Builder AST#decorator#Right content ? AST#ERROR#Left : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right ) AST#ERROR#Right : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right /**
* aboutToReuse Method
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
*/ AST#ERROR#Left aboutToReuse ( ) : void AST#ERROR#Right ; AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export declare abstract class CustomComponentV2<T extends CustomComponentV2<T, T_Options>, T_Options> extends BaseCustomComponent {
@ComponentBuilder
static $_instantiate(
factory: () => T,
initializers?: T_Options,
reuseId?: string,
@Builder content?: () => void
): T
aboutToReuse(): void;
}
|
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/component/customComponent.d.ets#L243-L273
|
90241625f036decd48e0f8e92f6122e6ff668bbd
|
gitee
|
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/services/recommendation/RecommendationEngine.ets
|
arkts
|
getGiftRecommendations
|
获取礼物推荐
|
async getGiftRecommendations(
contact: Contact,
budget: number = 0,
count: number = 10
): Promise<RecommendationItem[]> {
try {
const context: RecommendationContext = {
userId: 'default',
contactId: contact.id,
occasion: 'birthday',
relationship: contact.relation || 'friend',
age: this.calculateAge(contact.birthday.date),
interests: contact.tags || [],
budget,
timeOfDay: this.getCurrentTimeOfDay(),
season: this.getCurrentSeason(),
personalityTraits: this.inferPersonalityTraits(contact)
};
const result = await this.getRecommendations(RecommendationType.GIFT, context, count);
return result.items;
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP,
`Failed to get gift recommendations: ${error}`);
return [];
}
}
|
AST#method_declaration#Left async getGiftRecommendations AST#parameter_list#Left ( AST#parameter#Left contact : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left budget : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right AST#parameter#Right , AST#parameter#Left count : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 10 AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left RecommendationItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left context : AST#type_annotation#Left AST#primary_type#Left RecommendationContext AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left userId AST#property_name#Right : AST#expression#Left 'default' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left contactId AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left contact AST#expression#Right . id AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left occasion AST#property_name#Right : AST#expression#Left 'birthday' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left relationship AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left contact AST#expression#Right . relation AST#member_expression#Right AST#expression#Right || AST#expression#Left 'friend' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left age AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calculateAge AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left contact AST#expression#Right . birthday AST#member_expression#Right AST#expression#Right . date AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left interests AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left contact AST#expression#Right . tags AST#member_expression#Right AST#expression#Right || AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left budget AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left timeOfDay AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getCurrentTimeOfDay AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left season AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getCurrentSeason AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left personalityTraits AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . inferPersonalityTraits AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left contact AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left result = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . getRecommendations AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left RecommendationType AST#expression#Right . GIFT AST#member_expression#Right AST#expression#Right , AST#expression#Left context AST#expression#Right , AST#expression#Left count AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . items AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to get gift recommendations: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
async getGiftRecommendations(
contact: Contact,
budget: number = 0,
count: number = 10
): Promise<RecommendationItem[]> {
try {
const context: RecommendationContext = {
userId: 'default',
contactId: contact.id,
occasion: 'birthday',
relationship: contact.relation || 'friend',
age: this.calculateAge(contact.birthday.date),
interests: contact.tags || [],
budget,
timeOfDay: this.getCurrentTimeOfDay(),
season: this.getCurrentSeason(),
personalityTraits: this.inferPersonalityTraits(contact)
};
const result = await this.getRecommendations(RecommendationType.GIFT, context, count);
return result.items;
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP,
`Failed to get gift recommendations: ${error}`);
return [];
}
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/recommendation/RecommendationEngine.ets#L385-L411
|
fa462ef5164dcc7ae84869bdc5ce9d8adc888f0d
|
github
|
XiangRui_FuZi/harmony-oscourse
|
da885f9a777a1eace7a07e1cd81137746687974b
|
class1/entry/src/main/ets/model/WindowModel.ets
|
arkts
|
getStatusBarHeight
|
获取主窗口顶部导航栏高度
@returns {callback((statusBarHeight: number) => void))}
|
getStatusBarHeight(callback: ((statusBarHeight: number) => void)): void {
if (this.windowStage === undefined) {
return;
}
this.windowStage.getMainWindow((err, windowClass: window.Window) => {
if (err.code) {
return;
}
try {
const type = window.AvoidAreaType.TYPE_SYSTEM;
const avoidArea = windowClass.getWindowAvoidArea(type);
const height = avoidArea.topRect.height;
callback(height);
} catch (err) {
callback(WindowModel.STATUS_BAR_HEIGHT);
}
});
}
|
AST#method_declaration#Left getStatusBarHeight AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left AST#parenthesized_type#Left ( AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left statusBarHeight : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right ) AST#parenthesized_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . windowStage AST#member_expression#Right AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . windowStage AST#member_expression#Right AST#expression#Right . getMainWindow AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left err AST#parameter#Right , AST#parameter#Left windowClass : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left err AST#expression#Right . code AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left type = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left window AST#expression#Right . AvoidAreaType AST#member_expression#Right AST#expression#Right . TYPE_SYSTEM AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left avoidArea = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left windowClass AST#expression#Right . getWindowAvoidArea AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left type AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left height = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left avoidArea AST#expression#Right . topRect AST#member_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left callback AST#expression#Right AST#argument_list#Left ( AST#expression#Left height AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( err ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left callback AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left WindowModel AST#expression#Right . STATUS_BAR_HEIGHT AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
getStatusBarHeight(callback: ((statusBarHeight: number) => void)): void {
if (this.windowStage === undefined) {
return;
}
this.windowStage.getMainWindow((err, windowClass: window.Window) => {
if (err.code) {
return;
}
try {
const type = window.AvoidAreaType.TYPE_SYSTEM;
const avoidArea = windowClass.getWindowAvoidArea(type);
const height = avoidArea.topRect.height;
callback(height);
} catch (err) {
callback(WindowModel.STATUS_BAR_HEIGHT);
}
});
}
|
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/model/WindowModel.ets#L58-L79
|
b0fba52822177f34a1c73a2649e77e959b6c027c
|
gitee
|
awa_Liny/LinysBrowser_NEXT
|
a5cd96a9aa8114cae4972937f94a8967e55d4a10
|
home/src/main/ets/utils/ui_tools.ets
|
arkts
|
Pins or unpins a window to the top.
@param id The window id.
|
export function pin_to_top(id: string) {
if (!(AppStorage.get('free_window_mode') as boolean)) {
console.log('[pin_to_top] Didn\'t pin window to top because is not in free window mode. But how did you get here?');
return;
}
let window = window_of_id(id);
let storage = storage_of_id(id);
let pin = storage.get('pin_to_top') as boolean;
pin = !pin;
storage.set('pin_to_top', pin);
try {
window.setWindowTopmost(pin);
} catch (e) {
console.error('[pin_to_top] Failed: ' + e);
}
}
|
AST#export_declaration#Left export AST#function_declaration#Left function pin_to_top AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AppStorage AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'free_window_mode' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '[pin_to_top] Didn\'t pin window to top because is not in free window mode. But how did you get here?' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left window = AST#expression#Left AST#call_expression#Left AST#expression#Left window_of_id AST#expression#Right AST#argument_list#Left ( AST#expression#Left id AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left storage = AST#expression#Left AST#call_expression#Left AST#expression#Left storage_of_id AST#expression#Right AST#argument_list#Left ( AST#expression#Left id AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left pin = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left storage AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'pin_to_top' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left pin = AST#expression#Left AST#unary_expression#Left ! AST#expression#Left pin AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left storage AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'pin_to_top' AST#expression#Right , AST#expression#Left pin AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left window AST#expression#Right . setWindowTopmost AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left pin AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( e ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left '[pin_to_top] Failed: ' AST#expression#Right + AST#expression#Left e AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
|
export function pin_to_top(id: string) {
if (!(AppStorage.get('free_window_mode') as boolean)) {
console.log('[pin_to_top] Didn\'t pin window to top because is not in free window mode. But how did you get here?');
return;
}
let window = window_of_id(id);
let storage = storage_of_id(id);
let pin = storage.get('pin_to_top') as boolean;
pin = !pin;
storage.set('pin_to_top', pin);
try {
window.setWindowTopmost(pin);
} catch (e) {
console.error('[pin_to_top] Failed: ' + e);
}
}
|
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/ui_tools.ets#L97-L112
|
5a54d196cc01a1f696289720a974803554f18a84
|
gitee
|
|
openharmony-tpc/ohos_mpchart
|
4fb43a7137320ef2fee2634598f53d93975dfb4a
|
library/src/main/ets/components/renderer/PieChartRenderer.ets
|
arkts
|
drawHighlighted
|
@Override
|
public drawHighlighted(c: CanvasRenderingContext2D, indices: Highlight[]): void {
/* Skip entirely if using rounded circle slices, because it doesn't make sense to highlight
* in this way.
*/
let drawInnerArc: boolean = this.mChart.isDrawHoleEnabled() && !this.mChart.isDrawSlicesUnderHoleEnabled();
if (drawInnerArc && this.mChart.isDrawRoundedSlicesEnabled())
return;
if (!this.mAnimator) {
return;
}
let phaseX: number = this.mAnimator.getPhaseX();
let phaseY: number = this.mAnimator.getPhaseY();
let angle: number;
let rotationAngle: number = this.mChart.getRotationAngle();
let drawAngles: number[] = this.mChart.getDrawAngles();
let absoluteAngles: number[] = this.mChart.getAbsoluteAngles();
let center: MPPointF = this.mChart.getCenterCircleBox();
let radius: number = this.mChart.getRadius();
let userInnerRadius: number = drawInnerArc
? radius * (this.mChart.getHoleRadius() / 100.0)
: 0.0;
let highlightedCircleBox: MyRect = this.mDrawHighlightedRectF;
highlightedCircleBox.set(0, 0, 0, 0);
for (let i: number = 0; i < indices.length; i++) {
// get the index to highlight
let index: number = /*(int)*/
indices[i].getX();
if (index >= drawAngles.length)
continue;
let chartData = this.mChart.getData();
if (!chartData) {
continue;
}
let set: IPieDataSet | null = chartData.getDataSetByIndex(indices[i].getDataSetIndex());
if (set == null || !set.isHighlightEnabled())
continue;
let entryCount: number = set.getEntryCount();
let visibleAngleCount: number = 0;
for (let j: number = 0; j < entryCount; j++) {
// draw only if the value is greater than zero
if ((Math.abs(set.getEntryForIndex(j).getY()) > Utils.FLOAT_EPSILON)) {
visibleAngleCount++;
}
}
if (index == 0)
angle = 0.0;
else
angle = absoluteAngles[index - 1] * phaseX;
let sliceSpace: number = visibleAngleCount <= 1 ? 0.0 : set.getSliceSpace();
let sliceAngle: number = drawAngles[index];
let innerRadius: number = userInnerRadius;
let shift: number = set.getSelectionShift();
let highlightedRadius: number = radius + shift;
highlightedCircleBox.set(this.mChart.getCircleBox().left, this.mChart.getCircleBox()
.top, this.mChart.getCircleBox().right, this.mChart.getCircleBox().bottom);
highlightedCircleBox.inset(-shift, -shift, -shift, -shift);
let accountForSliceSpacing: boolean = sliceSpace > 0.0 && sliceAngle <= 180.0;
let highlightColor: number | null = set.getHighlightColor();
if (highlightColor == null) {
highlightColor = set.getColor(index);
}
if (highlightColor) {
this.mRenderPaint.setColor(highlightColor);
}
let sliceSpaceAngleOuter: number = visibleAngleCount == 1 ?
0.0 :
sliceSpace / (Utils.FDEG2RAD * radius);
let sliceSpaceAngleShifted: number = visibleAngleCount == 1 ?
0.0 :
sliceSpace / (Utils.FDEG2RAD * highlightedRadius);
let startAngleOuter: number = rotationAngle + (angle + sliceSpaceAngleOuter / 2.0) * phaseY;
let sweepAngleOuter: number = (sliceAngle - sliceSpaceAngleOuter) * phaseY;
if (sweepAngleOuter < 0.0) {
sweepAngleOuter = 0;
}
let startAngleShifted: number = rotationAngle + (angle + sliceSpaceAngleShifted / 2.0) * phaseY;
let sweepAngleShifted: number = (sliceAngle - sliceSpaceAngleShifted) * phaseY;
if (sweepAngleShifted < 0.0) {
sweepAngleShifted = 0.0;
}
// this.mPathBuffer.reset();
this.mPathBuffer = new Path2D();
if (sweepAngleOuter >= 360.0 && sweepAngleOuter % 360 <= Utils.FLOAT_EPSILON) {
// ohos is doing "mod 360"
this.mPathBuffer.arc(center.x, center.y, highlightedRadius, 0, 2 * Math.PI, false);
} else {
this.mPathBuffer.moveTo(
center.x + highlightedRadius * /*(float)*/
Math.cos(startAngleShifted * Utils.FDEG2RAD),
center.y + highlightedRadius * /*(float)*/
Math.sin(startAngleShifted * Utils.FDEG2RAD));
this.arcTo(this.mPathBuffer, highlightedCircleBox,
startAngleShifted,
sweepAngleShifted)
}
let sliceSpaceRadius = 0.0;
if (accountForSliceSpacing) {
sliceSpaceRadius =
this.calculateMinimumRadiusForSpacedSlice(
center, radius,
sliceAngle * phaseY,
center.x + radius * /*(float)*/
Math.cos(startAngleOuter * Utils.FDEG2RAD),
center.y + radius * /*(float)*/
Math.sin(startAngleOuter * Utils.FDEG2RAD),
startAngleOuter,
sweepAngleOuter);
}
// API < 21 does not receive floats in addArc, but a RectF
this.mInnerRectBuffer.set(
center.x - innerRadius,
center.y - innerRadius,
center.x + innerRadius,
center.y + innerRadius);
if (drawInnerArc &&
(innerRadius > 0.0 || accountForSliceSpacing)) {
if (accountForSliceSpacing) {
let minSpacedRadius = sliceSpaceRadius;
if (minSpacedRadius < 0.0)
minSpacedRadius = -minSpacedRadius;
innerRadius = Math.max(innerRadius, minSpacedRadius);
}
let sliceSpaceAngleInner: number = visibleAngleCount == 1 || innerRadius == 0.0 ?
0.0 :
sliceSpace / (Utils.FDEG2RAD * innerRadius);
let startAngleInner: number = rotationAngle + (angle + sliceSpaceAngleInner / 2.0) * phaseY;
let sweepAngleInner: number = (sliceAngle - sliceSpaceAngleInner) * phaseY;
if (sweepAngleInner < 0.0) {
sweepAngleInner = 0.0;
}
let endAngleInner: number = startAngleInner + sweepAngleInner;
if (sweepAngleOuter >= 360.0 && sweepAngleOuter % 360 <= Utils.FLOAT_EPSILON) {
// ohos is doing "mod 360"
this.mPathBuffer.arc(center.x, center.y, innerRadius, 0, 2 * Math.PI, true);
} else {
this.mPathBuffer.lineTo(
center.x + innerRadius * /*(float)*/
Math.cos(endAngleInner * Utils.FDEG2RAD),
center.y + innerRadius * /*(float)*/
Math.sin(endAngleInner * Utils.FDEG2RAD));
this.arcTo(this.mPathBuffer, this.mInnerRectBuffer, endAngleInner, -sweepAngleInner);
}
} else {
if (sweepAngleOuter % 360 > Utils.FLOAT_EPSILON) {
if (accountForSliceSpacing) {
let angleMiddle: number = startAngleOuter + sweepAngleOuter / 2.0;
let arcEndPointX: number = center.x +
sliceSpaceRadius * /*(float)*/
Math.cos(angleMiddle * Utils.FDEG2RAD);
let arcEndPointY: number = center.y +
sliceSpaceRadius * /*(float)*/
Math.sin(angleMiddle * Utils.FDEG2RAD);
this.mPathBuffer.lineTo(
arcEndPointX,
arcEndPointY);
} else {
this.mPathBuffer.lineTo(
center.x,
center.y);
}
}
}
this.mPathBuffer.closePath();
// this.mBitmapCanvas.drawPath(this.mPathBuffer, this.mRenderPaint);
Utils.resetContext2DWithoutFont(c, this.mRenderPaint);
c.beginPath();
// c.stroke(this.mPathBuffer);
c.fill(this.mPathBuffer);
c.closePath();
}
MPPointF.recycleInstance(center);
}
|
AST#method_declaration#Left public drawHighlighted AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left indices : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Highlight [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { /* Skip entirely if using rounded circle slices, because it doesn't make sense to highlight
* in this way.
*/ AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left drawInnerArc : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . isDrawHoleEnabled AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right && AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . isDrawSlicesUnderHoleEnabled AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left drawInnerArc AST#expression#Right && AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . isDrawRoundedSlicesEnabled AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right . mAnimator AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left phaseX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mAnimator AST#member_expression#Right AST#expression#Right . getPhaseX AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left phaseY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mAnimator AST#member_expression#Right AST#expression#Right . getPhaseY AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left angle : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left rotationAngle : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getRotationAngle AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left drawAngles : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getDrawAngles AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left absoluteAngles : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getAbsoluteAngles AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left center : AST#type_annotation#Left AST#primary_type#Left MPPointF AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getCenterCircleBox AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left radius : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getRadius AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left userInnerRadius : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#conditional_expression#Left AST#expression#Left drawInnerArc AST#expression#Right ? AST#expression#Left AST#binary_expression#Left AST#expression#Left radius AST#expression#Right * AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getHoleRadius AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right / AST#expression#Left 100.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right : AST#expression#Left 0.0 AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left highlightedCircleBox : AST#type_annotation#Left AST#primary_type#Left MyRect AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mDrawHighlightedRectF AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left highlightedCircleBox AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0 AST#expression#Right , AST#expression#Left 0 AST#expression#Right , AST#expression#Left 0 AST#expression#Right , AST#expression#Left 0 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left indices AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { // get the index to highlight AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = /*(int)*/ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left indices AST#expression#Right [ AST#expression#Left i AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . getX AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right >= AST#expression#Left drawAngles AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ) AST#statement#Left AST#continue_statement#Left continue ; AST#continue_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left chartData = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getData AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left chartData AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#continue_statement#Left continue ; AST#continue_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left set : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left IPieDataSet AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left chartData AST#expression#Right . getDataSetByIndex AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left indices AST#expression#Right [ AST#expression#Left i AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . getDataSetIndex AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left set AST#expression#Right == AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left AST#unary_expression#Left ! AST#expression#Left set AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . isHighlightEnabled AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#statement#Left AST#continue_statement#Left continue ; AST#continue_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left entryCount : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left set AST#expression#Right . getEntryCount AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left visibleAngleCount : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left j : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#binary_expression#Left AST#expression#Left j AST#expression#Right < AST#expression#Left entryCount AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left j AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { // draw only if the value is greater than zero AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Math AST#expression#Right . abs AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left set AST#expression#Right . getEntryForIndex AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left j AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . getY AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right > AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FLOAT_EPSILON AST#member_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#update_expression#Left AST#expression#Left visibleAngleCount AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right == AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left angle = AST#expression#Left 0.0 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right else AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left angle = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left absoluteAngles AST#expression#Right [ AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right - AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right * AST#expression#Left phaseX AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sliceSpace : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left visibleAngleCount AST#expression#Right <= AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left 0.0 AST#expression#Right : AST#expression#Left set AST#expression#Right AST#conditional_expression#Right AST#expression#Right . getSliceSpace AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sliceAngle : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#subscript_expression#Left AST#expression#Left drawAngles AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left innerRadius : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left userInnerRadius AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left shift : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left set AST#expression#Right . getSelectionShift AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left highlightedRadius : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left radius AST#expression#Right + AST#expression#Left shift AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left highlightedCircleBox AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getCircleBox AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . left AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getCircleBox AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . top AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getCircleBox AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . right AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getCircleBox AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . bottom AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left highlightedCircleBox AST#expression#Right . inset AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#unary_expression#Left - AST#expression#Left shift AST#expression#Right AST#unary_expression#Right AST#expression#Right , AST#expression#Left AST#unary_expression#Left - AST#expression#Left shift AST#expression#Right AST#unary_expression#Right AST#expression#Right , AST#expression#Left AST#unary_expression#Left - AST#expression#Left shift AST#expression#Right AST#unary_expression#Right AST#expression#Right , AST#expression#Left AST#unary_expression#Left - AST#expression#Left shift AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left accountForSliceSpacing : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpace AST#expression#Right > AST#expression#Left 0.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceAngle AST#expression#Right <= AST#expression#Left 180.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left highlightColor : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left set AST#expression#Right . getHighlightColor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left highlightColor AST#expression#Right == AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left highlightColor = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left set AST#expression#Right . getColor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left highlightColor AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mRenderPaint AST#member_expression#Right AST#expression#Right . setColor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left highlightColor AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sliceSpaceAngleOuter : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left visibleAngleCount AST#expression#Right == AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left 0.0 AST#expression#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpace AST#expression#Right / AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Utils AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right * AST#expression#Left radius AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sliceSpaceAngleShifted : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left visibleAngleCount AST#expression#Right == AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left 0.0 AST#expression#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpace AST#expression#Right / AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Utils AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right * AST#expression#Left highlightedRadius AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left startAngleOuter : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left rotationAngle AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left angle AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpaceAngleOuter AST#expression#Right / AST#expression#Left 2.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right * AST#expression#Left phaseY AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sweepAngleOuter : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceAngle AST#expression#Right - AST#expression#Left sliceSpaceAngleOuter AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right * AST#expression#Left phaseY AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleOuter AST#expression#Right < AST#expression#Left 0.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sweepAngleOuter = AST#expression#Left 0 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left startAngleShifted : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left rotationAngle AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left angle AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpaceAngleShifted AST#expression#Right / AST#expression#Left 2.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right * AST#expression#Left phaseY AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sweepAngleShifted : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceAngle AST#expression#Right - AST#expression#Left sliceSpaceAngleShifted AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right * AST#expression#Left phaseY AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleShifted AST#expression#Right < AST#expression#Left 0.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sweepAngleShifted = AST#expression#Left 0.0 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // this.mPathBuffer.reset(); AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Path2D AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleOuter AST#expression#Right >= AST#expression#Left 360.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleOuter AST#expression#Right % AST#expression#Left 360 AST#expression#Right AST#binary_expression#Right AST#expression#Right <= AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . FLOAT_EPSILON AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // ohos is doing "mod 360" AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right . arc AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right , AST#expression#Left highlightedRadius AST#expression#Right , AST#expression#Left 0 AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 2 AST#expression#Right * AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right . PI AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right . moveTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left highlightedRadius AST#expression#Right * /*(float)*/ AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . cos AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left startAngleShifted AST#expression#Right * AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left highlightedRadius AST#expression#Right * /*(float)*/ AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . sin AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left startAngleShifted AST#expression#Right * AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . arcTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right , AST#expression#Left highlightedCircleBox AST#expression#Right , AST#expression#Left startAngleShifted AST#expression#Right , AST#expression#Left sweepAngleShifted AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sliceSpaceRadius = AST#expression#Left 0.0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left accountForSliceSpacing AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sliceSpaceRadius = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . calculateMinimumRadiusForSpacedSlice AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left center AST#expression#Right , AST#expression#Left radius AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceAngle AST#expression#Right * AST#expression#Left phaseY AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left radius AST#expression#Right * /*(float)*/ AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . cos AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left startAngleOuter AST#expression#Right * AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left radius AST#expression#Right * /*(float)*/ AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . sin AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left startAngleOuter AST#expression#Right * AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left startAngleOuter AST#expression#Right , AST#expression#Left sweepAngleOuter AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // API < 21 does not receive floats in addArc, but a RectF AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mInnerRectBuffer AST#member_expression#Right AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right - AST#expression#Left innerRadius AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right - AST#expression#Left innerRadius AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right + AST#expression#Left innerRadius AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right + AST#expression#Left innerRadius AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left drawInnerArc AST#expression#Right && AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left innerRadius AST#expression#Right > AST#expression#Left 0.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left accountForSliceSpacing AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left accountForSliceSpacing AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left minSpacedRadius = AST#expression#Left sliceSpaceRadius AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left minSpacedRadius AST#expression#Right < AST#expression#Left 0.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left minSpacedRadius = AST#expression#Left AST#unary_expression#Left - AST#expression#Left minSpacedRadius AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left innerRadius = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Math AST#expression#Right . max AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left innerRadius AST#expression#Right , AST#expression#Left minSpacedRadius AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sliceSpaceAngleInner : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left visibleAngleCount AST#expression#Right == AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left innerRadius AST#expression#Right == AST#expression#Left 0.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left 0.0 AST#expression#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpace AST#expression#Right / AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Utils AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right * AST#expression#Left innerRadius AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left startAngleInner : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left rotationAngle AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left angle AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpaceAngleInner AST#expression#Right / AST#expression#Left 2.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right * AST#expression#Left phaseY AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sweepAngleInner : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceAngle AST#expression#Right - AST#expression#Left sliceSpaceAngleInner AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right * AST#expression#Left phaseY AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleInner AST#expression#Right < AST#expression#Left 0.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sweepAngleInner = AST#expression#Left 0.0 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left endAngleInner : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left startAngleInner AST#expression#Right + AST#expression#Left sweepAngleInner AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleOuter AST#expression#Right >= AST#expression#Left 360.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleOuter AST#expression#Right % AST#expression#Left 360 AST#expression#Right AST#binary_expression#Right AST#expression#Right <= AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . FLOAT_EPSILON AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // ohos is doing "mod 360" AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right . arc AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right , AST#expression#Left innerRadius AST#expression#Right , AST#expression#Left 0 AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 2 AST#expression#Right * AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right . PI AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right . lineTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left innerRadius AST#expression#Right * /*(float)*/ AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . cos AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left endAngleInner AST#expression#Right * AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left innerRadius AST#expression#Right * /*(float)*/ AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . sin AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left endAngleInner AST#expression#Right * AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . arcTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mInnerRectBuffer AST#member_expression#Right AST#expression#Right , AST#expression#Left endAngleInner AST#expression#Right , AST#expression#Left AST#unary_expression#Left - AST#expression#Left sweepAngleInner AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleOuter AST#expression#Right % AST#expression#Left 360 AST#expression#Right AST#binary_expression#Right AST#expression#Right > AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FLOAT_EPSILON AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left accountForSliceSpacing AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left angleMiddle : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left startAngleOuter AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left sweepAngleOuter AST#expression#Right / AST#expression#Left 2.0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left arcEndPointX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpaceRadius AST#expression#Right * /*(float)*/ AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . cos AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left angleMiddle AST#expression#Right * AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left arcEndPointY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceSpaceRadius AST#expression#Right * /*(float)*/ AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . sin AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left angleMiddle AST#expression#Right * AST#expression#Left Utils AST#expression#Right AST#binary_expression#Right AST#expression#Right . FDEG2RAD AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right . lineTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left arcEndPointX AST#expression#Right , AST#expression#Left arcEndPointY AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right . lineTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right . closePath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // this.mBitmapCanvas.drawPath(this.mPathBuffer, this.mRenderPaint); AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Utils AST#expression#Right . resetContext2DWithoutFont AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left c AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mRenderPaint AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left c AST#expression#Right . beginPath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // c.stroke(this.mPathBuffer); AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left c AST#expression#Right . fill AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mPathBuffer AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left c AST#expression#Right . closePath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left MPPointF AST#expression#Right . recycleInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left center AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
public drawHighlighted(c: CanvasRenderingContext2D, indices: Highlight[]): void {
let drawInnerArc: boolean = this.mChart.isDrawHoleEnabled() && !this.mChart.isDrawSlicesUnderHoleEnabled();
if (drawInnerArc && this.mChart.isDrawRoundedSlicesEnabled())
return;
if (!this.mAnimator) {
return;
}
let phaseX: number = this.mAnimator.getPhaseX();
let phaseY: number = this.mAnimator.getPhaseY();
let angle: number;
let rotationAngle: number = this.mChart.getRotationAngle();
let drawAngles: number[] = this.mChart.getDrawAngles();
let absoluteAngles: number[] = this.mChart.getAbsoluteAngles();
let center: MPPointF = this.mChart.getCenterCircleBox();
let radius: number = this.mChart.getRadius();
let userInnerRadius: number = drawInnerArc
? radius * (this.mChart.getHoleRadius() / 100.0)
: 0.0;
let highlightedCircleBox: MyRect = this.mDrawHighlightedRectF;
highlightedCircleBox.set(0, 0, 0, 0);
for (let i: number = 0; i < indices.length; i++) {
let index: number =
indices[i].getX();
if (index >= drawAngles.length)
continue;
let chartData = this.mChart.getData();
if (!chartData) {
continue;
}
let set: IPieDataSet | null = chartData.getDataSetByIndex(indices[i].getDataSetIndex());
if (set == null || !set.isHighlightEnabled())
continue;
let entryCount: number = set.getEntryCount();
let visibleAngleCount: number = 0;
for (let j: number = 0; j < entryCount; j++) {
if ((Math.abs(set.getEntryForIndex(j).getY()) > Utils.FLOAT_EPSILON)) {
visibleAngleCount++;
}
}
if (index == 0)
angle = 0.0;
else
angle = absoluteAngles[index - 1] * phaseX;
let sliceSpace: number = visibleAngleCount <= 1 ? 0.0 : set.getSliceSpace();
let sliceAngle: number = drawAngles[index];
let innerRadius: number = userInnerRadius;
let shift: number = set.getSelectionShift();
let highlightedRadius: number = radius + shift;
highlightedCircleBox.set(this.mChart.getCircleBox().left, this.mChart.getCircleBox()
.top, this.mChart.getCircleBox().right, this.mChart.getCircleBox().bottom);
highlightedCircleBox.inset(-shift, -shift, -shift, -shift);
let accountForSliceSpacing: boolean = sliceSpace > 0.0 && sliceAngle <= 180.0;
let highlightColor: number | null = set.getHighlightColor();
if (highlightColor == null) {
highlightColor = set.getColor(index);
}
if (highlightColor) {
this.mRenderPaint.setColor(highlightColor);
}
let sliceSpaceAngleOuter: number = visibleAngleCount == 1 ?
0.0 :
sliceSpace / (Utils.FDEG2RAD * radius);
let sliceSpaceAngleShifted: number = visibleAngleCount == 1 ?
0.0 :
sliceSpace / (Utils.FDEG2RAD * highlightedRadius);
let startAngleOuter: number = rotationAngle + (angle + sliceSpaceAngleOuter / 2.0) * phaseY;
let sweepAngleOuter: number = (sliceAngle - sliceSpaceAngleOuter) * phaseY;
if (sweepAngleOuter < 0.0) {
sweepAngleOuter = 0;
}
let startAngleShifted: number = rotationAngle + (angle + sliceSpaceAngleShifted / 2.0) * phaseY;
let sweepAngleShifted: number = (sliceAngle - sliceSpaceAngleShifted) * phaseY;
if (sweepAngleShifted < 0.0) {
sweepAngleShifted = 0.0;
}
this.mPathBuffer = new Path2D();
if (sweepAngleOuter >= 360.0 && sweepAngleOuter % 360 <= Utils.FLOAT_EPSILON) {
this.mPathBuffer.arc(center.x, center.y, highlightedRadius, 0, 2 * Math.PI, false);
} else {
this.mPathBuffer.moveTo(
center.x + highlightedRadius *
Math.cos(startAngleShifted * Utils.FDEG2RAD),
center.y + highlightedRadius *
Math.sin(startAngleShifted * Utils.FDEG2RAD));
this.arcTo(this.mPathBuffer, highlightedCircleBox,
startAngleShifted,
sweepAngleShifted)
}
let sliceSpaceRadius = 0.0;
if (accountForSliceSpacing) {
sliceSpaceRadius =
this.calculateMinimumRadiusForSpacedSlice(
center, radius,
sliceAngle * phaseY,
center.x + radius *
Math.cos(startAngleOuter * Utils.FDEG2RAD),
center.y + radius *
Math.sin(startAngleOuter * Utils.FDEG2RAD),
startAngleOuter,
sweepAngleOuter);
}
this.mInnerRectBuffer.set(
center.x - innerRadius,
center.y - innerRadius,
center.x + innerRadius,
center.y + innerRadius);
if (drawInnerArc &&
(innerRadius > 0.0 || accountForSliceSpacing)) {
if (accountForSliceSpacing) {
let minSpacedRadius = sliceSpaceRadius;
if (minSpacedRadius < 0.0)
minSpacedRadius = -minSpacedRadius;
innerRadius = Math.max(innerRadius, minSpacedRadius);
}
let sliceSpaceAngleInner: number = visibleAngleCount == 1 || innerRadius == 0.0 ?
0.0 :
sliceSpace / (Utils.FDEG2RAD * innerRadius);
let startAngleInner: number = rotationAngle + (angle + sliceSpaceAngleInner / 2.0) * phaseY;
let sweepAngleInner: number = (sliceAngle - sliceSpaceAngleInner) * phaseY;
if (sweepAngleInner < 0.0) {
sweepAngleInner = 0.0;
}
let endAngleInner: number = startAngleInner + sweepAngleInner;
if (sweepAngleOuter >= 360.0 && sweepAngleOuter % 360 <= Utils.FLOAT_EPSILON) {
this.mPathBuffer.arc(center.x, center.y, innerRadius, 0, 2 * Math.PI, true);
} else {
this.mPathBuffer.lineTo(
center.x + innerRadius *
Math.cos(endAngleInner * Utils.FDEG2RAD),
center.y + innerRadius *
Math.sin(endAngleInner * Utils.FDEG2RAD));
this.arcTo(this.mPathBuffer, this.mInnerRectBuffer, endAngleInner, -sweepAngleInner);
}
} else {
if (sweepAngleOuter % 360 > Utils.FLOAT_EPSILON) {
if (accountForSliceSpacing) {
let angleMiddle: number = startAngleOuter + sweepAngleOuter / 2.0;
let arcEndPointX: number = center.x +
sliceSpaceRadius *
Math.cos(angleMiddle * Utils.FDEG2RAD);
let arcEndPointY: number = center.y +
sliceSpaceRadius *
Math.sin(angleMiddle * Utils.FDEG2RAD);
this.mPathBuffer.lineTo(
arcEndPointX,
arcEndPointY);
} else {
this.mPathBuffer.lineTo(
center.x,
center.y);
}
}
}
this.mPathBuffer.closePath();
Utils.resetContext2DWithoutFont(c, this.mRenderPaint);
c.beginPath();
c.fill(this.mPathBuffer);
c.closePath();
}
MPPointF.recycleInstance(center);
}
|
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/PieChartRenderer.ets#L842-L1062
|
2b5fe7e3786517566608246c09231d898c4bf015
|
gitee
|
2763981847/Clock-Alarm.git
|
8949bedddb7d011021848196735f30ffe2bd1daf
|
entry/src/main/ets/entryability/EntryAbility.ets
|
arkts
|
onCreate
|
创建实例时调用。
|
onCreate() {
// 在全局上下文中设置对象实例
GlobalContext.getContext().setObject('preference', PreferencesHandler.instance);
}
|
AST#method_declaration#Left onCreate AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 在全局上下文中设置对象实例 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left GlobalContext AST#expression#Right . getContext AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . setObject AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'preference' AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left PreferencesHandler AST#expression#Right . instance AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
onCreate() {
GlobalContext.getContext().setObject('preference', PreferencesHandler.instance);
}
|
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/entryability/EntryAbility.ets#L12-L15
|
9577b33e7af4875cc00f36216381c33a87b31bed
|
github
|
ashcha0/my-arkts.git
|
49e433fd286793fb411fe073e37f598340c84bcb
|
entry/.preview/default/generated/profile/default/BuildProfile.ets
|
arkts
|
Use these variables when you tailor your ArkTS code. They must be of the const type.
|
export const BUNDLE_NAME = 'com.huawei.quickstart';
|
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left BUNDLE_NAME = AST#expression#Left 'com.huawei.quickstart' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
|
export const BUNDLE_NAME = 'com.huawei.quickstart';
|
https://github.com/ashcha0/my-arkts.git/blob/49e433fd286793fb411fe073e37f598340c84bcb/entry/.preview/default/generated/profile/default/BuildProfile.ets#L4-L4
|
8967ccde8b255dac4915488164e20ec9d92bf254
|
github
|
|
Joker-x-dev/CoolMallArkTS.git
|
9f3fabf89fb277692cb82daf734c220c7282919c
|
feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets
|
arkts
|
updatePhone
|
更新手机号
@param {string} value - 手机号
@returns {void} 无返回值
|
updatePhone(value: string): void {
this.phone = value;
}
|
AST#method_declaration#Left updatePhone AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . phone AST#member_expression#Right = AST#expression#Left value AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
updatePhone(value: string): void {
this.phone = value;
}
|
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets#L173-L175
|
df0c516a3e2c078c280a7955c7480d5abdf0a3bf
|
github
|
Joker-x-dev/HarmonyKit.git
|
f97197ce157df7f303244fba42e34918306dfb08
|
core/designsystem/src/main/ets/component/Spacer.ets
|
arkts
|
SpaceHorizontalMedium
|
创建一个中等水平间距(12vp)
@returns {void} 无返回值
|
@Builder
export function SpaceHorizontalMedium(): void {
Blank().width($r("app.float.space_horizontal_medium"));
}
|
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function SpaceHorizontalMedium AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Blank ( ) AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.float.space_horizontal_medium" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#builder_function_body#Right AST#decorated_export_declaration#Right
|
@Builder
export function SpaceHorizontalMedium(): void {
Blank().width($r("app.float.space_horizontal_medium"));
}
|
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Spacer.ets#L91-L94
|
4e182616c058534a8076d20f32ce6dc14981266c
|
github
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/entryability/EntryAbility.ets
|
arkts
|
initializeServices
|
初始化应用服务
|
private async initializeServices(): Promise<void> {
try {
// 首先初始化PreferencesService(SettingsService依赖它)
await PreferencesService.getInstance().initialize(this.context);
// 初始化数据库服务
await DatabaseService.getInstance().initializeDatabase(this.context);
// 初始化设置服务
await SettingsService.getInstance().initialize();
console.log('[EntryAbility] All services initialized successfully');
hilog.info(0x0001, 'AI生日提醒', 'All services initialized successfully');
} catch (error) {
const businessError = error as BusinessError;
console.error(`[EntryAbility] Failed to initialize services: ${businessError.message}`);
hilog.error(0x0001, 'AI生日提醒',
'Failed to initialize services: %{public}s', businessError.message);
}
}
|
AST#method_declaration#Left private async initializeServices AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { // 首先初始化PreferencesService(SettingsService依赖它) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left PreferencesService AST#expression#Right AST#await_expression#Right AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . initialize AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 初始化数据库服务 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left DatabaseService AST#expression#Right AST#await_expression#Right AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . initializeDatabase AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 初始化设置服务 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left SettingsService AST#expression#Right AST#await_expression#Right AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . initialize AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '[EntryAbility] All services initialized successfully' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0001 AST#expression#Right , AST#expression#Left 'AI生日提醒' AST#expression#Right , AST#expression#Left 'All services initialized successfully' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left businessError = AST#expression#Left AST#as_expression#Left AST#expression#Left error AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` [EntryAbility] Failed to initialize services: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left businessError AST#expression#Right . message AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0001 AST#expression#Right , AST#expression#Left 'AI生日提醒' AST#expression#Right , AST#expression#Left 'Failed to initialize services: %{public}s' AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left businessError AST#expression#Right . message AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
private async initializeServices(): Promise<void> {
try {
await PreferencesService.getInstance().initialize(this.context);
await DatabaseService.getInstance().initializeDatabase(this.context);
await SettingsService.getInstance().initialize();
console.log('[EntryAbility] All services initialized successfully');
hilog.info(0x0001, 'AI生日提醒', 'All services initialized successfully');
} catch (error) {
const businessError = error as BusinessError;
console.error(`[EntryAbility] Failed to initialize services: ${businessError.message}`);
hilog.error(0x0001, 'AI生日提醒',
'Failed to initialize services: %{public}s', businessError.message);
}
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/entryability/EntryAbility.ets#L115-L134
|
52c6942947bf3439e0033f900c3403cd9f68b137
|
github
|
mayuanwei/harmonyOS_bilibili
|
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
|
HCIA/complete/ArkData/KVManagerDemo/entry/src/main/ets/database/KVManager.ets
|
arkts
|
queryData
|
2、调用get()方法获取指定键的值(查询数据)
|
async queryData(key: string): Promise<boolean | string | number | Uint8Array> {
if (kvStore !== undefined) {
try {
resultData = await kvStore.get(key); // 等待获取操作完成
console.info('success to query data:'+resultData);
} catch (error) {
console.error('Failed to query data:', error);
resultData = ''; // 查询不到数据(例如被删除)
}
}
return resultData;
}
|
AST#method_declaration#Left async queryData AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left boolean AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left Uint8Array AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left kvStore AST#expression#Right !== AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left resultData = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left kvStore AST#expression#Right AST#await_expression#Right AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left key AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 等待获取操作完成 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left 'success to query data:' AST#expression#Right + AST#expression#Left resultData AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Failed to query data:' AST#expression#Right , AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left resultData = AST#expression#Left '' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 查询不到数据(例如被删除) } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left resultData AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
async queryData(key: string): Promise<boolean | string | number | Uint8Array> {
if (kvStore !== undefined) {
try {
resultData = await kvStore.get(key);
console.info('success to query data:'+resultData);
} catch (error) {
console.error('Failed to query data:', error);
resultData = '';
}
}
return resultData;
}
|
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/complete/ArkData/KVManagerDemo/entry/src/main/ets/database/KVManager.ets#L49-L60
|
4345a39eef1c484fa1bda5d83538332239c1e322
|
gitee
|
harmonyos-cases/cases
|
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
|
CommonAppDevelopment/feature/videoscreendirectionswitching/src/main/ets/component/VideoComponent.ets
|
arkts
|
setStateChangeCallback
|
状态机上报回调函数
|
async setStateChangeCallback(): Promise<void> {
this.avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => {
logger.info('stateChange callback function is triggered,state is:' + state + ',reason is :' + reason);
switch (state) {
case 'idle':
this.release();
logger.info('state idle called');
break;
case 'initialized':
logger.info('state initialized called');
this.setSurfaceID();
this.avPlayer.prepare();
break;
case 'prepared':
logger.info('state prepared called');
|
AST#method_declaration#Left async setStateChangeCallback AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avPlayer AST#member_expression#Right AST#expression#Right . on AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'stateChange' AST#expression#Right , AST#ERROR#Left async AST#parameter_list#Left ( AST#parameter#Left state : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left reason : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left media . StateChangeReason AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left => { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 'stateChange callback function is triggered,state is:' AST#expression#Right + AST#expression#Left state AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left ',reason is :' AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left reason AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left switch AST#expression#Right AST#argument_list#Left ( AST#expression#Left state AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#object_literal#Left { AST#ERROR#Left AST#property_name#Left case AST#property_name#Right AST#ERROR#Right AST#property_assignment#Left AST#property_name#Left 'idle' AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . release AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right AST#object_literal#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'state idle called' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#break_statement#Left break ; AST#break_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left 'initialized' AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Right : AST#qualified_type#Left logger . info AST#qualified_type#Right ( AST#ERROR#Right AST#expression#Left 'state initialized called' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . setSurfaceID AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avPlayer AST#member_expression#Right AST#expression#Right . prepare AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left break AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left 'prepared' AST#expression#Right AST#expression_statement#Right AST#ERROR#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left logger . info AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Left ( 'state prepared called' ) AST#ERROR#Right ; AST#method_declaration#Right
|
async setStateChangeCallback(): Promise<void> {
this.avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => {
logger.info('stateChange callback function is triggered,state is:' + state + ',reason is :' + reason);
switch (state) {
case 'idle':
this.release();
logger.info('state idle called');
break;
case 'initialized':
logger.info('state initialized called');
this.setSurfaceID();
this.avPlayer.prepare();
break;
case 'prepared':
logger.info('state prepared called');
|
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videoscreendirectionswitching/src/main/ets/component/VideoComponent.ets#L250-L264
|
950fa618c0e3ad2bff6ebfacf51c8d398be6d4a6
|
gitee
|
openharmony/codelabs
|
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
|
ExcellentCase/Multi_device_V2/common/src/main/ets/viewmodel/BottomTabsItem.ets
|
arkts
|
Interface of bottom tab item.
|
export interface BottomTabsItem {
icon: Resource;
iconSelected: Resource;
text: Resource;
}
|
AST#export_declaration#Left export AST#interface_declaration#Left interface BottomTabsItem AST#object_type#Left { AST#type_member#Left icon : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left iconSelected : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left text : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
|
export interface BottomTabsItem {
icon: Resource;
iconSelected: Resource;
text: Resource;
}
|
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Multi_device_V2/common/src/main/ets/viewmodel/BottomTabsItem.ets#L19-L23
|
98761fb60f841b666580e4557f933b199a66206f
|
gitee
|
|
Tianpei-Shi/MusicDash.git
|
4db7ea82fb9d9fa5db7499ccdd6d8d51a4bb48d5
|
src/model/UserModel.ets
|
arkts
|
用户信息模型 - 根据云数据库表结构定义
|
export class UserInfo {
id: number;
username: string;
password: string;
like?: string;
history?: string;
phone?: number;
createdTime?: number;
lastLoginTime?: number;
avatar?: string;
constructor(id: number, username: string, password: string) {
this.id = id;
this.username = username;
this.password = password;
this.createdTime = Date.now();
this.lastLoginTime = Date.now();
}
// 转换为CloudDB对象格式
toCloudObject(): CloudDBZoneObject {
const cloudObject: CloudDBZoneObject = {
id: this.id,
username: this.username,
password: this.password,
like: this.like || '',
history: this.history || '',
phone: this.phone || 0,
createdTime: this.createdTime || Date.now(),
lastLoginTime: this.lastLoginTime || Date.now(),
avatar: this.avatar || ''
};
return cloudObject;
}
// 从CloudDB对象创建UserInfo
static fromCloudObject(obj: CloudDBZoneObject): UserInfo {
const user = new UserInfo(obj.id as number, obj.username as string, obj.password as string);
user.like = obj.like as string;
user.history = obj.history as string;
user.phone = obj.phone as number;
user.createdTime = obj.createdTime as number;
user.lastLoginTime = obj.lastLoginTime as number;
user.avatar = obj.avatar as string;
return user;
}
/**
* 从JSON对象创建UserInfo实例
*/
static fromJson(json: UserJsonData): UserInfo {
return new UserInfo(
json.id,
json.username,
json.password
);
}
/**
* 转换为JSON对象
*/
toJson(): UserJsonData {
const data: UserJsonData = {
id: this.id,
username: this.username,
password: this.password,
like: this.like,
history: this.history,
phone: this.phone,
createdTime: this.createdTime,
lastLoginTime: this.lastLoginTime,
avatar: this.avatar
};
return data;
}
}
|
AST#export_declaration#Left export AST#class_declaration#Left class UserInfo AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left username : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left password : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left like ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left history ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left phone ? : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left createdTime ? : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left lastLoginTime ? : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left avatar ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left username : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left password : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . id AST#member_expression#Right = AST#expression#Left id AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . username AST#member_expression#Right = AST#expression#Left username AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . password AST#member_expression#Right = AST#expression#Left password AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . createdTime AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Date AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lastLoginTime AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Date AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right // 转换为CloudDB对象格式 AST#method_declaration#Left toCloudObject AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CloudDBZoneObject AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left cloudObject : AST#type_annotation#Left AST#primary_type#Left CloudDBZoneObject AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left id AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . id AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left username AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . username AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left password AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . password AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left like AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . like AST#member_expression#Right AST#expression#Right || AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left history AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . history AST#member_expression#Right AST#expression#Right || AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left phone AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . phone AST#member_expression#Right AST#expression#Right || AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left createdTime AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . createdTime AST#member_expression#Right AST#expression#Right || AST#expression#Left Date AST#expression#Right AST#binary_expression#Right AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left lastLoginTime AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lastLoginTime AST#member_expression#Right AST#expression#Right || AST#expression#Left Date AST#expression#Right AST#binary_expression#Right AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left avatar AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avatar AST#member_expression#Right AST#expression#Right || AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left cloudObject AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right // 从CloudDB对象创建UserInfo AST#method_declaration#Left static fromCloudObject AST#parameter_list#Left ( AST#parameter#Left obj : AST#type_annotation#Left AST#primary_type#Left CloudDBZoneObject AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left UserInfo AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left user = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left UserInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . id AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right , AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . username AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right , AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . password AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left user AST#expression#Right . like AST#member_expression#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . like AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left user AST#expression#Right . history AST#member_expression#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . history AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left user AST#expression#Right . phone AST#member_expression#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . phone AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left user AST#expression#Right . createdTime AST#member_expression#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . createdTime AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left user AST#expression#Right . lastLoginTime AST#member_expression#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . lastLoginTime AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left user AST#expression#Right . avatar AST#member_expression#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left obj AST#expression#Right . avatar AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left user AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /**
* 从JSON对象创建UserInfo实例
*/ AST#method_declaration#Left static fromJson AST#parameter_list#Left ( AST#parameter#Left json : AST#type_annotation#Left AST#primary_type#Left UserJsonData AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left UserInfo AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left UserInfo AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left json AST#expression#Right . id AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left json AST#expression#Right . username AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left json AST#expression#Right . password AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /**
* 转换为JSON对象
*/ AST#method_declaration#Left toJson AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left UserJsonData AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left data : AST#type_annotation#Left AST#primary_type#Left UserJsonData AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left id AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . id AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left username AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . username AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left password AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . password AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left like AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . like AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left history AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . history AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left phone AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . phone AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left createdTime AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . createdTime AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left lastLoginTime AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lastLoginTime AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left avatar AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avatar AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left data AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export class UserInfo {
id: number;
username: string;
password: string;
like?: string;
history?: string;
phone?: number;
createdTime?: number;
lastLoginTime?: number;
avatar?: string;
constructor(id: number, username: string, password: string) {
this.id = id;
this.username = username;
this.password = password;
this.createdTime = Date.now();
this.lastLoginTime = Date.now();
}
toCloudObject(): CloudDBZoneObject {
const cloudObject: CloudDBZoneObject = {
id: this.id,
username: this.username,
password: this.password,
like: this.like || '',
history: this.history || '',
phone: this.phone || 0,
createdTime: this.createdTime || Date.now(),
lastLoginTime: this.lastLoginTime || Date.now(),
avatar: this.avatar || ''
};
return cloudObject;
}
static fromCloudObject(obj: CloudDBZoneObject): UserInfo {
const user = new UserInfo(obj.id as number, obj.username as string, obj.password as string);
user.like = obj.like as string;
user.history = obj.history as string;
user.phone = obj.phone as number;
user.createdTime = obj.createdTime as number;
user.lastLoginTime = obj.lastLoginTime as number;
user.avatar = obj.avatar as string;
return user;
}
static fromJson(json: UserJsonData): UserInfo {
return new UserInfo(
json.id,
json.username,
json.password
);
}
toJson(): UserJsonData {
const data: UserJsonData = {
id: this.id,
username: this.username,
password: this.password,
like: this.like,
history: this.history,
phone: this.phone,
createdTime: this.createdTime,
lastLoginTime: this.lastLoginTime,
avatar: this.avatar
};
return data;
}
}
|
https://github.com/Tianpei-Shi/MusicDash.git/blob/4db7ea82fb9d9fa5db7499ccdd6d8d51a4bb48d5/src/model/UserModel.ets#L19-L94
|
c21d9d260a3437f1f0f269cb507450b4db39c4e3
|
github
|
|
openharmony/interface_sdk-js
|
c349adc73e2ec1f61f6fca489b5af059e3ed6999
|
api/arkui/component/gesture.d.ets
|
arkts
|
onActionCancel
|
The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event
is received.
@param { Callback<void> } event
@returns { PanGesture }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 20
|
onActionCancel(event: Callback<void>): PanGesture;
|
AST#method_declaration#Left onActionCancel AST#parameter_list#Left ( AST#parameter#Left event : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left PanGesture AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right
|
onActionCancel(event: Callback<void>): PanGesture;
|
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/component/gesture.d.ets#L529-L529
|
514c7cf6fca19417ac1e34b90821be463c848c22
|
gitee
|
awa_Liny/LinysBrowser_NEXT
|
a5cd96a9aa8114cae4972937f94a8967e55d4a10
|
home/src/main/ets/utils/ui_tools.ets
|
arkts
|
Enables the listeners for avoid area change.
Works OK in both window modes (free / traditional).
@param windowClass The window.Window object.
@param storage The LocalStorage of that window.
|
export function listen_focus(windowClass: window.Window, storage: LocalStorage) {
// Focus Listener
try {
windowClass.on("windowEvent", (windowEvent) => {
if (windowEvent == window.WindowEventType.WINDOW_ACTIVE || windowEvent == window.WindowEventType.WINDOW_SHOWN) {
// Focused
storage.setOrCreate('on_focus', true);
let id = storage.get('my_window_id') as string
AppStorage.setOrCreate('THE_WANT_HANDLER_OF_THE_WINDOWS', id);
console.log(`[Meow][listen_focus] Set THE_WANT_HANDLER_OF_THE_WINDOWS to [${id}]!`);
} else {
// Lose focus
storage.setOrCreate('on_focus', false);
}
});
} catch (e) {
console.error('[listen_focus] Failed: ' + e);
}
}
|
AST#export_declaration#Left export AST#function_declaration#Left function listen_focus AST#parameter_list#Left ( AST#parameter#Left windowClass : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left storage : AST#type_annotation#Left AST#primary_type#Left LocalStorage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { // Focus Listener AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left windowClass AST#expression#Right . on AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "windowEvent" AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left windowEvent AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left windowEvent AST#expression#Right == AST#expression#Left window AST#expression#Right AST#binary_expression#Right AST#expression#Right . WindowEventType AST#member_expression#Right AST#expression#Right . WINDOW_ACTIVE AST#member_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left windowEvent AST#expression#Right == AST#expression#Left window AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . WindowEventType AST#member_expression#Right AST#expression#Right . WINDOW_SHOWN AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // Focused AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left storage AST#expression#Right . setOrCreate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'on_focus' AST#expression#Right , AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left id = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left storage AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'my_window_id' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#ERROR#Left AppStorage AST#ERROR#Right . setOrCreate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'THE_WANT_HANDLER_OF_THE_WINDOWS' AST#expression#Right , AST#expression#Left id AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` [Meow][listen_focus] Set THE_WANT_HANDLER_OF_THE_WINDOWS to [ AST#template_substitution#Left $ { AST#expression#Left id AST#expression#Right } AST#template_substitution#Right ]! ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { // Lose focus AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left storage AST#expression#Right . setOrCreate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'on_focus' AST#expression#Right , AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( e ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left '[listen_focus] Failed: ' AST#expression#Right + AST#expression#Left e AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
|
export function listen_focus(windowClass: window.Window, storage: LocalStorage) {
try {
windowClass.on("windowEvent", (windowEvent) => {
if (windowEvent == window.WindowEventType.WINDOW_ACTIVE || windowEvent == window.WindowEventType.WINDOW_SHOWN) {
storage.setOrCreate('on_focus', true);
let id = storage.get('my_window_id') as string
AppStorage.setOrCreate('THE_WANT_HANDLER_OF_THE_WINDOWS', id);
console.log(`[Meow][listen_focus] Set THE_WANT_HANDLER_OF_THE_WINDOWS to [${id}]!`);
} else {
storage.setOrCreate('on_focus', false);
}
});
} catch (e) {
console.error('[listen_focus] Failed: ' + e);
}
}
|
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/ui_tools.ets#L247-L265
|
8fc1a4403483e3a0f58bca12f990cd40045df1b9
|
gitee
|
|
KoStudio/ArkTS-WordTree.git
|
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
|
entry/src/main/ets/models/datas/model/SearchManager.ets
|
arkts
|
getAllWords
|
获取所有单词
|
getAllWords(): WordUser[] {
return [...this.allWords];
}
|
AST#method_declaration#Left getAllWords AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left WordUser [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#array_literal#Left [ ... AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . allWords AST#member_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
getAllWords(): WordUser[] {
return [...this.allWords];
}
|
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/SearchManager.ets#L319-L321
|
d00e698ca199c4038b3e216d42d85b0a90836cba
|
github
|
XiangRui_FuZi/harmony-oscourse
|
da885f9a777a1eace7a07e1cd81137746687974b
|
class1/entry/src/main/ets/commons/utils/AudioRendererManager.ets
|
arkts
|
ready
|
初始化准备
|
private static async ready(fileName: string) {
try {
let bufferSize: number = 0;
let audioStreamInfo: audio.AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_16000, // 采样率
channels: audio.AudioChannel.CHANNEL_1, // 通道
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE, // 采样格式
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW // 编码格式
}
let audioRendererInfo: audio.AudioRendererInfo = {
usage: audio.StreamUsage.STREAM_USAGE_MUSIC, // 音频流使用类型
rendererFlags: 0 // 音频渲染器标志
}
let audioRendererOptions: audio.AudioRendererOptions = {
streamInfo: audioStreamInfo,
rendererInfo: audioRendererInfo
}
let path = getContext().filesDir;
// let filePath = `${path}/${fileName}.wav`;
let file: fileIo.File = fileIo.openSync(fileName, fileIo.OpenMode.READ_ONLY);
const fileSize = fileIo.statSync(file.path).size
let writeDataCallback = (buffer: ArrayBuffer) => {
let options: Options = {
offset: bufferSize,
length: buffer.byteLength
}
fileIo.readSync(file.fd, buffer, options);
bufferSize += buffer.byteLength;
// 自动停止
if (bufferSize >= fileSize) {
AudioRendererManager.stop()
.then(() => {
AudioRendererManager.release()
})
}
}
AudioRendererManager.audioRender = await audio.createAudioRenderer(audioRendererOptions)
AudioRendererManager.audioRender.on("writeData", writeDataCallback)
} catch (e) {
console.log("e", e.message, e.code)
}
}
|
AST#method_declaration#Left private static async ready AST#parameter_list#Left ( AST#parameter#Left fileName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left bufferSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left audioStreamInfo : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left audio . AudioStreamInfo AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left samplingRate AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left audio AST#expression#Right . AudioSamplingRate AST#member_expression#Right AST#expression#Right . SAMPLE_RATE_16000 AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , // 采样率 AST#property_assignment#Left AST#property_name#Left channels AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left audio AST#expression#Right . AudioChannel AST#member_expression#Right AST#expression#Right . CHANNEL_1 AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , // 通道 AST#property_assignment#Left AST#property_name#Left sampleFormat AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left audio AST#expression#Right . AudioSampleFormat AST#member_expression#Right AST#expression#Right . SAMPLE_FORMAT_S16LE AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , // 采样格式 AST#property_assignment#Left AST#property_name#Left encodingType AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left audio AST#expression#Right . AudioEncodingType AST#member_expression#Right AST#expression#Right . ENCODING_TYPE_RAW AST#member_expression#Right AST#expression#Right AST#property_assignment#Right // 编码格式 } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left audioRendererInfo : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left audio . AudioRendererInfo AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left usage AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left audio AST#expression#Right . StreamUsage AST#member_expression#Right AST#expression#Right . STREAM_USAGE_MUSIC AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , // 音频流使用类型 AST#property_assignment#Left AST#property_name#Left rendererFlags AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right // 音频渲染器标志 } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left audioRendererOptions : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left audio . AudioRendererOptions AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left streamInfo AST#property_name#Right : AST#expression#Left audioStreamInfo AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left rendererInfo AST#property_name#Right : AST#expression#Left audioRendererInfo AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left path = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left getContext AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . filesDir AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // let filePath = `${path}/${fileName}.wav`; AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left file : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left fileIo . File AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . openSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left fileName AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . READ_ONLY AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left fileSize = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . statSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left file AST#expression#Right . path AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . size AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left writeDataCallback = AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left buffer : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left options : AST#type_annotation#Left AST#primary_type#Left Options AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left offset AST#property_name#Right : AST#expression#Left bufferSize AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left length AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left buffer AST#expression#Right . byteLength AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#ERROR#Left fileIo AST#ERROR#Right . readSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left file AST#expression#Right . fd AST#member_expression#Right AST#expression#Right , AST#expression#Left buffer AST#expression#Right , AST#expression#Left options AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left bufferSize += AST#expression#Left AST#member_expression#Left AST#expression#Left buffer AST#expression#Right . byteLength AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 自动停止 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left bufferSize AST#expression#Right >= AST#expression#Left fileSize AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AudioRendererManager AST#expression#Right . stop AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . then AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AudioRendererManager AST#expression#Right . release AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#ERROR#Left AudioRendererManager AST#ERROR#Right . audioRender AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left audio AST#expression#Right AST#await_expression#Right AST#expression#Right . createAudioRenderer AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left audioRendererOptions AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#ERROR#Left AudioRendererManager AST#ERROR#Right . audioRender AST#member_expression#Right AST#expression#Right . on AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "writeData" AST#expression#Right , AST#expression#Left writeDataCallback AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( e ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "e" AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left e AST#expression#Right . message AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left e AST#expression#Right . code AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
private static async ready(fileName: string) {
try {
let bufferSize: number = 0;
let audioStreamInfo: audio.AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_16000,
channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
}
let audioRendererInfo: audio.AudioRendererInfo = {
usage: audio.StreamUsage.STREAM_USAGE_MUSIC,
rendererFlags: 0
}
let audioRendererOptions: audio.AudioRendererOptions = {
streamInfo: audioStreamInfo,
rendererInfo: audioRendererInfo
}
let path = getContext().filesDir;
let file: fileIo.File = fileIo.openSync(fileName, fileIo.OpenMode.READ_ONLY);
const fileSize = fileIo.statSync(file.path).size
let writeDataCallback = (buffer: ArrayBuffer) => {
let options: Options = {
offset: bufferSize,
length: buffer.byteLength
}
fileIo.readSync(file.fd, buffer, options);
bufferSize += buffer.byteLength;
if (bufferSize >= fileSize) {
AudioRendererManager.stop()
.then(() => {
AudioRendererManager.release()
})
}
}
AudioRendererManager.audioRender = await audio.createAudioRenderer(audioRendererOptions)
AudioRendererManager.audioRender.on("writeData", writeDataCallback)
} catch (e) {
console.log("e", e.message, e.code)
}
}
|
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/utils/AudioRendererManager.ets#L26-L68
|
8d50fdc34e97d1c69ce62a165848ed7f4b7f4b9b
|
gitee
|
openharmony-tpc-incubate/photo-deal-demo
|
01382ce30b1785f8fc8bc14f6b94f0a670a5b50b
|
library/src/main/ets/components/textInput/TextEditNodeController.ets
|
arkts
|
canAddTextInputNode
|
是否可以添加文本节点
@returns true:可以添加 false:不可以添加
|
canAddTextInputNode(): boolean {
let topRecord = this.textRecords.length > 0 ? this.textRecords[this.textRecords.length - 1] : undefined;
if (topRecord?.data instanceof TextInputData && topRecord.data.isActivated()) {
// 最上面是文本如果处于编辑态则切换到非激活态,并且当前不添加文本
topRecord.data.setActivated(false);
return false;
}
let edgeVisibleRecords = this.textRecords.filter((record: OperateRecord) => {
return record.data instanceof TextInputData && record.data.isActivated();
});
// 存在非顶部处于激活状态的文本节点也要切换到非激活态,并且当前不添加文本
if (edgeVisibleRecords && edgeVisibleRecords.length > 0) {
edgeVisibleRecords.forEach((record: OperateRecord) => {
(record.data as TextInputData)?.setActivated(false);
});
return false;
}
return true;
}
|
AST#method_declaration#Left canAddTextInputNode AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left topRecord = AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textRecords AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textRecords AST#member_expression#Right AST#expression#Right [ AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textRecords AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right : AST#expression#Left undefined AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left topRecord AST#expression#Right ?. data AST#member_expression#Right AST#expression#Right instanceof AST#expression#Left TextInputData AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left topRecord AST#expression#Right AST#binary_expression#Right AST#expression#Right . data AST#member_expression#Right AST#expression#Right . isActivated AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { // 最上面是文本如果处于编辑态则切换到非激活态,并且当前不添加文本 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left topRecord AST#expression#Right . data AST#member_expression#Right AST#expression#Right . setActivated AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left edgeVisibleRecords = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textRecords AST#member_expression#Right AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left record : AST#type_annotation#Left AST#primary_type#Left OperateRecord AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left record AST#expression#Right . data AST#member_expression#Right AST#expression#Right instanceof AST#expression#Left TextInputData AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left record AST#expression#Right AST#binary_expression#Right AST#expression#Right . data AST#member_expression#Right AST#expression#Right . isActivated AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 存在非顶部处于激活状态的文本节点也要切换到非激活态,并且当前不添加文本 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left edgeVisibleRecords AST#expression#Right && AST#expression#Left edgeVisibleRecords AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left edgeVisibleRecords AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left record : AST#type_annotation#Left AST#primary_type#Left OperateRecord AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left record AST#expression#Right . data AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left TextInputData AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right ?. setActivated AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
canAddTextInputNode(): boolean {
let topRecord = this.textRecords.length > 0 ? this.textRecords[this.textRecords.length - 1] : undefined;
if (topRecord?.data instanceof TextInputData && topRecord.data.isActivated()) {
topRecord.data.setActivated(false);
return false;
}
let edgeVisibleRecords = this.textRecords.filter((record: OperateRecord) => {
return record.data instanceof TextInputData && record.data.isActivated();
});
if (edgeVisibleRecords && edgeVisibleRecords.length > 0) {
edgeVisibleRecords.forEach((record: OperateRecord) => {
(record.data as TextInputData)?.setActivated(false);
});
return false;
}
return true;
}
|
https://github.com/openharmony-tpc-incubate/photo-deal-demo/blob/01382ce30b1785f8fc8bc14f6b94f0a670a5b50b/library/src/main/ets/components/textInput/TextEditNodeController.ets#L155-L175
|
9fe57c54fb10fbb576fc2df18e3514c9e8640d5d
|
gitee
|
openharmony/codelabs
|
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
|
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
|
arkts
|
refresh
|
Refresh.
|
private refresh(): void {
if (this.ctx !== undefined && this.input !== undefined && this.canvasReady) {
this.drawImage();
this.drawCrop();
}
}
|
AST#method_declaration#Left private refresh AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ctx AST#member_expression#Right AST#expression#Right !== AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . input AST#member_expression#Right AST#expression#Right !== AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . canvasReady AST#member_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . drawImage AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . drawCrop AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
private refresh(): void {
if (this.ctx !== undefined && this.input !== undefined && this.canvasReady) {
this.drawImage();
this.drawCrop();
}
}
|
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets#L431-L436
|
3cbb14ba0596088e9bad528f4e7235791756f6d1
|
gitee
|
YShelter/Accouting_ArkTS.git
|
8c663c85f2c11738d4eabf269c23dc1ec84eb013
|
entry/src/main/ets/common/database/Rdb/RdbHelperImp.ets
|
arkts
|
createTable
|
上层接口 调用 createTableSql 生成 sql 语句, executeSql 执行
|
createTable(tableName: string, columns: Array<ColumnInfo>): Promise<void> {
let createTableSql = tableHelper.createTableSql(tableName, columns);
return this.executeSql(createTableSql);
}
|
AST#method_declaration#Left createTable AST#parameter_list#Left ( AST#parameter#Left tableName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left columns : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ColumnInfo AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left createTableSql = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left tableHelper AST#expression#Right . createTableSql AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left tableName AST#expression#Right , AST#expression#Left columns AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . executeSql AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left createTableSql AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
createTable(tableName: string, columns: Array<ColumnInfo>): Promise<void> {
let createTableSql = tableHelper.createTableSql(tableName, columns);
return this.executeSql(createTableSql);
}
|
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Rdb/RdbHelperImp.ets#L43-L46
|
ec9b06c7da3a59cb31ed9fe6d4745a42101c00ea
|
github
|
pangpang20/wavecast.git
|
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
|
entry/src/main/ets/pages/PodcastDetailPage.ets
|
arkts
|
showUnsubscribeDialog
|
显示取消订阅确认对话框
|
showUnsubscribeDialog(): void {
if (!this.podcast) return;
const buttons: ButtonOptions[] = [
new ButtonOptions('取消', '#999999'),
new ButtonOptions('确定', '#FF3B30')
];
UIUtils.showDialog(new DialogOptions(
'取消订阅',
`确定要取消订阅《${this.podcast.title}》吗?\n\n取消订阅后,该播客的所有单集和下载内容都将被删除。`,
buttons
)).then((index: number) => {
if (index === 1) {
// 用户点击“确定”,执行取消订阅
this.unsubscribePodcast();
}
});
}
|
AST#method_declaration#Left showUnsubscribeDialog AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right . podcast AST#member_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left buttons : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ButtonOptions [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ButtonOptions AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '取消' AST#expression#Right , AST#expression#Left '#999999' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ButtonOptions AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '确定' AST#expression#Right , AST#expression#Left '#FF3B30' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left UIUtils AST#expression#Right . showDialog AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left DialogOptions AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '取消订阅' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` 确定要取消订阅《 AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . podcast AST#member_expression#Right AST#expression#Right . title AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right 》吗? \n \n 取消订阅后,该播客的所有单集和下载内容都将被删除。 ` AST#template_literal#Right AST#expression#Right , AST#expression#Left buttons AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . then AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { // 用户点击“确定”,执行取消订阅 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . unsubscribePodcast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
showUnsubscribeDialog(): void {
if (!this.podcast) return;
const buttons: ButtonOptions[] = [
new ButtonOptions('取消', '#999999'),
new ButtonOptions('确定', '#FF3B30')
];
UIUtils.showDialog(new DialogOptions(
'取消订阅',
`确定要取消订阅《${this.podcast.title}》吗?\n\n取消订阅后,该播客的所有单集和下载内容都将被删除。`,
buttons
)).then((index: number) => {
if (index === 1) {
this.unsubscribePodcast();
}
});
}
|
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/PodcastDetailPage.ets#L247-L264
|
23023c8a2bdece03f01e30bd582e5c8e09248cbb
|
github
|
openharmony/applications_app_samples
|
a826ab0e75fe51d028c1c5af58188e908736b53b
|
code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets
|
arkts
|
seniorVersion
|
Senior版本号,随局部架构、重大特性增加。
|
static seniorVersion(): string {
return deviceInfo.seniorVersion + ''
}
|
AST#method_declaration#Left static seniorVersion AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left deviceInfo AST#expression#Right . seniorVersion AST#member_expression#Right AST#expression#Right + AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static seniorVersion(): string {
return deviceInfo.seniorVersion + ''
}
|
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets#L147-L149
|
1a23a60f7bd6bd414f7a93063dc3cb31312897be
|
gitee
|
openharmony/developtools_profiler
|
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
|
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/BarLineScatterCandleBubbleDataSet.ets
|
arkts
|
Baseclass of all DataSets for Bar-, Line-, Scatter- and CandleStickChart.
|
export default abstract class BarLineScatterCandleBubbleDataSet<T extends EntryOhos>
extends DataSet<T>
implements IBarLineScatterCandleBubbleDataSet<T> {
/**
* default highlight color
*/
protected mHighLightColor: number = 0xffbb73;
constructor(yVals: JArrayList<T>, label: string) {
super(yVals, label);
}
/**
* Sets the color that is used for drawing the highlight indicators. Dont
* forget to resolve the color using getResources().getColor(...) or
* Color.rgb(...).
*
* @param color
*/
public setHighLightColor(color: number): void {
this.mHighLightColor = color;
}
public getHighLightColor(): number {
return this.mHighLightColor;
}
protected copyTo(barLineScatterCandleBubbleDataSet: BarLineScatterCandleBubbleDataSet<T>): void {
super.copyTo(barLineScatterCandleBubbleDataSet);
barLineScatterCandleBubbleDataSet.mHighLightColor = this.mHighLightColor;
}
}
|
AST#export_declaration#Left export default AST#class_declaration#Left abstract class BarLineScatterCandleBubbleDataSet AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left EntryOhos AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left DataSet AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#implements_clause#Left implements AST#generic_type#Left IBarLineScatterCandleBubbleDataSet AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#implements_clause#Right AST#class_body#Left { /**
* default highlight color
*/ AST#property_declaration#Left protected mHighLightColor : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0xffbb73 AST#expression#Right ; AST#property_declaration#Right AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left yVals : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left JArrayList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left label : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left super AST#expression#Right AST#argument_list#Left ( AST#expression#Left yVals AST#expression#Right , AST#expression#Left label AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right /**
* Sets the color that is used for drawing the highlight indicators. Dont
* forget to resolve the color using getResources().getColor(...) or
* Color.rgb(...).
*
* @param color
*/ AST#method_declaration#Left public setHighLightColor AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mHighLightColor AST#member_expression#Right = AST#expression#Left color AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left public getHighLightColor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mHighLightColor AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left protected copyTo AST#parameter_list#Left ( AST#parameter#Left barLineScatterCandleBubbleDataSet : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left BarLineScatterCandleBubbleDataSet AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left super AST#expression#Right . copyTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left barLineScatterCandleBubbleDataSet AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left barLineScatterCandleBubbleDataSet AST#expression#Right . mHighLightColor AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mHighLightColor AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export default abstract class BarLineScatterCandleBubbleDataSet<T extends EntryOhos>
extends DataSet<T>
implements IBarLineScatterCandleBubbleDataSet<T> {
protected mHighLightColor: number = 0xffbb73;
constructor(yVals: JArrayList<T>, label: string) {
super(yVals, label);
}
public setHighLightColor(color: number): void {
this.mHighLightColor = color;
}
public getHighLightColor(): number {
return this.mHighLightColor;
}
protected copyTo(barLineScatterCandleBubbleDataSet: BarLineScatterCandleBubbleDataSet<T>): void {
super.copyTo(barLineScatterCandleBubbleDataSet);
barLineScatterCandleBubbleDataSet.mHighLightColor = this.mHighLightColor;
}
}
|
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/BarLineScatterCandleBubbleDataSet.ets#L25-L56
|
f47402d6b0d8bc59518f2a8c8343a6c9b4ef2fb9
|
gitee
|
|
tongyuyan/harmony-utils
|
697472f011a43e783eeefaa28ef9d713c4171726
|
harmony_utils/src/main/ets/utils/StrUtil.ets
|
arkts
|
isNotEmpty
|
判断字符串是否为非空。true为非空空,否则false
@param str
@returns
|
static isNotEmpty(str: string | undefined | null): boolean {
return false === StrUtil.isEmpty(str);
}
|
AST#method_declaration#Left static isNotEmpty AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right === AST#expression#Left StrUtil AST#expression#Right AST#binary_expression#Right AST#expression#Right . isEmpty AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static isNotEmpty(str: string | undefined | null): boolean {
return false === StrUtil.isEmpty(str);
}
|
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/StrUtil.ets#L63-L65
|
de2e880539fe6173e792126ad6782aba5ffefd27
|
gitee
|
huangwei021230/HarmonyFlow.git
|
427f918873b0c9efdc975ff4889726b1bfccc546
|
entry/src/main/ets/lib/Pointer.ets
|
arkts
|
An iterator for PointerMap.
|
export class PointerIterator<P extends Pointer> implements Iterator<P> {
private index: number = 0;
constructor(private pointerMap: PointerMap<P>) {}
/**
* Checks if there are more elements to iterate over.
* @returns True if there are more elements, otherwise false.
*/
hasNext(): boolean {
do {
if (this.pointerMap.getPointer(this.index) != null) {
return true;
}
}
|
AST#export_declaration#Left export AST#class_declaration#Left class PointerIterator AST#type_parameters#Left < AST#type_parameter#Left P extends AST#type_annotation#Left AST#primary_type#Left Pointer AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#implements_clause#Left implements AST#generic_type#Left Iterator AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left P AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left private index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left private AST#ERROR#Left po in terMap AST#ERROR#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left PointerMap AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left P AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { } AST#block_statement#Right AST#constructor_declaration#Right /**
* Checks if there are more elements to iterate over.
* @returns True if there are more elements, otherwise false.
*/ AST#method_declaration#Left hasNext AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#ERROR#Left AST#expression_statement#Left AST#expression#Left do AST#expression#Right AST#expression_statement#Right { AST#property_name#Left if AST#property_name#Right ( this AST#modifier_chain_expression#Left . pointerMap AST#modifier_chain_expression#Left . getPointer ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . index AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right ! = AST#ERROR#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left ) { AST#property_assignment#Left return AST#property_assignment#Right AST#ERROR#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export class PointerIterator<P extends Pointer> implements Iterator<P> {
private index: number = 0;
constructor(private pointerMap: PointerMap<P>) {}
hasNext(): boolean {
do {
if (this.pointerMap.getPointer(this.index) != null) {
return true;
}
}
|
https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/lib/Pointer.ets#L128-L142
|
2e766c7999fd5f562ea76cfc23c71487e7ecdf60
|
github
|
|
openharmony-tpc-incubate/photo-deal-demo
|
01382ce30b1785f8fc8bc14f6b94f0a670a5b50b
|
library/src/main/ets/util/TextInputUtils.ets
|
arkts
|
计算矩形弧度
@param xOffset x偏移
@param yOffset y偏移
@param degree 角度
@returns 矩形旋转弧度
|
export function calcRectangleRadians(xOffset: number, yOffset: number, degree: number): number {
if (xOffset === 0) {
return 0
} else {
// 弧度
const radians = Math.atan(yOffset / xOffset);
// 转换为角度
const yDegree = radians * (180 / Math.PI);
// 计算基于当前角度新旋转的弧度
let newRadians = (yDegree - degree) * (Math.PI / 180)
return newRadians;
}
}
|
AST#export_declaration#Left export AST#function_declaration#Left function calcRectangleRadians AST#parameter_list#Left ( AST#parameter#Left xOffset : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left yOffset : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left degree : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left xOffset AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left 0 AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { // 弧度 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left radians = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Math AST#expression#Right . atan AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left yOffset AST#expression#Right / AST#expression#Left xOffset AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 转换为角度 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left yDegree = AST#expression#Left AST#binary_expression#Left AST#expression#Left radians AST#expression#Right * AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 180 AST#expression#Right / AST#expression#Left Math AST#expression#Right AST#binary_expression#Right AST#expression#Right . PI AST#member_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 计算基于当前角度新旋转的弧度 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left newRadians = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left yDegree AST#expression#Right - AST#expression#Left degree AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right * AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Math AST#expression#Right . PI AST#member_expression#Right AST#expression#Right / AST#expression#Left 180 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left newRadians AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
|
export function calcRectangleRadians(xOffset: number, yOffset: number, degree: number): number {
if (xOffset === 0) {
return 0
} else {
const radians = Math.atan(yOffset / xOffset);
const yDegree = radians * (180 / Math.PI);
let newRadians = (yDegree - degree) * (Math.PI / 180)
return newRadians;
}
}
|
https://github.com/openharmony-tpc-incubate/photo-deal-demo/blob/01382ce30b1785f8fc8bc14f6b94f0a670a5b50b/library/src/main/ets/util/TextInputUtils.ets#L54-L66
|
3fe164b01e830e1d43feaa729c635fbd452d5935
|
gitee
|
|
openharmony/arkui_ace_engine
|
30c7d1ee12fbedf0fabece54291d75897e2ad44f
|
examples/Select/entry/src/main/ets/pages/components/toggle/toggleColor.ets
|
arkts
|
ToggleColorBuilder
|
Copyright (c) 2025 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.
|
@Builder
export function ToggleColorBuilder(name: string, param: Object) {
ToggleColorExample()
}
|
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function ToggleColorBuilder AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left param : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ToggleColorExample ( ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#decorated_export_declaration#Right
|
@Builder
export function ToggleColorBuilder(name: string, param: Object) {
ToggleColorExample()
}
|
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/toggle/toggleColor.ets#L16-L19
|
36dd4e48a0344fa438597a69567eea4fc1a1836d
|
gitee
|
IceYuanyyy/OxHornCampus.git
|
bb5686f77fa36db89687502e35898cda218d601f
|
entry/src/main/ets/common/utils/SwiperDataSource.ets
|
arkts
|
IDataSource interface.
|
export class SwiperDataSource implements IDataSource {
private list: ZonesItem[] = [];
private listeners: DataChangeListener[] = [];
constructor(list: ZonesItem[]) {
this.list = list;
}
totalCount(): number {
return this.list.length;
}
getData(index: number): ZonesItem {
return this.list[index];
}
registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
this.listeners.push(listener);
}
}
unregisterDataChangeListener() {
}
}
|
AST#export_declaration#Left export AST#class_declaration#Left class SwiperDataSource AST#implements_clause#Left implements IDataSource AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left private list : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ZonesItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left private listeners : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DataChangeListener [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left list : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ZonesItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . list AST#member_expression#Right = AST#expression#Left list AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right AST#method_declaration#Left totalCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . list AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ZonesItem AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . list AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left registerDataChangeListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left DataChangeListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . indexOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right < AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#method_declaration#Left unregisterDataChangeListener AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export class SwiperDataSource implements IDataSource {
private list: ZonesItem[] = [];
private listeners: DataChangeListener[] = [];
constructor(list: ZonesItem[]) {
this.list = list;
}
totalCount(): number {
return this.list.length;
}
getData(index: number): ZonesItem {
return this.list[index];
}
registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
this.listeners.push(listener);
}
}
unregisterDataChangeListener() {
}
}
|
https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/common/utils/SwiperDataSource.ets#L21-L45
|
9b62dc851c8d797096d923b898c1d09ff5e09472
|
github
|
|
vhall/VHLive_SDK_Harmony
|
29c820e5301e17ae01bc6bdcc393a4437b518e7c
|
watchKit/src/main/ets/components/player/VHWatchVodPlayerComponent.ets
|
arkts
|
onVodSeekDuration
|
@description 监听SeekTime,用于刷新进度条长度
@param duration 当前时长,单位为毫秒(ms)。
|
onVodSeekDuration(duration: number) {
}
|
AST#method_declaration#Left onVodSeekDuration AST#parameter_list#Left ( AST#parameter#Left duration : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
|
onVodSeekDuration(duration: number) {
}
|
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/player/VHWatchVodPlayerComponent.ets#L418-L420
|
b2ce9d4f168eede96a9e77a3210d2c8cd925c5fa
|
gitee
|
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
|
6231773905435f000d00d94b26504433082ba40b
|
packages/declarations/ets/api/@ohos.arkui.advanced.SelectTitleBar.d.ets
|
arkts
|
@file
@kit ArkUI
Declaration of the menu item on the right side.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Declaration of the menu item on the right side.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11
|
export declare class SelectTitleBarMenuItem {
/**
* Icon resource for this menu item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Icon resource for this menu item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
*/
value: ResourceStr;
/**
* Icon label for this menu item.
* @type { ?ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 13
*/
label?: ResourceStr;
/**
* Whether to enable this menu item.
* @type { ?boolean }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Whether to enable this menu item.
* @type { ?boolean }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
*/
isEnabled?: boolean;
/**
* Callback function when click on this menu item.
* @type { ?() => void }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Callback function when click on this menu item.
* @type { ?() => void }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
*/
action?: () => void;
}
|
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class SelectTitleBarMenuItem AST#class_body#Left { /**
* Icon resource for this menu item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/ /**
* Icon resource for this menu item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
*/ AST#property_declaration#Left value : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /**
* Icon label for this menu item.
* @type { ?ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 13
*/ AST#property_declaration#Left label ? : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /**
* Whether to enable this menu item.
* @type { ?boolean }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/ /**
* Whether to enable this menu item.
* @type { ?boolean }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
*/ AST#property_declaration#Left isEnabled ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /**
* Callback function when click on this menu item.
* @type { ?() => void }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/ /**
* Callback function when click on this menu item.
* @type { ?() => void }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
*/ AST#property_declaration#Left action ? : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right ; AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export declare class SelectTitleBarMenuItem {
value: ResourceStr;
label?: ResourceStr;
isEnabled?: boolean;
action?: () => void;
}
|
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.SelectTitleBar.d.ets#L30-L81
|
4b8defabb9dcb1841f78972e2c34a52948d6cff5
|
github
|
|
KoStudio/ArkTS-WordTree.git
|
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
|
entry/src/main/ets/app/debug/DebugFlg.ets
|
arkts
|
isDebugMode
|
private static readonly isDebug: boolean = true; // 编译时配置
|
static isDebugMode(): boolean {
// return DebugFlg.isDebug;
// 获取应用是否为Release环境
let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION;
let mBundleInfo = bundleManager.getBundleInfoForSelfSync(bundleFlags);
let isRelease = !mBundleInfo.appInfo.debug; // debug为false时即Release环境
return !isRelease
}
|
AST#method_declaration#Left static isDebugMode AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // return DebugFlg.isDebug; // 获取应用是否为Release环境 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left bundleFlags = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left bundleManager AST#expression#Right . BundleFlag AST#member_expression#Right AST#expression#Right . GET_BUNDLE_INFO_WITH_APPLICATION AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left mBundleInfo = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left bundleManager AST#expression#Right . getBundleInfoForSelfSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left bundleFlags AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left isRelease = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left mBundleInfo AST#expression#Right AST#unary_expression#Right AST#expression#Right . appInfo AST#member_expression#Right AST#expression#Right . debug AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // debug为false时即Release环境 AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#unary_expression#Left ! AST#expression#Left isRelease AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static isDebugMode(): boolean {
let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION;
let mBundleInfo = bundleManager.getBundleInfoForSelfSync(bundleFlags);
let isRelease = !mBundleInfo.appInfo.debug;
return !isRelease
}
|
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/debug/DebugFlg.ets#L8-L18
|
fe876fd6af1f846520a6f58a20f6f842046ea1d7
|
github
|
tongyuyan/harmony-utils
|
697472f011a43e783eeefaa28ef9d713c4171726
|
harmony_speech/src/main/ets/Helper.ets
|
arkts
|
isNotEmpty
|
判断字符串是否为非空。true为非空空,否则false
@param str
@returns
|
static isNotEmpty(str: string | undefined | null): boolean {
return false === Helper.isEmpty(str);
}
|
AST#method_declaration#Left static isNotEmpty AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right === AST#expression#Left Helper AST#expression#Right AST#binary_expression#Right AST#expression#Right . isEmpty AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static isNotEmpty(str: string | undefined | null): boolean {
return false === Helper.isEmpty(str);
}
|
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_speech/src/main/ets/Helper.ets#L42-L44
|
2138baf0287790ef106f4beebb5e6c2a05241713
|
gitee
|
tongyuyan/harmony-utils
|
697472f011a43e783eeefaa28ef9d713c4171726
|
harmony_web/src/main/ets/utils/Tools.ets
|
arkts
|
isResource
|
判断是否是Resource类型
|
static isResource(value: Any) {
if (value) {
const res = value as Resource;
return StrUtils.isNotNull(res?.id) && StrUtils.isNotNull(res?.bundleName) && StrUtils.isNotNull(res?.moduleName);
}
return false;
}
|
AST#method_declaration#Left static isResource AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left value AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left res = AST#expression#Left AST#as_expression#Left AST#expression#Left value AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left StrUtils AST#expression#Right . isNotNull AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left res AST#expression#Right ?. id AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right && AST#expression#Left StrUtils AST#expression#Right AST#binary_expression#Right AST#expression#Right . isNotNull AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left res AST#expression#Right ?. bundleName AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right && AST#expression#Left StrUtils AST#expression#Right AST#binary_expression#Right AST#expression#Right . isNotNull AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left res AST#expression#Right ?. moduleName AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static isResource(value: Any) {
if (value) {
const res = value as Resource;
return StrUtils.isNotNull(res?.id) && StrUtils.isNotNull(res?.bundleName) && StrUtils.isNotNull(res?.moduleName);
}
return false;
}
|
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/Tools.ets#L357-L363
|
306a1ad749c82494817207b685d9c90f91161838
|
gitee
|
tongyuyan/harmony-utils
|
697472f011a43e783eeefaa28ef9d713c4171726
|
harmony_dialog/src/main/ets/utils/Helper.ets
|
arkts
|
getAlignment
|
将DialogAlignment值转化为Alignment值
|
static getAlignment(dialogAlignment: DialogAlignment): Alignment | undefined {
switch (dialogAlignment) {
case DialogAlignment.Top:
return Alignment.Top;
case DialogAlignment.Center:
return Alignment.Center;
case DialogAlignment.Bottom:
return Alignment.Bottom;
case DialogAlignment.TopStart:
return Alignment.TopStart;
case DialogAlignment.TopEnd:
return Alignment.TopEnd;
case DialogAlignment.CenterStart:
return Alignment.Start;
case DialogAlignment.CenterEnd:
return Alignment.End;
case DialogAlignment.BottomStart:
return Alignment.BottomStart;
case DialogAlignment.BottomEnd:
return Alignment.BottomEnd;
case DialogAlignment.Default:
return undefined;
}
|
AST#method_declaration#Left static getAlignment AST#parameter_list#Left ( AST#parameter#Left dialogAlignment : AST#type_annotation#Left AST#primary_type#Left DialogAlignment AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Alignment AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left switch AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left ( AST#expression#Left dialogAlignment AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . Top AST#member_expression#Right AST#expression#Right AST#expression_statement#Right : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . Top AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . Center AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . Center AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . Bottom AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . Bottom AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . TopStart AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . TopStart AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . TopEnd AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . TopEnd AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . CenterStart AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . CenterEnd AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . End AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . BottomStart AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . BottomStart AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . BottomEnd AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right . BottomEnd AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left DialogAlignment AST#expression#Right . Default AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left undefined AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
static getAlignment(dialogAlignment: DialogAlignment): Alignment | undefined {
switch (dialogAlignment) {
case DialogAlignment.Top:
return Alignment.Top;
case DialogAlignment.Center:
return Alignment.Center;
case DialogAlignment.Bottom:
return Alignment.Bottom;
case DialogAlignment.TopStart:
return Alignment.TopStart;
case DialogAlignment.TopEnd:
return Alignment.TopEnd;
case DialogAlignment.CenterStart:
return Alignment.Start;
case DialogAlignment.CenterEnd:
return Alignment.End;
case DialogAlignment.BottomStart:
return Alignment.BottomStart;
case DialogAlignment.BottomEnd:
return Alignment.BottomEnd;
case DialogAlignment.Default:
return undefined;
}
|
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/utils/Helper.ets#L270-L292
|
fcd5f420544510ca8f04c31d2caea1a1f3969abe
|
gitee
|
Piagari/arkts_example.git
|
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
|
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/LazyIDataSource/FileListDataSource.ets
|
arkts
|
reloadNewData
|
重新加载
|
public reloadNewData(data: FolderAndFileItem[]): void {
this.dataArray = []
for (const d of data) {
this.dataArray.push(d);
this.notifyDataAdd(this.dataArray.length - 1);
}
this.notifyDataReload()
}
|
AST#method_declaration#Left public reloadNewData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left FolderAndFileItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dataArray AST#member_expression#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( const d of AST#expression#Left data AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dataArray AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left d AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . notifyDataAdd AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dataArray AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . notifyDataReload AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
public reloadNewData(data: FolderAndFileItem[]): void {
this.dataArray = []
for (const d of data) {
this.dataArray.push(d);
this.notifyDataAdd(this.dataArray.length - 1);
}
this.notifyDataReload()
}
|
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/LazyIDataSource/FileListDataSource.ets#L40-L47
|
72db1c60e1f54ce2fa10a8dc48454e42c7260315
|
github
|
openharmony/developtools_profiler
|
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
|
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ScaleMode.ets
|
arkts
|
onTouch
|
view 调用的触摸事件 此事件可分发 缩放、平移两个事件,缩放 监听为两指
@param event
|
public onTouch(event: TouchEvent) {
/**
* 监听按下手指的数量,最大监听两个手指
*/
if (event.type === TouchType.Down) {
this.firstTouch = event.touches[0];
if (event.touches.length > 1) {
this.secondTouch = event.touches[1];
} else {
this.startMoveX = 0;
this.startMoveY = 0;
}
}
if (event.type === TouchType.Up) {
//双指 突然变一指 后,界面将不在移动
if (event.touches.length == 1) {
if (this.isZoom == true) {
this.preTouchScaleX = this.scaleX;
}
this.isZoom = false;
}
}
}
|
AST#method_declaration#Left public onTouch AST#parameter_list#Left ( AST#parameter#Left event : AST#type_annotation#Left AST#primary_type#Left TouchEvent AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { /**
* 监听按下手指的数量,最大监听两个手指
*/ AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left event AST#expression#Right . type AST#member_expression#Right AST#expression#Right === AST#expression#Left TouchType AST#expression#Right AST#binary_expression#Right AST#expression#Right . Down AST#member_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . firstTouch AST#member_expression#Right = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left event AST#expression#Right . touches AST#member_expression#Right AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left event AST#expression#Right . touches AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . secondTouch AST#member_expression#Right = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left event AST#expression#Right . touches AST#member_expression#Right AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } else { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . startMoveX AST#member_expression#Right = AST#expression#Left 0 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . startMoveY AST#member_expression#Right = AST#expression#Left 0 AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left event AST#expression#Right . type AST#member_expression#Right AST#expression#Right === AST#expression#Left TouchType AST#expression#Right AST#binary_expression#Right AST#expression#Right . Up AST#member_expression#Right AST#expression#Right ) { //双指 突然变一指 后,界面将不在移动 AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left event AST#expression#Right . touches AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right == AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isZoom AST#member_expression#Right AST#expression#Right == AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . preTouchScaleX AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . scaleX AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isZoom AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
public onTouch(event: TouchEvent) {
if (event.type === TouchType.Down) {
this.firstTouch = event.touches[0];
if (event.touches.length > 1) {
this.secondTouch = event.touches[1];
} else {
this.startMoveX = 0;
this.startMoveY = 0;
}
}
if (event.type === TouchType.Up) {
if (event.touches.length == 1) {
if (this.isZoom == true) {
this.preTouchScaleX = this.scaleX;
}
this.isZoom = false;
}
}
}
|
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ScaleMode.ets#L136-L158
|
7c80b8b9d4c3422a3e0f6717b4e7b7c5a3c7e667
|
gitee
|
openharmony/codelabs
|
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
|
Data/Preferences/entry/src/main/ets/model/PreferenceModel.ets
|
arkts
|
getFruitData
|
Process the data obtained from the database.
|
async getFruitData() {
this.fruitData = await this.getPreference();
return this.fruitData;
}
|
AST#method_declaration#Left async getFruitData AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fruitData AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . getPreference AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fruitData AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
async getFruitData() {
this.fruitData = await this.getPreference();
return this.fruitData;
}
|
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Data/Preferences/entry/src/main/ets/model/PreferenceModel.ets#L102-L105
|
b3354d7284e06d1b5f3eb9732b1ab3ea1a9aa65d
|
gitee
|
openharmony/applications_app_samples
|
a826ab0e75fe51d028c1c5af58188e908736b53b
|
code/UI/VerifyCode/casesfeature/verifycode/src/main/ets/view/VerifyCodeView.ets
|
arkts
|
attach
|
TODO 知识点:绑定输入法
|
async attach() {
await this.inputController.attach(true, this.textConfig);
logger.info('attached');
}
|
AST#method_declaration#Left async attach AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . inputController AST#member_expression#Right AST#expression#Right . attach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . textConfig AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'attached' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
async attach() {
await this.inputController.attach(true, this.textConfig);
logger.info('attached');
}
|
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/VerifyCode/casesfeature/verifycode/src/main/ets/view/VerifyCodeView.ets#L97-L100
|
66a8b5c54b00063bbe7c1b45642100a6b2123b1a
|
gitee
|
harmonyos-cases/cases
|
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
|
CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets
|
arkts
|
unregisterDataChangeListener
|
Unregister data change listener
|
unregisterDataChangeListener(): void {
}
|
AST#method_declaration#Left unregisterDataChangeListener AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
|
unregisterDataChangeListener(): void {
}
|
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets#L58-L59
|
e0f503e9388c1967445615883b59f45428dbec71
|
gitee
|
openharmony/codelabs
|
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
|
Distributed/HandleGameApplication/HandleEtsOpenHarmony/entry/src/main/ets/MainAbility/pages/index.ets
|
arkts
|
await
|
当被拉起时,通过want传递的参数同步对端界面UI
|
await featureAbility.getWant((error, want) => {
// 远端被拉起后,连接对端的service
if (want.parameters.deviceId) {
let remoteDeviceId = want.parameters.deviceId
connectRemoteService(remoteDeviceId)
}
}
|
AST#method_declaration#Left await AST#ERROR#Left featureAbility . getWant ( AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left error AST#parameter#Right , AST#parameter#Left want AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left => AST#ERROR#Right AST#block_statement#Left { // 远端被拉起后,连接对端的service AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left want AST#expression#Right . parameters AST#member_expression#Right AST#expression#Right . deviceId AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left remoteDeviceId = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left want AST#expression#Right . parameters AST#member_expression#Right AST#expression#Right . deviceId AST#member_expression#Right AST#expression#Right AST#ERROR#Left connectRemoteService AST#ERROR#Right AST#argument_list#Left ( AST#expression#Left remoteDeviceId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
await featureAbility.getWant((error, want) => {
if (want.parameters.deviceId) {
let remoteDeviceId = want.parameters.deviceId
connectRemoteService(remoteDeviceId)
}
}
|
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/HandleGameApplication/HandleEtsOpenHarmony/entry/src/main/ets/MainAbility/pages/index.ets#L91-L97
|
0951a52d80e6b5a0aead91f3ce49574d1eb66d1b
|
gitee
|
bigbear20240612/planner_build-.git
|
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
|
entry/src/main/ets/viewmodel/AcademyManager.ets
|
arkts
|
getMethodProgress
|
获取特定方法的学习进度
|
getMethodProgress(methodId: string): LearningProgress | null {
return this.learningProgress.get(methodId) || null;
}
|
AST#method_declaration#Left getMethodProgress AST#parameter_list#Left ( AST#parameter#Left methodId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left LearningProgress AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . learningProgress AST#member_expression#Right AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left methodId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
getMethodProgress(methodId: string): LearningProgress | null {
return this.learningProgress.get(methodId) || null;
}
|
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/AcademyManager.ets#L259-L261
|
c3b9e51a616f0c404dfbbf738041d2e6a85284de
|
github
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/common/types/SettingsTypes.ets
|
arkts
|
隐私配置接口
|
export interface PrivacyConfig {
dataEncryption: boolean;
biometricLock: boolean;
autoLockTimeout: number; // 分钟
anonymousAnalytics: boolean;
crashReporting: boolean;
locationTracking: boolean;
contactSyncEnabled: boolean;
backupToCloud: boolean;
shareUsageData: boolean;
}
|
AST#export_declaration#Left export AST#interface_declaration#Left interface PrivacyConfig AST#object_type#Left { AST#type_member#Left dataEncryption : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left biometricLock : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left autoLockTimeout : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; // 分钟 AST#type_member#Left anonymousAnalytics : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left crashReporting : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left locationTracking : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left contactSyncEnabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left backupToCloud : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left shareUsageData : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
|
export interface PrivacyConfig {
dataEncryption: boolean;
biometricLock: boolean;
autoLockTimeout: number;
anonymousAnalytics: boolean;
crashReporting: boolean;
locationTracking: boolean;
contactSyncEnabled: boolean;
backupToCloud: boolean;
shareUsageData: boolean;
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L404-L414
|
e8dcd675567b05871fc786b19f5470ebdab773a8
|
github
|
|
Joker-x-dev/CoolMallArkTS.git
|
9f3fabf89fb277692cb82daf734c220c7282919c
|
core/data/src/main/ets/repository/CouponRepository.ets
|
arkts
|
getUserCouponPage
|
分页查询用户优惠券
@param params 分页查询参数
@returns 用户优惠券分页数据
|
async getUserCouponPage(params: PageRequest): Promise<NetworkResponse<NetworkPageData<Coupon>>> {
return this.networkDataSource.getUserCouponPage(params);
}
|
AST#method_declaration#Left async getUserCouponPage AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left PageRequest AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left NetworkResponse AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left NetworkPageData AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left Coupon AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . networkDataSource AST#member_expression#Right AST#expression#Right . getUserCouponPage AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left params AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
async getUserCouponPage(params: PageRequest): Promise<NetworkResponse<NetworkPageData<Coupon>>> {
return this.networkDataSource.getUserCouponPage(params);
}
|
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/CouponRepository.ets#L43-L45
|
34aaa33bbdaa8b8be99b0cc7c6c5b095aa57e174
|
github
|
openharmony/arkui_ace_engine
|
30c7d1ee12fbedf0fabece54291d75897e2ad44f
|
frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/shopping/user/src/ets/arkcompilerPOC/concurrency2.ets
|
arkts
|
Copyright (c) 2024 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 function callRDBWithNativeEACoroutine() {
}
|
AST#export_declaration#Left export AST#function_declaration#Left function callRDBWithNativeEACoroutine AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
|
export function callRDBWithNativeEACoroutine() {
}
|
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/shopping/user/src/ets/arkcompilerPOC/concurrency2.ets#L16-L17
|
6aa18462440f8680e57df1f71f8332bb1830c891
|
gitee
|
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/services/notification/NotificationCenterService.ets
|
arkts
|
getNotificationGroups
|
按类型分组通知
|
public getNotificationGroups(): NotificationGroup[] {
const groups: Map<NotificationType, NotificationItem[]> = new Map();
// 按类型分组
this.notifications.forEach(notification => {
if (!groups.has(notification.type)) {
groups.set(notification.type, []);
}
groups.get(notification.type)!.push(notification);
});
// 转换为分组对象
const result: NotificationGroup[] = [];
groups.forEach((notifications, type) => {
const unreadCount = notifications.filter(n => n.status === NotificationStatus.UNREAD).length;
result.push({
type,
title: this.getTypeTitle(type),
icon: this.getTypeIcon(type),
color: this.getTypeColor(type),
notifications,
unreadCount
});
});
// 按未读数量和优先级排序
return result.sort((a, b) => {
if (a.unreadCount !== b.unreadCount) {
return b.unreadCount - a.unreadCount;
}
return this.getTypePriority(a.type) - this.getTypePriority(b.type);
});
}
|
AST#method_declaration#Left public getNotificationGroups AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left NotificationGroup [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left groups : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Map AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left NotificationType AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left NotificationItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Map AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 按类型分组 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . notifications AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left notification => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left groups AST#expression#Right AST#unary_expression#Right AST#expression#Right . has AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left notification AST#expression#Right . type AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left groups AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left notification AST#expression#Right . type AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left groups AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left notification AST#expression#Right . type AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left notification AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 转换为分组对象 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left result : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left NotificationGroup [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left groups AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left notifications AST#parameter#Right , AST#parameter#Left type AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left unreadCount = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left notifications AST#expression#Right . filter AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left n => AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left n AST#expression#Right . status AST#member_expression#Right AST#expression#Right === AST#expression#Left NotificationStatus AST#expression#Right AST#binary_expression#Right AST#expression#Right . UNREAD AST#member_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left type AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getTypeTitle AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left type AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left icon AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getTypeIcon AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left type AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left color AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getTypeColor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left type AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left notifications AST#property_assignment#Right , AST#property_assignment#Left unreadCount AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 按未读数量和优先级排序 AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . sort AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left a AST#parameter#Right , AST#parameter#Left b AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left a AST#expression#Right . unreadCount AST#member_expression#Right AST#expression#Right !== AST#expression#Left b AST#expression#Right AST#binary_expression#Right AST#expression#Right . unreadCount AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left b AST#expression#Right . unreadCount AST#member_expression#Right AST#expression#Right - AST#expression#Left a AST#expression#Right AST#binary_expression#Right AST#expression#Right . unreadCount AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getTypePriority AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left a AST#expression#Right . type AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right - AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . getTypePriority AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left b AST#expression#Right . type AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
public getNotificationGroups(): NotificationGroup[] {
const groups: Map<NotificationType, NotificationItem[]> = new Map();
this.notifications.forEach(notification => {
if (!groups.has(notification.type)) {
groups.set(notification.type, []);
}
groups.get(notification.type)!.push(notification);
});
const result: NotificationGroup[] = [];
groups.forEach((notifications, type) => {
const unreadCount = notifications.filter(n => n.status === NotificationStatus.UNREAD).length;
result.push({
type,
title: this.getTypeTitle(type),
icon: this.getTypeIcon(type),
color: this.getTypeColor(type),
notifications,
unreadCount
});
});
return result.sort((a, b) => {
if (a.unreadCount !== b.unreadCount) {
return b.unreadCount - a.unreadCount;
}
return this.getTypePriority(a.type) - this.getTypePriority(b.type);
});
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationCenterService.ets#L162-L194
|
6b2a6002b8030557c95965bfeb1a0a3e4271e7cb
|
github
|
jxdiaodeyi/YX_Sports.git
|
af5346bd3d5003c33c306ff77b4b5e9184219893
|
YX_Sports/entry/src/main/ets/pages/EditInfoPage.ets
|
arkts
|
KeyboardDialogBuilder
|
弹窗布局构建器
|
@Builder
KeyboardDialogBuilder() {
Column() {
// 显示输入的文本(可选,用于预览输入内容)
Row() {
Text(this.NickName || '请输入...')
.fontSize(18)
.padding(10)
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(5)
}
.padding(10)
.width('100%')
// 英文键盘组件
EnglishKeyboardView({
// 点击字符按键(如a、b、1、2等)
onItemClick: (item: string) => {
this.NickName += item; // 将输入的字符追加到文本中
},
// 点击删除键
onDelete: () => {
if (this.NickName.length > 0) {
this.NickName = this.NickName.substring(0, this.NickName.length - 1); // 删除最后一个字符
};
},
// 点击完成键
onComplete: () => {
this.keyboardDialog.close(); // 关闭弹窗
},
// 点击中文切换键(如果需要切换到中文键盘,可在此处处理)
onChinese: () => {
// 例如:可以切换到其他中文键盘组件
},
// 点击空格键
onSpace: () => {
this.NickName += ' '; // 追加空格
},
// 点击数字键(切换到数字输入模式,可在此处处理)
onNumber: () => {
// 例如:切换到数字键盘布局
},
// 以下是可选的样式配置(根据需要调整)
bgColor: '#F5F5F5', // 键盘整体背景色
englishBgColor: '#FFFFFF', // 英文字母按键背景色
otherBgColor: '#E8E8E8', // 功能键(删除、完成等)背景色
rectBorderWidth: 1, // 按键边框宽度
rectBorderRadius: 8, // 按键圆角
rectTextSize: 18, // 按键文字大小
rectTextColor: '#333333', // 按键文字颜色
deleteIconWidth: 24, // 删除图标宽度
//deleteIconSrc: $r('app.media.delete_icon'), // 自定义删除图标(可选)
rectHeight: 50, // 按键高度
marginTop: 5, // 键盘顶部边距
marginBottom: 5 // 键盘底部边距
})
.width('100%')
.height(300) // 键盘高度(根据需要调整)
}
.width('100%')
.backgroundColor('#F0F0F0')
}
|
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right KeyboardDialogBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 显示输入的文本(可选,用于预览输入内容) AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . NickName AST#member_expression#Right AST#expression#Right || AST#expression#Left '请输入...' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 18 AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left 10 AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#FFFFFF' AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 5 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . padding ( AST#expression#Left 10 AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 英文键盘组件 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left EnglishKeyboardView ( AST#component_parameters#Left { // 点击字符按键(如a、b、1、2等) AST#component_parameter#Left onItemClick : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . NickName AST#member_expression#Right += AST#expression#Left item AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 将输入的字符追加到文本中 } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , // 点击删除键 AST#component_parameter#Left onDelete : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . NickName AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . NickName AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . NickName AST#member_expression#Right AST#expression#Right . substring AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0 AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . NickName AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 删除最后一个字符 } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#ERROR#Left ; AST#ERROR#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , // 点击完成键 AST#component_parameter#Left onComplete : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . keyboardDialog AST#member_expression#Right AST#expression#Right . close AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 关闭弹窗 } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , // 点击中文切换键(如果需要切换到中文键盘,可在此处处理) AST#component_parameter#Left onChinese : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#expression#Left AST#object_literal#Left { // 例如:可以切换到其他中文键盘组件 } AST#object_literal#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , // 点击空格键 AST#component_parameter#Left onSpace : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . NickName AST#member_expression#Right += AST#expression#Left ' ' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 追加空格 } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , // 点击数字键(切换到数字输入模式,可在此处处理) AST#component_parameter#Left onNumber : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#expression#Left AST#object_literal#Left { // 例如:切换到数字键盘布局 } AST#object_literal#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right , // 以下是可选的样式配置(根据需要调整) AST#component_parameter#Left bgColor : AST#expression#Left '#F5F5F5' AST#expression#Right AST#component_parameter#Right , // 键盘整体背景色 AST#component_parameter#Left englishBgColor : AST#expression#Left '#FFFFFF' AST#expression#Right AST#component_parameter#Right , // 英文字母按键背景色 AST#component_parameter#Left otherBgColor : AST#expression#Left '#E8E8E8' AST#expression#Right AST#component_parameter#Right , // 功能键(删除、完成等)背景色 AST#component_parameter#Left rectBorderWidth : AST#expression#Left 1 AST#expression#Right AST#component_parameter#Right , // 按键边框宽度 AST#component_parameter#Left rectBorderRadius : AST#expression#Left 8 AST#expression#Right AST#component_parameter#Right , // 按键圆角 AST#component_parameter#Left rectTextSize : AST#expression#Left 18 AST#expression#Right AST#component_parameter#Right , // 按键文字大小 AST#component_parameter#Left rectTextColor : AST#expression#Left '#333333' AST#expression#Right AST#component_parameter#Right , // 按键文字颜色 AST#component_parameter#Left deleteIconWidth : AST#expression#Left 24 AST#expression#Right AST#component_parameter#Right , // 删除图标宽度 //deleteIconSrc: $r('app.media.delete_icon'), // 自定义删除图标(可选) AST#component_parameter#Left rectHeight : AST#expression#Left 50 AST#expression#Right AST#component_parameter#Right , // 按键高度 AST#component_parameter#Left marginTop : AST#expression#Left 5 AST#expression#Right AST#component_parameter#Right , // 键盘顶部边距 AST#component_parameter#Left marginBottom : AST#expression#Left 5 AST#expression#Right AST#component_parameter#Right // 键盘底部边距 } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 300 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 键盘高度(根据需要调整) } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#F0F0F0' AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
@Builder
KeyboardDialogBuilder() {
Column() {
Row() {
Text(this.NickName || '请输入...')
.fontSize(18)
.padding(10)
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(5)
}
.padding(10)
.width('100%')
EnglishKeyboardView({
onItemClick: (item: string) => {
this.NickName += item;
},
onDelete: () => {
if (this.NickName.length > 0) {
this.NickName = this.NickName.substring(0, this.NickName.length - 1);
};
},
onComplete: () => {
this.keyboardDialog.close();
},
onChinese: () => {
},
onSpace: () => {
this.NickName += ' ';
},
onNumber: () => {
},
bgColor: '#F5F5F5',
englishBgColor: '#FFFFFF',
otherBgColor: '#E8E8E8',
rectBorderWidth: 1,
rectBorderRadius: 8,
rectTextSize: 18,
rectTextColor: '#333333',
deleteIconWidth: 24,
rectHeight: 50,
marginTop: 5,
marginBottom: 5
})
.width('100%')
.height(300)
}
.width('100%')
.backgroundColor('#F0F0F0')
}
|
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/EditInfoPage.ets#L320-L384
|
cd9ccd6238ea96be10a83d17fd768af52af933af
|
github
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
entry/src/main/ets/pages/greetings/GreetingSendPage.ets
|
arkts
|
getSendMethodLabel
|
获取发送方式标签
|
private getSendMethodLabel(method: NotificationMethod): string {
switch (method) {
case NotificationMethod.PUSH:
return '推送通知';
case NotificationMethod.SMS:
return '短信';
case NotificationMethod.EMAIL:
return '邮件';
default:
return '推送通知';
}
}
|
AST#method_declaration#Left private getSendMethodLabel AST#parameter_list#Left ( AST#parameter#Left method : AST#type_annotation#Left AST#primary_type#Left NotificationMethod AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left switch ( AST#expression#Left method AST#expression#Right ) AST#container_content_body#Left { AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left NotificationMethod AST#expression#Right . PUSH AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '推送通知' AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left NotificationMethod AST#expression#Right . SMS AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '短信' AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left NotificationMethod AST#expression#Right . EMAIL AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '邮件' AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left default AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '推送通知' AST#expression#Right ; AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
private getSendMethodLabel(method: NotificationMethod): string {
switch (method) {
case NotificationMethod.PUSH:
return '推送通知';
case NotificationMethod.SMS:
return '短信';
case NotificationMethod.EMAIL:
return '邮件';
default:
return '推送通知';
}
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/greetings/GreetingSendPage.ets#L847-L858
|
e5050e74e4f26887e1751824f67377562ec1eb8f
|
github
|
bigbear20240612/birthday_reminder.git
|
647c411a6619affd42eb5d163ff18db4b34b27ff
|
harmonyos/src/main/ets/services/storage/PreferencesService.ets
|
arkts
|
has
|
检查键是否存在
@param key 键
@returns 是否存在
|
async has(key: string): Promise<boolean> {
try {
this.checkInitialized();
return await this.dataPreferences!.has(key);
} catch (error) {
const businessError = error as BusinessError;
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to check key existence: ${businessError.message}`);
return false;
}
}
|
AST#method_declaration#Left async has AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . checkInitialized AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . dataPreferences AST#member_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right . has AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left key AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left businessError = AST#expression#Left AST#as_expression#Left AST#expression#Left error AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to check key existence: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left businessError AST#expression#Right . message AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
async has(key: string): Promise<boolean> {
try {
this.checkInitialized();
return await this.dataPreferences!.has(key);
} catch (error) {
const businessError = error as BusinessError;
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to check key existence: ${businessError.message}`);
return false;
}
}
|
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/storage/PreferencesService.ets#L236-L245
|
6ae516e2a385b810dba2ec04a874bec88432e1b4
|
github
|
Joker-x-dev/CoolMallArkTS.git
|
9f3fabf89fb277692cb82daf734c220c7282919c
|
core/datastore/src/main/ets/datasource/account/AccountStoreDataSourceImpl.ets
|
arkts
|
构造函数
@param {common.Context} context UIAbility 上下文
|
constructor(context: common.Context) {
this.prefs = new PreferencesUtil(context, AccountStoreDataSourceImpl.PREFS_NAME);
}
|
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . Context AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . prefs AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left PreferencesUtil AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left context AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AccountStoreDataSourceImpl AST#expression#Right . PREFS_NAME AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right
|
constructor(context: common.Context) {
this.prefs = new PreferencesUtil(context, AccountStoreDataSourceImpl.PREFS_NAME);
}
|
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/datastore/src/main/ets/datasource/account/AccountStoreDataSourceImpl.ets#L32-L34
|
3f1b0557e27dd7e68f9599f3b8153f87973cdda4
|
github
|
|
Piagari/arkts_example.git
|
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
|
hmos_app-main/hmos_app-main/MusicHome-master/common/constantsCommon/src/main/ets/constants/RouterUrlConstants.ets
|
arkts
|
Routing information on the music page.
|
export class RouterUrlConstants {
/**
* Playback page.
*/
static readonly LIVE: string = 'LivePage';
/**
* Music list page.
*/
static readonly MUSIC_LIST: string = 'MusicListPage';
/**
* Music review page.
*/
static readonly MUSIC_COMMENT: string = 'MusicCommentPage';
}
|
AST#export_declaration#Left export AST#class_declaration#Left class RouterUrlConstants AST#class_body#Left { /**
* Playback page.
*/ AST#property_declaration#Left static readonly LIVE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'LivePage' AST#expression#Right ; AST#property_declaration#Right /**
* Music list page.
*/ AST#property_declaration#Left static readonly MUSIC_LIST : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'MusicListPage' AST#expression#Right ; AST#property_declaration#Right /**
* Music review page.
*/ AST#property_declaration#Left static readonly MUSIC_COMMENT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'MusicCommentPage' AST#expression#Right ; AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
|
export class RouterUrlConstants {
static readonly LIVE: string = 'LivePage';
static readonly MUSIC_LIST: string = 'MusicListPage';
static readonly MUSIC_COMMENT: string = 'MusicCommentPage';
}
|
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MusicHome-master/common/constantsCommon/src/main/ets/constants/RouterUrlConstants.ets#L19-L34
|
9ee25d413fd337759ebb5141f390f92a42dbcdce
|
github
|
|
harmonyos-cases/cases
|
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
|
CommonAppDevelopment/feature/networkstatusobserver/src/main/ets/utils/NetUtils.ets
|
arkts
|
getWifiIsConnected
|
查询WLAN是否已连接是判断能否通过Wi-Fi 进行各种网络活动的直接方式。
@returns true,已连接。false,未连接
|
getWifiIsConnected(): boolean {
try {
let ret = wifiManager.isConnected();
logger.info("isConnected:" + ret);
return ret;
} catch (error) {
logger.error("failed:" + JSON.stringify(error));
}
return false;
}
|
AST#method_declaration#Left getWifiIsConnected AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left ret = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left wifiManager AST#expression#Right . isConnected AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left "isConnected:" AST#expression#Right + AST#expression#Left ret AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left ret AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left "failed:" AST#expression#Right + AST#expression#Left JSON AST#expression#Right AST#binary_expression#Right AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
|
getWifiIsConnected(): boolean {
try {
let ret = wifiManager.isConnected();
logger.info("isConnected:" + ret);
return ret;
} catch (error) {
logger.error("failed:" + JSON.stringify(error));
}
return false;
}
|
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/networkstatusobserver/src/main/ets/utils/NetUtils.ets#L236-L245
|
0a1a84baddb1305a4fd23f2a437153d845f94a4d
|
gitee
|
openharmony/xts_acts
|
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
|
arkui/ace_ets_module_ui/ace_ets_module_gauge_contentModifier/ace_ets_module_gauge_contentModifier_api12/entry/src/main/ets/MainAbility/pages/component/GaugeContentModifier.ets
|
arkts
|
buildGaugeContentModifier
|
Copyright (c) 2024 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.
|
@Builder
function buildGaugeContentModifier(config: GaugeConfiguration){
Column() {
Text(`value:${(config.contentModifier as MyGaugeContentModifier).value}`).id('GaugeContentModifier01')
Text(`min:${(config.contentModifier as MyGaugeContentModifier).min}`).id('GaugeContentModifier02')
Text(`max:${(config.contentModifier as MyGaugeContentModifier).max}`).id('GaugeContentModifier03')
Text(`startAngle:${(config.contentModifier as MyGaugeContentModifier).startAngle}`).id('GaugeContentModifier04')
Text(`endAngle:${(config.contentModifier as MyGaugeContentModifier).endAngle}`).id('GaugeContentModifier05')
Text(`colors:${(config.contentModifier as MyGaugeContentModifier).colors}`).id('GaugeContentModifier06')
Text(`strokeWidth:${(config.contentModifier as MyGaugeContentModifier).strokeWidth}`).id('GaugeContentModifier07')
Text(`width:${(config.contentModifier as MyGaugeContentModifier).width}`).id('GaugeContentModifier08')
Text(`height:${(config.contentModifier as MyGaugeContentModifier).height}`).id('GaugeContentModifier09')
Text(`sizeWidth:${(config.contentModifier as MyGaugeContentModifier).sizeWidth}`).id('GaugeContentModifier10')
Text(`sizeHeight:${(config.contentModifier as MyGaugeContentModifier).sizeHeight}`).id('GaugeContentModifier11')
Text(`padding:${(config.contentModifier as MyGaugeContentModifier).padding}`).id('GaugeContentModifier12')
Text(`margin:${(config.contentModifier as MyGaugeContentModifier).margin}`).id('GaugeContentModifier13')
Text(`layoutWeight:${(config.contentModifier as MyGaugeContentModifier).layoutWeight}`).id('GaugeContentModifier14')
Text(`constraintSizeMinWidth:${(config.contentModifier as MyGaugeContentModifier).constraintSizeMinWidth}`).id('GaugeContentModifier15')
Text(`constraintSizeMaxWidth:${(config.contentModifier as MyGaugeContentModifier).constraintSizeMaxWidth}`).id('GaugeContentModifier16')
Text(`constraintSizeMinHeight:${(config.contentModifier as MyGaugeContentModifier).constraintSizeMinHeight}`).id('GaugeContentModifier17')
Text(`constraintSizeMaxHeight:${(config.contentModifier as MyGaugeContentModifier).constraintSizeMaxHeight}`).id('GaugeContentModifier18')
}.width('100%').margin({top:0})
}
|
AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function buildGaugeContentModifier AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left GaugeConfiguration AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` value: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . value AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier01' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` min: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . min AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier02' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` max: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . max AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier03' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` startAngle: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . startAngle AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier04' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` endAngle: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . endAngle AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier05' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` colors: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . colors AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier06' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` strokeWidth: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . strokeWidth AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier07' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` width: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier08' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` height: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier09' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` sizeWidth: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . sizeWidth AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier10' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` sizeHeight: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . sizeHeight AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier11' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` padding: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . padding AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier12' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` margin: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . margin AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier13' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` layoutWeight: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . layoutWeight AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier14' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` constraintSizeMinWidth: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . constraintSizeMinWidth AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier15' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` constraintSizeMaxWidth: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . constraintSizeMaxWidth AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier16' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` constraintSizeMinHeight: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . constraintSizeMinHeight AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier17' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` constraintSizeMaxHeight: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left config AST#expression#Right . contentModifier AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left MyGaugeContentModifier AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . constraintSizeMaxHeight AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'GaugeContentModifier18' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#decorated_function_declaration#Right
|
@Builder
function buildGaugeContentModifier(config: GaugeConfiguration){
Column() {
Text(`value:${(config.contentModifier as MyGaugeContentModifier).value}`).id('GaugeContentModifier01')
Text(`min:${(config.contentModifier as MyGaugeContentModifier).min}`).id('GaugeContentModifier02')
Text(`max:${(config.contentModifier as MyGaugeContentModifier).max}`).id('GaugeContentModifier03')
Text(`startAngle:${(config.contentModifier as MyGaugeContentModifier).startAngle}`).id('GaugeContentModifier04')
Text(`endAngle:${(config.contentModifier as MyGaugeContentModifier).endAngle}`).id('GaugeContentModifier05')
Text(`colors:${(config.contentModifier as MyGaugeContentModifier).colors}`).id('GaugeContentModifier06')
Text(`strokeWidth:${(config.contentModifier as MyGaugeContentModifier).strokeWidth}`).id('GaugeContentModifier07')
Text(`width:${(config.contentModifier as MyGaugeContentModifier).width}`).id('GaugeContentModifier08')
Text(`height:${(config.contentModifier as MyGaugeContentModifier).height}`).id('GaugeContentModifier09')
Text(`sizeWidth:${(config.contentModifier as MyGaugeContentModifier).sizeWidth}`).id('GaugeContentModifier10')
Text(`sizeHeight:${(config.contentModifier as MyGaugeContentModifier).sizeHeight}`).id('GaugeContentModifier11')
Text(`padding:${(config.contentModifier as MyGaugeContentModifier).padding}`).id('GaugeContentModifier12')
Text(`margin:${(config.contentModifier as MyGaugeContentModifier).margin}`).id('GaugeContentModifier13')
Text(`layoutWeight:${(config.contentModifier as MyGaugeContentModifier).layoutWeight}`).id('GaugeContentModifier14')
Text(`constraintSizeMinWidth:${(config.contentModifier as MyGaugeContentModifier).constraintSizeMinWidth}`).id('GaugeContentModifier15')
Text(`constraintSizeMaxWidth:${(config.contentModifier as MyGaugeContentModifier).constraintSizeMaxWidth}`).id('GaugeContentModifier16')
Text(`constraintSizeMinHeight:${(config.contentModifier as MyGaugeContentModifier).constraintSizeMinHeight}`).id('GaugeContentModifier17')
Text(`constraintSizeMaxHeight:${(config.contentModifier as MyGaugeContentModifier).constraintSizeMaxHeight}`).id('GaugeContentModifier18')
}.width('100%').margin({top:0})
}
|
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_gauge_contentModifier/ace_ets_module_gauge_contentModifier_api12/entry/src/main/ets/MainAbility/pages/component/GaugeContentModifier.ets#L16-L38
|
6f4e657250bb11d34ca77251283121c8579b27b7
|
gitee
|
openharmony/applications_app_samples
|
a826ab0e75fe51d028c1c5af58188e908736b53b
|
code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/socket/TlsSocket.ets
|
arkts
|
setOnCloseListener
|
TLS 关闭事件订阅
@param callback
|
setOnCloseListener(callback: () => void): void {
Logger.info(`${TAG} TLS setOnCloseListener into`);
this.tlsSocket?.on('close', () => {
Logger.info(`${TAG} TLS setOnCloseListener onClose:`);
callback();
this.closeSocket();
});
this.tlsSocket?.on('error', (data) => {
Logger.info(
`${TAG} TLS setOnCloseListener onClose:` + JSON.stringify(data)
);
callback();
this.closeSocket();
});
}
|
AST#method_declaration#Left setOnCloseListener AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left TAG AST#expression#Right } AST#template_substitution#Right TLS setOnCloseListener into ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tlsSocket AST#member_expression#Right AST#expression#Right ?. on AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'close' AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left TAG AST#expression#Right } AST#template_substitution#Right TLS setOnCloseListener onClose: ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left callback AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . closeSocket AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tlsSocket AST#member_expression#Right AST#expression#Right ?. on AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'error' AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left data AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left TAG AST#expression#Right } AST#template_substitution#Right TLS setOnCloseListener onClose: ` AST#template_literal#Right AST#expression#Right + AST#expression#Left JSON AST#expression#Right AST#binary_expression#Right AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left data AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left callback AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . closeSocket AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
setOnCloseListener(callback: () => void): void {
Logger.info(`${TAG} TLS setOnCloseListener into`);
this.tlsSocket?.on('close', () => {
Logger.info(`${TAG} TLS setOnCloseListener onClose:`);
callback();
this.closeSocket();
});
this.tlsSocket?.on('error', (data) => {
Logger.info(
`${TAG} TLS setOnCloseListener onClose:` + JSON.stringify(data)
);
callback();
this.closeSocket();
});
}
|
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/socket/TlsSocket.ets#L234-L249
|
79fddd7d609fa831bd3525d707acbe2e58628c5b
|
gitee
|
vhall/VHLive_SDK_Harmony
|
29c820e5301e17ae01bc6bdcc393a4437b518e7c
|
watchKit/src/main/ets/components/goods/VHGoodsComponent.ets
|
arkts
|
VHCouponsDialog
|
优惠卷弹窗
|
@CustomDialog
export struct VHCouponsDialog {
controller: CustomDialogController
@State barList: string[] = ['可用优惠券', '不可用优惠券']
@Consume CouponsAvailable: VHCouponInfo[]
@Consume CouponsNotAvailable: VHNotAvailableCouponInfo[]
@Link Index: number
@Consume CouponsWebinarId: number
@State private illustrateStates: boolean[] = [];
@State private selectedIndex: number = -1;
@Require webinars: VHWebinarData;
@Prop isCoupons: boolean = true
aboutToAppear(): void {
this.getCouponsAvailableHttp()
this.getCouponsNotAvailableHttp()
if (this.CouponsAvailable.length > 0) {
this.illustrateStates = new Array(this.CouponsAvailable.length).fill(false);
}
|
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct VHCouponsDialog AST#component_body#Left { AST#property_declaration#Left controller : AST#type_annotation#Left AST#primary_type#Left CustomDialogController AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right barList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left '可用优惠券' AST#expression#Right , AST#expression#Left '不可用优惠券' AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Consume AST#decorator#Right CouponsAvailable : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left VHCouponInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Consume AST#decorator#Right CouponsNotAvailable : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left VHNotAvailableCouponInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right Index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Consume AST#decorator#Right CouponsWebinarId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right private illustrateStates : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left boolean [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right private selectedIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#unary_expression#Left - AST#expression#Left 1 AST#expression#Right AST#unary_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right webinars : AST#type_annotation#Left AST#primary_type#Left VHWebinarData AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right isCoupons : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#ERROR#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#ERROR#Left aboutToAppear AST#ERROR#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left void AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left this AST#property_assignment#Right AST#object_literal#Right AST#expression#Right AST#unary_expression#Right AST#expression#Right . getCouponsAvailableHttp AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#ERROR#Left this AST#ERROR#Right . getCouponsNotAvailableHttp AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#ERROR#Left if AST#ERROR#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . CouponsAvailable AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#ERROR#Right AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left this AST#property_assignment#Right AST#object_literal#Right AST#expression#Right . illustrateStates AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Array AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . CouponsAvailable AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . fill AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#property_declaration#Right } AST#component_body#Right AST#decorated_export_declaration#Right
|
@CustomDialog
export struct VHCouponsDialog {
controller: CustomDialogController
@State barList: string[] = ['可用优惠券', '不可用优惠券']
@Consume CouponsAvailable: VHCouponInfo[]
@Consume CouponsNotAvailable: VHNotAvailableCouponInfo[]
@Link Index: number
@Consume CouponsWebinarId: number
@State private illustrateStates: boolean[] = [];
@State private selectedIndex: number = -1;
@Require webinars: VHWebinarData;
@Prop isCoupons: boolean = true
aboutToAppear(): void {
this.getCouponsAvailableHttp()
this.getCouponsNotAvailableHttp()
if (this.CouponsAvailable.length > 0) {
this.illustrateStates = new Array(this.CouponsAvailable.length).fill(false);
}
|
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/goods/VHGoodsComponent.ets#L518-L536
|
58a8842afb3844a24e4c418984f48b83a98c52f7
|
gitee
|
openharmony/applications_app_samples
|
a826ab0e75fe51d028c1c5af58188e908736b53b
|
code/Solutions/IM/Chat/features/chatlist/src/main/ets/pages/ChatListPage.ets
|
arkts
|
OptChatViewBuilder
|
布局优化的列表item加载数据
|
@Builder
OptChatViewBuilder(msg: ChatModel) {
// reusable component
if (this.reusable) {
ReusableOptLayoutChatView(new Message(msg))
.reuseId(REUSE_ID)
} else {
OptLayoutChatView(new Message(msg))
}
}
|
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right OptChatViewBuilder AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left ChatModel AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { // reusable component AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . reusable AST#member_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ReusableOptLayoutChatView ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Message AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left msg AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . reuseId ( AST#expression#Left REUSE_ID AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } else { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left OptLayoutChatView ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Message AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left msg AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right
|
@Builder
OptChatViewBuilder(msg: ChatModel) {
if (this.reusable) {
ReusableOptLayoutChatView(new Message(msg))
.reuseId(REUSE_ID)
} else {
OptLayoutChatView(new Message(msg))
}
}
|
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/IM/Chat/features/chatlist/src/main/ets/pages/ChatListPage.ets#L73-L82
|
209c3d55bc64a8a5521622084d64951ecc4773ff
|
gitee
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.