idlize

Форк
0
842 строки · 14.7 Кб
1
/*
2
 * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
3
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 * you may not use this file except in compliance with the License.
5
 * You may obtain a copy of the License at
6
 *
7
 * http://www.apache.org/licenses/LICENSE-2.0
8
 *
9
 * Unless required by applicable law or agreed to in writing, software
10
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 * See the License for the specific language governing permissions and
13
 * limitations under the License.
14
 */
15

16
// @State
17

18
@Component
19
struct StateToState {
20
  @State state: string = 'Hello World'
21
  @State test: string = this.state + "!"
22

23
  build() {
24
    Text(this.test)
25
  }
26
}
27

28
@Component
29
struct StateToProp {
30
  @State state: string = 'Hello World'
31
  @Prop test: string = this.state + "!"
32

33
  build() {
34
    Text(this.test)
35
  }
36
}
37

38
@Component
39
struct StateToProvide {
40
  @State state: string = 'Hello World'
41
  @Provide test: string = this.state + "!"
42

43
  build() {
44
    Text(this.test)
45
  }
46
}
47

48
@Component
49
struct StateToStorageLink {
50
  @State state: string = 'Hello World'
51
  @StorageLink("test") test: string = this.state + "!"
52

53
  build() {
54
    Text(this.test)
55
  }
56
}
57

58
@Component
59
struct StateToLocalStorageLink {
60
  @State state: string = 'Hello World'
61
  @LocalStorageLink("test") test: string = this.state + "!"
62

63
  build() {
64
    Text(this.test)
65
  }
66
}
67

68
@Component
69
struct StateToStorageProp {
70
  @State state: string = 'Hello World'
71
  @StorageProp("test") test: string = this.state + "!"
72

73
  build() {
74
    Text(this.test)
75
  }
76
}
77

78
@Component
79
struct StateToLocalStorageProp {
80
  @State state: string = 'Hello World'
81
  @LocalStorageProp("test") test: string = this.state + "!"
82

83
  build() {
84
    Text(this.test)
85
  }
86
}
87

88
@Component
89
struct StateToBuilderParam {
90
  @State state: string = 'Hello World'
91
  @BuilderParam test: string = this.state + "!"
92

93
  build() {
94
    Text(this.test)
95
  }
96
}
97

98
@Component
99
struct StateToPlain {
100
  @State state: string = 'Hello World'
101
  test: string = this.state + "!"
102

103
  build() {
104
    Text(this.test)
105
  }
106
}
107

108
// @Prop
109

110
@Component
111
struct PropToState {
112
  @Prop state: string = 'Hello World'
113
  @State test: string = this.state + "!"
114

115
  build() {
116
    Text(this.test)
117
  }
118
}
119

120
@Component
121
struct PropToProp {
122
  @Prop state: string = 'Hello World'
123
  @Prop test: string = this.state + "!"
124

125
  build() {
126
    Text(this.test)
127
  }
128
}
129

130
@Component
131
struct PropToProvide {
132
  @Prop state: string = 'Hello World'
133
  @Provide test: string = this.state + "!"
134

135
  build() {
136
    Text(this.test)
137
  }
138
}
139

140
@Component
141
struct PropToStorageLink {
142
  @Prop state: string = 'Hello World'
143
  @StorageLink("test") test: string = this.state + "!"
144

145
  build() {
146
    Text(this.test)
147
  }
148
}
149

150
@Component
151
struct PropToLocalStorageLink {
152
  @Prop state: string = 'Hello World'
153
  @LocalStorageLink("test") test: string = this.state + "!"
154

155
  build() {
156
    Text(this.test)
157
  }
158
}
159

160
@Component
161
struct PropToStorageProp {
162
  @Prop state: string = 'Hello World'
163
  @StorageProp("test") test: string = this.state + "!"
164

165
  build() {
166
    Text(this.test)
167
  }
168
}
169

170
@Component
171
struct PropToLocalStorageProp {
172
  @Prop state: string = 'Hello World'
173
  @LocalStorageProp("test") test: string = this.state + "!"
174

175
  build() {
176
    Text(this.test)
177
  }
178
}
179

