@alloy-js/java 0.20.0-dev.0 → 0.20.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/src/components/Class.d.ts.map +1 -1
  2. package/dist/src/components/Class.js +3 -3
  3. package/dist/src/components/Declaration.d.ts.map +1 -1
  4. package/dist/src/components/Declaration.js +6 -1
  5. package/dist/src/components/Enum.d.ts.map +1 -1
  6. package/dist/src/components/Enum.js +3 -3
  7. package/dist/src/components/Interface.d.ts.map +1 -1
  8. package/dist/src/components/Interface.js +3 -3
  9. package/dist/src/components/LexicalScope.d.ts +8 -0
  10. package/dist/src/components/LexicalScope.d.ts.map +1 -0
  11. package/dist/src/components/LexicalScope.js +23 -0
  12. package/dist/src/components/PackageDirectory.d.ts.map +1 -1
  13. package/dist/src/components/PackageDirectory.js +3 -2
  14. package/dist/src/components/SourceFile.d.ts.map +1 -1
  15. package/dist/src/components/SourceFile.js +3 -3
  16. package/dist/src/create-library.d.ts.map +1 -1
  17. package/dist/src/create-library.js +3 -5
  18. package/dist/src/index.d.ts +1 -0
  19. package/dist/src/index.d.ts.map +1 -1
  20. package/dist/src/index.js +2 -1
  21. package/dist/src/symbols/index.d.ts +1 -0
  22. package/dist/src/symbols/index.d.ts.map +1 -1
  23. package/dist/src/symbols/index.js +1 -0
  24. package/dist/src/symbols/java-lexical-scope.d.ts +6 -0
  25. package/dist/src/symbols/java-lexical-scope.d.ts.map +1 -0
  26. package/dist/src/symbols/java-lexical-scope.js +7 -0
  27. package/dist/src/symbols/java-output-symbol.d.ts +4 -2
  28. package/dist/src/symbols/java-output-symbol.d.ts.map +1 -1
  29. package/dist/src/symbols/java-output-symbol.js +13 -2
  30. package/dist/src/symbols/java-package-scope.d.ts +2 -0
  31. package/dist/src/symbols/java-package-scope.d.ts.map +1 -1
  32. package/dist/src/symbols/java-package-scope.js +4 -0
  33. package/dist/src/symbols/java-project-scope.js +1 -1
  34. package/dist/src/symbols/reference.js +2 -2
  35. package/dist/src/utils.d.ts +3 -0
  36. package/dist/src/utils.d.ts.map +1 -0
  37. package/dist/src/utils.js +12 -0
  38. package/dist/test/constructor.test.js +4 -4
  39. package/dist/test/method.test.js +3 -3
  40. package/dist/test/variables.test.js +3 -3
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +3 -3
  43. package/src/components/Class.tsx +4 -3
  44. package/src/components/Declaration.tsx +7 -1
  45. package/src/components/Enum.tsx +4 -3
  46. package/src/components/Interface.tsx +4 -3
  47. package/src/components/LexicalScope.tsx +31 -0
  48. package/src/components/PackageDirectory.tsx +3 -1
  49. package/src/components/SourceFile.tsx +2 -4
  50. package/src/create-library.ts +2 -4
  51. package/src/index.ts +1 -0
  52. package/src/symbols/index.ts +1 -0
  53. package/src/symbols/java-lexical-scope.ts +9 -0
  54. package/src/symbols/java-output-symbol.ts +24 -3
  55. package/src/symbols/java-package-scope.ts +6 -0
  56. package/src/symbols/java-project-scope.ts +1 -1
  57. package/src/symbols/reference.ts +2 -2
  58. package/src/utils.ts +17 -0
  59. package/temp/api.json +290 -3
  60. package/test/constructor.test.tsx +7 -7
  61. package/test/method.test.tsx +5 -5
  62. package/test/variables.test.tsx +5 -5
  63. package/tsdoc-metadata.json +1 -1
package/temp/api.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.52.8",
4
+ "toolVersion": "7.52.9",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -2350,6 +2350,103 @@
2350
2350
  "endIndex": 2
2351
2351
  }
2352
2352
  },