180
@Component
181
struct PropToBuilderParam {
182
  @Prop state: string = 'Hello World'
183
  @BuilderParam test: string = this.state + "!"
184

185
  build() {
186
    Text(this.test)
187
  }
188
}
189

190
@Component
191
struct PropToPlain {
192
  @Prop state: string = 'Hello World'
193
  test: string = this.state + "!"
194

195
  build() {
196
    Text(this.test)
197
  }
198
}
199

200
// @Provide
201

202
@Component
203
struct ProvideToState {
204
  @Provide state: string = 'Hello World'
205
  @State test: string = this.state + "!"
206

207
  build() {
208
    Text(this.test)
209
  }
210
}
211

212
@Component
213
struct ProvideToProp {
214
  @Provide state: string = 'Hello World'
215
  @Prop test: string = this.state + "!"
216

217
  build() {
218
    Text(this.test)
219
  }
220
}
221

222
@Component
223
struct ProvideToProvide {
224
  @Provide state: string = 'Hello World'
225
  @Provide test: string = this.state + "!"
226

227
  build() {
228
    Text(this.test)
229
  }
230
}
231

232
@Component
233
struct ProvideToStorageLink {
234
  @Provide state: string = 'Hello World'
235
  @StorageLink("test") test: string = this.state + "!"
236

237
  build() {
238
    Text(this.test)
239
  }
240
}
241

242
@Component
243
struct ProvideToLocalStorageLink {
244
  @Provide state: string = 'Hello World'
245
  @LocalStorageLink("test") test: string = this.state + "!"
246

247
  build() {
248
    Text(this.test)
249
  }
250
}
251

252
@Component
253
struct ProvideToStorageProp {
254
  @Provide state: string = 'Hello World'
255
  @StorageProp("test") test: string = this.state + "!"
256

257
  build() {
258
    Text(this.test)
259
  }
260
}
261

262
@Component
263
struct ProvideToLocalStorageProp {
264
  @Provide state: string = 'Hello World'
265
  @LocalStorageProp("test") test: string = this.state + "!"
266

267
  build() {
268
    Text(this.test)
269
  }
270
}
271

272
@Component
273
struct ProvideToBuilderParam {
274
  @Provide state: string = 'Hello World'
275
  @BuilderParam test: string = this.state + "!"
276

277
  build() {
278
    Text(this.test)
279
  }
280
}
281

282
@Component
283
struct ProvideToPlain {
284
  @Provide state: string = 'Hello World'
285
  test: string = this.state + "!"
286

287
  build() {
288
    Text(this.test)
289
  }
290
}
291

292
// @StorageLink
293

294
@Component
295
struct StorageLinkToState {
296
  @StorageLink("key") state: string = 'Hello World'
297
  @State test: string = this.state + "!"
298

299
  build() {
300
    Text(this.test)
301
  }
302
}
303

304
@Component
305
struct StorageLinkToProp {
306
  @StorageLink("key") state: string = 'Hello World'
307
  @Prop test: string = this.state + "!"
308

309
  build() {
310
    Text(this.test)
311
  }
312
}
313

314
@Component
315
struct StorageLinkToProvide {
316
  @StorageLink("key") state: string = 'Hello World'
317
  @Provide test: string = this.state + "!"
318

319
  build() {
320
    Text(this.test)
321
  }
322
}
323

324
@Component
325
struct StorageLinkToStorageLink {
326
  @StorageLink("key") state: string = 'Hello World'
327
  @StorageLink("test") test: string = this.state + "!"
328

329
  build() {
330
    Text(this.test)
331
  }
332
}
333

334
@Component
335
struct StorageLinkToLocalStorageLink {
336
  @StorageLink("key") state: string = 'Hello World'
337
  @LocalStorageLink("test") test: string = this.state + "!"
338

339
  build() {
340
    Text(this.test)
341
  }
342
}
343

344
@Component
345
struct StorageLinkToStorageProp {
346
  @StorageLink("key") state: string = 'Hello World'
347
  @StorageProp("test") test: string = this.state + "!"
348

349
  build() {
350
    Text(this.test)
351
  }
352
}
353