2353
+ {
2354
+ "kind": "Class",
2355
+ "canonicalReference": "@alloy-js/java!JavaLexicalScope:class",
2356
+ "docComment": "",
2357
+ "excerptTokens": [
2358
+ {
2359
+ "kind": "Content",
2360
+ "text": "export declare class JavaLexicalScope extends "
2361
+ },
2362
+ {
2363
+ "kind": "Reference",
2364
+ "text": "OutputScope",
2365
+ "canonicalReference": "@alloy-js/core!OutputScope:class"
2366
+ },
2367
+ {
2368
+ "kind": "Content",
2369
+ "text": " "
2370
+ }
2371
+ ],
2372
+ "fileUrlPath": "src/symbols/java-lexical-scope.ts",
2373
+ "releaseTag": "Public",
2374
+ "isAbstract": false,
2375
+ "name": "JavaLexicalScope",
2376
+ "preserveMemberOrder": false,
2377
+ "members": [
2378
+ {
2379
+ "kind": "Property",
2380
+ "canonicalReference": "@alloy-js/java!JavaLexicalScope.declarationSpaces:member",
2381
+ "docComment": "",
2382
+ "excerptTokens": [
2383
+ {
2384
+ "kind": "Content",
2385
+ "text": "static readonly declarationSpaces: "
2386
+ },
2387
+ {
2388
+ "kind": "Content",
2389
+ "text": "string[]"
2390
+ },
2391
+ {
2392
+ "kind": "Content",
2393
+ "text": ";"
2394
+ }
2395
+ ],
2396
+ "isReadonly": true,
2397
+ "isOptional": false,
2398
+ "releaseTag": "Public",
2399
+ "name": "declarationSpaces",
2400
+ "propertyTypeTokenRange": {
2401
+ "startIndex": 1,
2402
+ "endIndex": 2
2403
+ },
2404
+ "isStatic": true,
2405
+ "isProtected": false,
2406
+ "isAbstract": false
2407
+ },
2408
+ {
2409
+ "kind": "Property",
2410
+ "canonicalReference": "@alloy-js/java!JavaLexicalScope#symbols:member",
2411
+ "docComment": "",
2412
+ "excerptTokens": [
2413
+ {
2414
+ "kind": "Content",
2415
+ "text": "get symbols(): "
2416
+ },
2417
+ {
2418
+ "kind": "Content",
2419
+ "text": "import(\"@alloy-js/core\")."
2420
+ },
2421
+ {
2422
+ "kind": "Reference",
2423
+ "text": "OutputSpace",
2424
+ "canonicalReference": "@alloy-js/core!OutputSpace:type"
2425
+ },
2426
+ {
2427
+ "kind": "Content",
2428
+ "text": ";"
2429
+ }
2430
+ ],
2431
+ "isReadonly": true,
2432
+ "isOptional": false,
2433
+ "releaseTag": "Public",
2434
+ "name": "symbols",
2435
+ "propertyTypeTokenRange": {
2436
+ "startIndex": 1,
2437
+ "endIndex": 3
2438
+ },
2439
+ "isStatic": false,
2440
+ "isProtected": false,
2441
+ "isAbstract": false
2442
+ }
2443
+ ],
2444
+ "extendsTokenRange": {
2445
+ "startIndex": 1,
2446
+ "endIndex": 2
2447
+ },
2448
+ "implementsTokenRanges": []
2449
+ },
2353
2450
  {
2354
2451
  "kind": "TypeAlias",
2355
2452
  "canonicalReference": "@alloy-js/java!JavaOutputScope:type",
@@ -2424,6 +2521,28 @@
2424
2521
  "kind": "Content",
2425
2522
  "text": "string"
2426
2523
  },
2524
+ {
2525
+ "kind": "Content",
2526
+ "text": ", spaces: "
2527
+ },
2528
+ {
2529
+ "kind": "Reference",
2530
+ "text": "OutputSpace",
2531
+ "canonicalReference": "@alloy-js/core!OutputSpace:type"
2532
+ },
2533
+ {
2534
+ "kind": "Content",
2535
+ "text": "[] | "
2536
+ },
2537
+ {
2538
+ "kind": "Reference",
2539
+ "text": "OutputSpace",
2540
+ "canonicalReference": "@alloy-js/core!OutputSpace:type"
2541
+ },
2542
+ {
2543
+ "kind": "Content",
2544
+ "text": " | undefined"
2545
+ },
2427
2546
  {
2428
2547
  "kind": "Content",
2429
2548
  "text": ", options?: "
@@ -2451,15 +2570,85 @@
2451
2570
  "isOptional": false
2452
2571
  },