354
@Component
355
struct StorageLinkToLocalStorageProp {
356
  @StorageLink("key") state: string = 'Hello World'
357
  @LocalStorageProp("test") test: string = this.state + "!"
358

359
  build() {
360
    Text(this.test)
361
  }
362
}
363

364
@Component
365
struct StorageLinkToBuilderParam {
366
  @StorageLink("key") state: string = 'Hello World'
367
  @BuilderParam test: string = this.state + "!"
368

369
  build() {
370
    Text(this.test)
371
  }
372
}
373

374
@Component
375
struct StorageLinkToPlain {
376
  @StorageLink("key") state: string = 'Hello World'
377
  test: string = this.state + "!"
378

379
  build() {
380
    Text(this.test)
381
  }
382
}
383

384
// @LocalStorageLink
385

386
@Component
387
struct LocalStorageLinkToState {
388
  @LocalStorageLink("key") state: string = 'Hello World'
389
  @State test: string = this.state + "!"
390

391
  build() {
392
    Text(this.test)
393
  }
394
}
395

396
@Component
397
struct LocalStorageLinkToProp {
398
  @LocalStorageLink("key") state: string = 'Hello World'
399
  @Prop test: string = this.state + "!"
400

401
  build() {
402
    Text(this.test)
403
  }
404
}
405

406
@Component
407
struct LocalStorageLinkToProvide {
408
  @LocalStorageLink("key") state: string = 'Hello World'
409
  @Provide test: string = this.state + "!"
410

411
  build() {
412
    Text(this.test)
413
  }
414
}
415

416
@Component
417
struct LocalStorageLinkToStorageLink {
418
  @LocalStorageLink("key") state: string = 'Hello World'
419
  @StorageLink("test") test: string = this.state + "!"
420

421
  build() {
422
    Text(this.test)
423
  }
424
}
425

426
@Component
427
struct LocalStorageLinkToLocalStorageLink {
428
  @LocalStorageLink("key") state: string = 'Hello World'
429
  @LocalStorageLink("test") test: string = this.state + "!"
430

431
  build() {
432
    Text(this.test)
433
  }
434
}
435

436
@Component
437
struct LocalStorageLinkToStorageProp {
438
  @LocalStorageLink("key") state: string = 'Hello World'
439
  @StorageProp("test") test: string = this.state + "!"
440

441
  build() {
442
    Text(this.test)
443
  }
444
}
445

446
@Component
447
struct LocalStorageLinkToLocalStorageProp {
448
  @LocalStorageLink("key") state: string = 'Hello World'
449
  @LocalStorageProp("test") test: string = this.state + "!"
450

451
  build() {
452
    Text(this.test)
453
  }
454
}
455

456
@Component
457
struct LocalStorageLinkToBuilderParam {
458
  @LocalStorageLink("key") state: string = 'Hello World'
459
  @BuilderParam test: string = this.state + "!"
460

461
  build() {
462
    Text(this.test)
463
  }
464
}
465

466
@Component
467
struct LocalStorageLinkToPlain {
468
  @LocalStorageLink("key") state: string = 'Hello World'
469
  test: string = this.state + "!"
470

471
  build() {
472
    Text(this.test)
473
  }
474
}
475

476
// @StorageProp
477

478
@Component
479
struct StoragePropToState {
480
  @StorageProp("key") state: string = 'Hello World'
481
  @State test: string = this.state + "!"
482

483
  build() {
484
    Text(this.test)
485
  }
486
}
487

488
@Component
489
struct StoragePropToProp {
490
  @StorageProp("key") state: string = 'Hello World'
491
  @Prop test: string = this.state + "!"
492

493
  build() {
494
    Text(this.test)
495
  }
496
}
497

498
@Component
499
struct StoragePropToProvide {
500
  @StorageProp("key") state: string = 'Hello World'
501
  @Provide test: string = this.state + "!"
502

503
  build() {
504
    Text(this.test)
505
  }
506
}
507