2453
2572
  {
2454
- "parameterName": "options",
2573
+ "parameterName": "spaces",
2455
2574
  "parameterTypeTokenRange": {
2456
2575
  "startIndex": 3,
2457
- "endIndex": 4
2576
+ "endIndex": 7
2577
+ },
2578
+ "isOptional": false
2579
+ },
2580
+ {
2581
+ "parameterName": "options",
2582
+ "parameterTypeTokenRange": {
2583
+ "startIndex": 8,
2584
+ "endIndex": 9
2458
2585
  },
2459
2586
  "isOptional": true
2460
2587
  }
2461
2588
  ]
2462
2589
  },
2590
+ {
2591
+ "kind": "Method",
2592
+ "canonicalReference": "@alloy-js/java!JavaOutputSymbol#copy:member(1)",
2593
+ "docComment": "",
2594
+ "excerptTokens": [
2595
+ {
2596
+ "kind": "Content",
2597
+ "text": "copy(): "
2598
+ },
2599
+ {
2600
+ "kind": "Reference",
2601
+ "text": "JavaOutputSymbol",
2602
+ "canonicalReference": "@alloy-js/java!JavaOutputSymbol:class"
2603
+ },
2604
+ {
2605
+ "kind": "Content",
2606
+ "text": ";"
2607
+ }
2608
+ ],
2609
+ "isStatic": false,
2610
+ "returnTypeTokenRange": {
2611
+ "startIndex": 1,
2612
+ "endIndex": 2
2613
+ },
2614
+ "releaseTag": "Public",
2615
+ "isProtected": false,
2616
+ "overloadIndex": 1,
2617
+ "parameters": [],
2618
+ "isOptional": false,
2619
+ "isAbstract": false,
2620
+ "name": "copy"
2621
+ },
2622
+ {
2623
+ "kind": "Property",
2624
+ "canonicalReference": "@alloy-js/java!JavaOutputSymbol.memberSpaces:member",
2625
+ "docComment": "",
2626
+ "excerptTokens": [
2627
+ {
2628
+ "kind": "Content",
2629
+ "text": "static memberSpaces: "
2630
+ },
2631
+ {
2632
+ "kind": "Content",
2633
+ "text": "readonly [\"static\", \"instance\"]"
2634
+ },
2635
+ {
2636
+ "kind": "Content",
2637
+ "text": ";"
2638
+ }
2639
+ ],
2640
+ "isReadonly": false,
2641
+ "isOptional": false,
2642
+ "releaseTag": "Public",
2643
+ "name": "memberSpaces",
2644
+ "propertyTypeTokenRange": {
2645
+ "startIndex": 1,
2646
+ "endIndex": 2
2647
+ },
2648
+ "isStatic": true,
2649
+ "isProtected": false,
2650
+ "isAbstract": false
2651
+ },
2463
2652
  {
2464
2653
  "kind": "Property",
2465
2654
  "canonicalReference": "@alloy-js/java!JavaOutputSymbol#package:member",
@@ -2581,6 +2770,36 @@
2581
2770
  "name": "JavaPackageScope",
2582
2771
  "preserveMemberOrder": false,
2583
2772
  "members": [
2773
+ {
2774
+ "kind": "Property",
2775
+ "canonicalReference": "@alloy-js/java!JavaPackageScope.declarationSpaces:member",
2776
+ "docComment": "",
2777
+ "excerptTokens": [
2778
+ {
2779
+ "kind": "Content",
2780
+ "text": "static readonly declarationSpaces: "
2781
+ },
2782
+ {
2783
+ "kind": "Content",
2784
+ "text": "readonly [\"symbols\"]"
2785
+ },
2786
+ {
2787
+ "kind": "Content",
2788
+ "text": ";"
2789
+ }
2790
+ ],
2791
+ "isReadonly": true,
2792
+ "isOptional": false,
2793
+ "releaseTag": "Public",
2794
+ "name": "declarationSpaces",
2795
+ "propertyTypeTokenRange": {
2796
+ "startIndex": 1,
2797
+ "endIndex": 2
2798
+ },
2799
+ "isStatic": true,
2800
+ "isProtected": false,
2801
+ "isAbstract": false
2802
+ },
2584
2803
  {
2585
2804
  "kind": "Property",
2586
2805
  "canonicalReference": "@alloy-js/java!JavaPackageScope#kind:member",
@@ -2610,6 +2829,41 @@
2610
2829
  "isStatic": false,
2611
2830
  "isProtected": false,
2612
2831
  "isAbstract": false
2832
+ },
2833
+ {
2834
+ "kind": "Property",
2835
+ "canonicalReference": "@alloy-js/java!JavaPackageScope#symbols:member",
2836
+ "docComment": "",
2837
+ "excerptTokens": [
2838
+ {
2839
+ "kind": "Content",
2840
+ "text": "get symbols(): "
2841
+ },
2842
+ {
2843
+ "kind": "Content",
2844
+ "text": "import(\"@alloy-js/core\")."
2845
+ },
2846
+ {
2847
+ "kind": "Reference",
2848
+ "text": "OutputSpace",
2849
+ "canonicalReference": "@alloy-js/core!OutputSpace:type"
2850
+ },
2851
+ {
2852
+ "kind": "Content",
2853
+ "text": ";"
2854
+ }
2855
+ ],
2856
+ "isReadonly": true,
2857
+ "isOptional": false,
2858
+ "releaseTag": "Public",
2859
+ "name": "symbols",
2860
+ "propertyTypeTokenRange": {
2861
+ "startIndex": 1,
2862
+ "endIndex": 3
2863
+ },
2864
+ "isStatic": false,
2865
+ "isProtected": false,
2866
+ "isAbstract": false
2613
2867
  }
2614
2868
  ],
2615
2869
  "extendsTokenRange": {
@@ -6059,6 +6313,39 @@
6059
6313
  "parameters": [],
6060
6314
  "name": "useJavaNamePolicy"
6061
6315
  },
6316
+ {
6317
+ "kind": "Function",
6318
+ "canonicalReference": "@alloy-js/java!useLexicalScope:function(1)",
6319
+ "docComment": "",
6320
+ "excerptTokens": [
6321
+ {
6322
+ "kind": "Content",
6323
+ "text": "export declare function useLexicalScope(): "
6324
+ },
6325
+ {
6326
+ "kind": "Reference",
6327
+ "text": "JavaLexicalScope",
6328
+ "canonicalReference": "@alloy-js/java!JavaLexicalScope:class"
6329
+ },
6330
+ {
6331
+ "kind": "Content",
6332
+ "text": " | undefined"
6333
+ },
6334
+ {
6335
+ "kind": "Content",
6336
+ "text": ";"
6337
+ }
6338
+ ],
6339
+ "fileUrlPath": "src/utils.ts",
6340
+ "returnTypeTokenRange": {
6341
+ "startIndex": 1,
6342
+ "endIndex": 3
6343
+ },
6344
+ "releaseTag": "Public",
6345
+ "overloadIndex": 1,
6346
+ "parameters": [],
6347
+ "name": "useLexicalScope"
6348
+ },
6062
6349
  {
6063
6350
  "kind": "Function",
6064
6351
  "canonicalReference": "@alloy-js/java!usePackage:function(1)",
@@ -1,4 +1,4 @@
1
- import { code, Declaration, refkey } from "@alloy-js/core";
1
+ import { code, refkey } from "@alloy-js/core";
2
2
  import { d } from "@alloy-js/core/testing";
3
3
  import { expect, it } from "vitest";
4
4
  import * as jv from "../src/components/index.js";
@@ -7,13 +7,13 @@ import { assertFileContents, testRender, toSourceText } from "./utils.js";
7
7
  it("works", () => {
8
8
  const res = toSourceText(
9
9
  <>
10
- <Declaration name="TestClass">
10
+ <jv.Declaration name="TestClass">
11
11
  {code`
12
12
  public class TestClass {
13
13
  ${(<jv.Constructor public name="TestClass" />)}
14
14
  }
15
15
  `}
16
- </Declaration>
16
+ </jv.Declaration>
17
17
  </>,
18
18
  );
19
19
 
@@ -29,13 +29,13 @@ it("works", () => {
29
29
  it("takes name from class", () => {
30
30
  const res = toSourceText(
31
31
  <>
32
- <Declaration name="TestClass">
32
+ <jv.Declaration name="TestClass">
33
33
  {code`
34
34
  public class TestClass {
35
35
  ${(<jv.Constructor public />)}
36
36
  }
37
37
  `}
38
- </Declaration>
38
+ </jv.Declaration>
39
39
  </>,
40
40
  );
41
41
 
@@ -61,7 +61,7 @@ it("declares parameters", () => {
61
61
  </jv.SourceFile>
62
62
  <jv.PackageDirectory package="imports">
63
63
  <jv.SourceFile path="TestClass.java">
64
- <Declaration name="TestClass">
64
+ <jv.Declaration name="TestClass">
65
65
  {code`
66
66
  public class TestClass {
67
67
  ${(
@@ -75,7 +75,7 @@ it("declares parameters", () => {
75
75
  )}
76
76
  }
77
77
  `}
78
- </Declaration>
78
+ </jv.Declaration>
79
79
  </jv.SourceFile>
80
80
  </jv.PackageDirectory>
81
81
  </>,
@@ -1,4 +1,4 @@
1
- import { code, Declaration, refkey } from "@alloy-js/core";
1
+ import { code, refkey } from "@alloy-js/core";
2
2
  import { d } from "@alloy-js/core/testing";
3
3
  import { describe, expect, it } from "vitest";
4
4
  import * as jv from "../src/components/index.js";
@@ -152,7 +152,7 @@ it("declares parameters", () => {
152
152
  </jv.SourceFile>
153
153
  <jv.PackageDirectory package="imports">
154
154
  <jv.SourceFile path="Test.java">
155
- <Declaration name="Test">
155
+ <jv.Declaration name="Test">
156
156
  {code`
157
157
  public class Test {
158
158
  ${(
@@ -169,7 +169,7 @@ it("declares parameters", () => {
169
169
  )}
170
170
  }
171
171
  `}
172
- </Declaration>
172
+ </jv.Declaration>
173
173
  </jv.SourceFile>
174
174
  </jv.PackageDirectory>
175
175
  </>,
@@ -203,7 +203,7 @@ it("defines generics", () => {
203
203
  </jv.SourceFile>
204
204
  <jv.PackageDirectory package="imports">
205
205
  <jv.SourceFile path="Test.java">
206
- <Declaration name="Test">
206
+ <jv.Declaration name="Test">
207
207
  {code`
208
208
  public class Test {
209
209
  ${(
@@ -217,7 +217,7 @@ it("defines generics", () => {
217
217
  )}
218
218
  }
219
219
  `}
220
- </Declaration>
220
+ </jv.Declaration>
221
221
  </jv.SourceFile>
222
222
  </jv.PackageDirectory>
223
223
  </>,
@@ -1,4 +1,4 @@
1
- import { code, Declaration, refkey } from "@alloy-js/core";
1
+ import { code, refkey } from "@alloy-js/core";
2
2
  import { d } from "@alloy-js/core/testing";
3
3
  import { expect, it } from "vitest";
4
4
  import * as jv from "../src/components/index.js";
@@ -37,13 +37,13 @@ it("works with external type", () => {
37
37
  </jv.SourceFile>
38
38
  <jv.PackageDirectory package="imports">
39
39
  <jv.SourceFile path="Test.java">
40
- <Declaration name="Test">
40
+ <jv.Declaration name="Test">
41
41
  {code`
42
42
  public class Test {
43
43
  ${(<jv.Variable public static type={refkey("Model")} name="myModel" />)};
44
44
  }
45
45
  `}
46
- </Declaration>
46
+ </jv.Declaration>
47
47
  </jv.SourceFile>
48
48
  </jv.PackageDirectory>
49
49
  </>,
@@ -75,13 +75,13 @@ it("declares new object", () => {
75
75
  </jv.SourceFile>
76
76
  <jv.PackageDirectory package="imports">
77
77
  <jv.SourceFile path="Test.java">
78
- <Declaration name="Test">
78
+ <jv.Declaration name="Test">
79
79
  {code`
80
80
  public class Test {
81
81
  ${(<jv.ObjectDeclaration public static type={refkey("Model")} name="myModel" args={[<jv.Value value="initValue" />]} />)};
82
82
  }
83
83
  `}
84
- </Declaration>
84
+ </jv.Declaration>
85
85
  </jv.SourceFile>
86
86
  </jv.PackageDirectory>
87
87
  </>,
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.8"
8
+ "packageVersion": "7.52.9"
9
9
  }
10
10
  ]
11
11
  }