508
@Component
509
struct StoragePropToStorageLink {
510
  @StorageProp("key") state: string = 'Hello World'
511
  @StorageLink("test") test: string = this.state + "!"
512

513
  build() {
514
    Text(this.test)
515
  }
516
}
517

518
@Component
519
struct StoragePropToLocalStorageLink {
520
  @StorageProp("key") state: string = 'Hello World'
521
  @LocalStorageLink("test") test: string = this.state + "!"
522

523
  build() {
524
    Text(this.test)
525
  }
526
}
527

528
@Component
529
struct StoragePropToStorageProp {
530
  @StorageProp("key") state: string = 'Hello World'
531
  @StorageProp("test") test: string = this.state + "!"
532

533
  build() {
534
    Text(this.test)
535
  }
536
}
537

538
@Component
539
struct StoragePropToLocalStorageProp {
540
  @StorageProp("key") state: string = 'Hello World'
541
  @LocalStorageProp("test") test: string = this.state + "!"
542

543
  build() {
544
    Text(this.test)
545
  }
546
}
547

548
@Component
549
struct StoragePropToBuilderParam {
550
  @StorageProp("key") state: string = 'Hello World'
551
  @BuilderParam test: string = this.state + "!"
552

553
  build() {
554
    Text(this.test)
555
  }
556
}
557

558
@Component
559
struct StoragePropToPlain {
560
  @StorageProp("key") state: string = 'Hello World'
561
  test: string = this.state + "!"
562

563
  build() {
564
    Text(this.test)
565
  }
566
}
567

568
// @LocalStorageProp
569

570
@Component
571
struct LocalStoragePropToState {
572
  @LocalStorageProp("key") state: string = 'Hello World'
573
  @State test: string = this.state + "!"
574

575
  build() {
576
    Text(this.test)
577
  }
578
}
579

580
@Component
581
struct LocalStoragePropToProp {
582
  @LocalStorageProp("key") state: string = 'Hello World'
583
  @Prop test: string = this.state + "!"
584

585
  build() {
586
    Text(this.test)
587
  }
588
}
589

590
@Component
591
struct LocalStoragePropToProvide {
592
  @LocalStorageProp("key") state: string = 'Hello World'
593
  @Provide test: string = this.state + "!"
594

595
  build() {
596
    Text(this.test)
597
  }
598
}
599

600
@Component
601
struct LocalStoragePropToStorageLink {
602
  @LocalStorageProp("key") state: string = 'Hello World'
603
  @StorageLink("test") test: string = this.state + "!"
604

605
  build() {
606
    Text(this.test)
607
  }
608
}
609

610
@Component
611
struct LocalStoragePropToLocalStorageLink {
612
  @LocalStorageProp("key") state: string = 'Hello World'
613
  @LocalStorageLink("test") test: string = this.state + "!"
614

615
  build() {
616
    Text(this.test)
617
  }
618
}
619

620
@Component
621
struct LocalStoragePropToStorageProp {
622
  @LocalStorageProp("key") state: string = 'Hello World'
623
  @StorageProp("test") test: string = this.state + "!"
624

625
  build() {
626
    Text(this.test)
627
  }
628
}
629

630
@Component
631
struct LocalStoragePropToLocalStorageProp {
632
  @LocalStorageProp("key") state: string = 'Hello World'
633
  @LocalStorageProp("test") test: string = this.state + "!"
634

635
  build() {
636
    Text(this.test)
637
  }
638
}
639

640
@Component
641
struct LocalStoragePropToBuilderParam {
642
  @LocalStorageProp("key") state: string = 'Hello World'
643
  @BuilderParam test: string = this.state + "!"
644

645
  build() {
646
    Text(this.test)
647
  }
648
}
649

650
@Component
651
struct LocalStoragePropToPlain {
652
  @LocalStorageProp("key") state: string = 'Hello World'
653
  test: string = this.state + "!"
654

655
  build() {
656
    Text(this.test)
657
  }
658
}
659

660
// @BuilderParam
661

662
@Component
663
struct BuilderParamToState {
664
  @BuilderParam state: string = 'Hello World'
665
  @State test: string = this.state + "!"
666

667
  build() {
668
    Text(this.test)
669
  }
670
}
671

672
@Component
673
struct BuilderParamToProp {
674
  @BuilderParam state: string = 'Hello World'
675
  @Prop test: string = this.state + "!"
676

677
  build() {
678
    Text(this.test)
679
  }
680
}
681

682
@Component
683
struct BuilderParamToProvide {
684
  @BuilderParam state: string = 'Hello World'
685
  @Provide test: string = this.state + "!"
686

687
  build() {
688
    Text(this.test)
689
  }
690
}
691

692
@Component
693
struct BuilderParamToStorageLink {
694
  @BuilderParam state: string = 'Hello World'
695
  @StorageLink("test") test: string = this.state + "!"
696

697
  build() {
698
    Text(this.test)
699
  }
700
}
701

702
@Component
703
struct BuilderParamToLocalStorageLink {
704
  @BuilderParam state: string = 'Hello World'
705
  @LocalStorageLink("test") test: string = this.state + "!"
706

707
  build() {
708
    Text(this.test)
709
  }
710
}
711

712
@Component
713
struct BuilderParamToStorageProp {
714
  @BuilderParam state: string = 'Hello World'
715
  @StorageProp("test") test: string = this.state + "!"
716

717
  build() {
718
    Text(this.test)
719
  }
720
}
721

722
@Component
723
struct BuilderParamToLocalStorageProp {
724
  @BuilderParam state: string = 'Hello World'
725
  @LocalStorageProp("test") test: string = this.state + "!"
726

727
  build() {
728
    Text(this.test)
729
  }
730
}
731

732
@Component
733
struct BuilderParamToBuilderParam {
734
  @BuilderParam state: string = 'Hello World'
735
  @BuilderParam test: string = this.state + "!"
736

737
  build() {
738
    Text(this.test)
739
  }
740
}
741

742
@Component
743
struct BuilderParamToPlain {
744
  @BuilderParam state: string = 'Hello World'
745
  test: string = this.state + "!"
746

747
  build() {
748
    Text(this.test)
749
  }
750
}
751

752
// plain property
753

754
@Component
755
struct PlainToState {
756
  state: string = 'Hello World'
757
  @State test: string = this.state + "!"
758

759
  build() {
760
    Text(this.test)
761
  }
762
}
763

764
@Component
765
struct PlainToProp {
766
  state: string = 'Hello World'
767
  @Prop test: string = this.state + "!"
768

769
  build() {
770
    Text(this.test)
771
  }
772
}
773

774
@Component
775
struct PlainToProvide {
776
  state: string = 'Hello World'
777
  @Provide test: string = this.state + "!"
778

779
  build() {
780
    Text(this.test)
781
  }
782
}
783

784
@Component
785
struct PlainToStorageLink {
786
  state: string = 'Hello World'
787
  @StorageLink("test") test: string = this.state + "!"
788

789
  build() {
790
    Text(this.test)
791
  }
792
}
793

794
@Component
795
struct PlainToLocalStorageLink {
796
  state: string = 'Hello World'
797
  @LocalStorageLink("test") test: string = this.state + "!"
798

799
  build() {
800
    Text(this.test)
801
  }
802
}
803

804
@Component
805
struct PlainToStorageProp {
806
  state: string = 'Hello World'
807
  @StorageProp("test") test: string = this.state + "!"
808

809
  build() {
810
    Text(this.test)
811
  }
812
}
813

814
@Component
815
struct PlainToLocalStorageProp {
816
  state: string = 'Hello World'
817
  @LocalStorageProp("test") test: string = this.state + "!"
818

819
  build() {
820
    Text(this.test)
821
  }
822
}
823

824
@Component
825
struct PlainToBuilderParam {
826
  state: string = 'Hello World'
827
  @BuilderParam test: string = this.state + "!"
828

829
  build() {
830
    Text(this.test)
831
  }
832
}
833

834
@Component
835
struct PlainToPlain {
836
  state: string = 'Hello World'
837
  test: string = this.state + "!"
838

839
  build() {
840
    Text(this.test)
841
  }
842
}
843

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

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

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

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