@alloy-js/java 0.23.0-dev.3 → 0.23.0

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 (68) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/docs/api/components/ArgumentList.md +31 -0
  4. package/docs/api/components/Class.md +78 -0
  5. package/docs/api/components/Constructor.md +73 -0
  6. package/docs/api/components/Declaration.md +38 -0
  7. package/docs/api/components/Enum.md +72 -0
  8. package/docs/api/components/EnumMember.md +68 -0
  9. package/docs/api/components/EnumMemberList.md +29 -0
  10. package/docs/api/components/ExtendsClause.md +27 -0
  11. package/docs/api/components/ImplementsClause.md +27 -0
  12. package/docs/api/components/ImportStatement.md +31 -0
  13. package/docs/api/components/ImportStatements.md +25 -0
  14. package/docs/api/components/Interface.md +75 -0
  15. package/docs/api/components/MavenProject.md +27 -0
  16. package/docs/api/components/Method.md +80 -0
  17. package/docs/api/components/Modifiers.md +70 -0
  18. package/docs/api/components/Name.md +19 -0
  19. package/docs/api/components/NamedArgumentList.md +27 -0
  20. package/docs/api/components/ObjectDeclaration.md +77 -0
  21. package/docs/api/components/PackageDirectory.md +28 -0
  22. package/docs/api/components/Parameters_2.md +27 -0
  23. package/docs/api/components/PomFile.md +25 -0
  24. package/docs/api/components/PomFileBuild.md +25 -0
  25. package/docs/api/components/ProjectDirectory.md +40 -0
  26. package/docs/api/components/Reference.md +25 -0
  27. package/docs/api/components/SourceFile.md +32 -0
  28. package/docs/api/components/TypeArguments.md +29 -0
  29. package/docs/api/components/TypeParameters.md +27 -0
  30. package/docs/api/components/Value.md +25 -0
  31. package/docs/api/components/Variable.md +71 -0
  32. package/docs/api/components/index.md +32 -0
  33. package/docs/api/components/usePackage.md +19 -0
  34. package/docs/api/contexts/PackageDirectory-context.md +20 -0
  35. package/docs/api/contexts/Project-context.md +20 -0
  36. package/docs/api/contexts/SourceFile-context.md +17 -0
  37. package/docs/api/contexts/index.md +5 -0
  38. package/docs/api/functions/createJavaNamePolicy.md +17 -0
  39. package/docs/api/functions/createLibrary.md +18 -0
  40. package/docs/api/functions/index.md +7 -0
  41. package/docs/api/functions/ref.md +20 -0
  42. package/docs/api/functions/useJavaNamePolicy.md +17 -0
  43. package/docs/api/functions/useLexicalScope.md +17 -0
  44. package/docs/api/index.md +7 -0
  45. package/docs/api/types/CommonDeclarationProps.md +9 -0
  46. package/docs/api/types/CreateLibraryProps.md +10 -0
  47. package/docs/api/types/ExtendsTypeArgumentDescriptor.md +7 -0
  48. package/docs/api/types/GradleProjectConfig.md +6 -0
  49. package/docs/api/types/JavaDependency.md +12 -0
  50. package/docs/api/types/JavaElements.md +5 -0
  51. package/docs/api/types/JavaLexicalScope.md +10 -0
  52. package/docs/api/types/JavaOutputScope.md +5 -0
  53. package/docs/api/types/JavaOutputSymbol.md +15 -0
  54. package/docs/api/types/JavaOutputSymbolOptions.md +9 -0
  55. package/docs/api/types/JavaPackageScope.md +11 -0
  56. package/docs/api/types/JavaProjectScope.md +17 -0
  57. package/docs/api/types/JavaProjectScopeOptions.md +10 -0
  58. package/docs/api/types/LibraryDescriptor.md +7 -0
  59. package/docs/api/types/LibraryRefkeys.md +7 -0
  60. package/docs/api/types/MavenProjectConfig.md +15 -0
  61. package/docs/api/types/NamedTypeArgumentDescriptor.md +7 -0
  62. package/docs/api/types/SuperTypeArgumentDescriptor.md +7 -0
  63. package/docs/api/types/TypeArgumentDescriptor.md +5 -0
  64. package/docs/api/types/WildcardTypeArgumentDescriptor.md +7 -0
  65. package/docs/api/types/index.md +22 -0
  66. package/docs/api/variables/index.md +3 -0
  67. package/docs/api/variables/javaUtil.md +7 -0
  68. package/package.json +6 -6
@@ -0,0 +1,70 @@
1
+ # Modifiers
2
+
3
+ Renders the modifiers based on the provided props.
4
+
5
+ Objects extend this interface to allow to take modifiers as boolean props. Then can declare components like so
6
+
7
+ `<Class public final abstract />`
8
+
9
+ Error will be thrown if try to specify multiple access modifiers
10
+
11
+ * jsx
12
+
13
+ ```tsx
14
+ import { Modifiers } from "@alloy-js/java";
15
+
16
+
17
+ <Modifiers
18
+ abstract
19
+ default
20
+ final
21
+ native
22
+ private
23
+ protected
24
+ public
25
+ static
26
+ strictfp
27
+ synchronized
28
+ transient
29
+ volatile
30
+ />
31
+ ```
32
+
33
+ * stc
34
+
35
+ ```ts
36
+ import { Modifiers } from "@alloy-js/java/stc";
37
+
38
+
39
+ Modifiers({
40
+ abstract: boolean,
41
+ default: boolean,
42
+ final: boolean,
43
+ native: boolean,
44
+ private: boolean,
45
+ protected: boolean,
46
+ public: boolean,
47
+ static: boolean,
48
+ strictfp: boolean,
49
+ synchronized: boolean,
50
+ transient: boolean,
51
+ volatile: boolean,
52
+ }).children(children)
53
+ ```
54
+
55
+ ## Props
56
+
57
+ | | | |
58
+ | ------------ | ---------------- | - |
59
+ | abstract | optional boolean | |
60
+ | default | optional boolean | |
61
+ | final | optional boolean | |
62
+ | native | optional boolean | |
63
+ | private | optional boolean | |
64
+ | protected | optional boolean | |
65
+ | public | optional boolean | |
66
+ | static | optional boolean | |
67
+ | strictfp | optional boolean | |
68
+ | synchronized | optional boolean | |
69
+ | transient | optional boolean | |
70
+ | volatile | optional boolean | |
@@ -0,0 +1,19 @@
1
+ # Name
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { Name } from "@alloy-js/java";
7
+
8
+
9
+ <Name />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { Name } from "@alloy-js/java/stc";
16
+
17
+
18
+ Name({ }).children(children)
19
+ ```
@@ -0,0 +1,27 @@
1
+ # NamedArgumentList
2
+
3
+ Collect a set of named arguments. Will pass to object as named arguments.
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { NamedArgumentList } from "@alloy-js/java";
9
+
10
+
11
+ <NamedArgumentList args={Record<string, Children>} />
12
+ ```
13
+
14
+ * stc
15
+
16
+ ```ts
17
+ import { NamedArgumentList } from "@alloy-js/java/stc";
18
+
19
+
20
+ NamedArgumentList({ args: Record<string, Children> }).children(children)
21
+ ```
22
+
23
+ ## Props
24
+
25
+ | | | |
26
+ | ---- | ---------------------------------------------------------- | - |
27
+ | args | Record\<string, [Children](../../../core/types/children/)> | |
@@ -0,0 +1,77 @@
1
+ # ObjectDeclaration
2
+
3
+ Shorthand to instantiate a new object. Declares it with ‘new’ and passes arguments to the constructor of the object, if any
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { ObjectDeclaration } from "@alloy-js/java";
9
+
10
+
11
+ <ObjectDeclaration
12
+ abstract
13
+ args={Children[]}
14
+ default
15
+ final
16
+ name={string | Namekey}
17
+ native
18
+ private
19
+ protected
20
+ public
21
+ refkey={Refkey}
22
+ static
23
+ strictfp
24
+ synchronized
25
+ transient
26
+ type={Children}
27
+ volatile
28
+ />
29
+ ```
30
+
31
+ * stc
32
+
33
+ ```ts
34
+ import { ObjectDeclaration } from "@alloy-js/java/stc";
35
+
36
+
37
+ ObjectDeclaration({
38
+ abstract: boolean,
39
+ args: Children[],
40
+ default: boolean,
41
+ final: boolean,
42
+ name: string | Namekey,
43
+ native: boolean,
44
+ private: boolean,
45
+ protected: boolean,
46
+ public: boolean,
47
+ refkey: Refkey,
48
+ static: boolean,
49
+ strictfp: boolean,
50
+ synchronized: boolean,
51
+ transient: boolean,
52
+ type: Children,
53
+ volatile: boolean,
54
+ }).children(children)
55
+ ```
56
+
57
+ ## Props
58
+
59
+ | | | |
60
+ | ------------ | ----------------------------------------------------- | - |
61
+ | abstract | optional boolean | |
62
+ | args | optional [Children](../../../core/types/children/)\[] | |
63
+ | children | optional [Children](../../../core/types/children/) | |
64
+ | default | optional boolean | |
65
+ | final | optional boolean | |
66
+ | name | string \| [Namekey](../../../core/types/namekey/) | |
67
+ | native | optional boolean | |
68
+ | private | optional boolean | |
69
+ | protected | optional boolean | |
70
+ | public | optional boolean | |
71
+ | refkey | optional [Refkey](../../../core/types/refkey/) | |
72
+ | static | optional boolean | |
73
+ | strictfp | optional boolean | |
74
+ | synchronized | optional boolean | |
75
+ | transient | optional boolean | |
76
+ | type | [Children](../../../core/types/children/) | |
77
+ | volatile | optional boolean | |
@@ -0,0 +1,28 @@
1
+ # PackageDirectory
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { PackageDirectory } from "@alloy-js/java";
7
+
8
+
9
+ <PackageDirectory package="string">
10
+ {children}
11
+ </PackageDirectory>
12
+ ```
13
+
14
+ * stc
15
+
16
+ ```ts
17
+ import { PackageDirectory } from "@alloy-js/java/stc";
18
+
19
+
20
+ PackageDirectory({ package: string }).children(children)
21
+ ```
22
+
23
+ ## Props
24
+
25
+ | | | |
26
+ | -------- | -------------------------------------------------- | - |
27
+ | children | optional [Children](../../../core/types/children/) | |
28
+ | package | string | |
@@ -0,0 +1,27 @@
1
+ # Parameters_2
2
+
3
+ Render a set of parameters for a method or constructor
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { Parameters_2 } from "@alloy-js/java";
9
+
10
+
11
+ <Parameters_2 parameters={Record<string, Children>} />
12
+ ```
13
+
14
+ * stc
15
+
16
+ ```ts
17
+ import { Parameters_2 } from "@alloy-js/java/stc";
18
+
19
+
20
+ Parameters_2({ parameters: Record<string, Children> }).children(children)
21
+ ```
22
+
23
+ ## Props
24
+
25
+ | | | |
26
+ | ---------- | ------------------------------------------------------------------- | - |
27
+ | parameters | optional Record\<string, [Children](../../../core/types/children/)> | |
@@ -0,0 +1,25 @@
1
+ # PomFile
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { PomFile } from "@alloy-js/java";
7
+
8
+
9
+ <PomFile projectConfig={MavenProjectConfig} />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { PomFile } from "@alloy-js/java/stc";
16
+
17
+
18
+ PomFile({ projectConfig: MavenProjectConfig }).children(children)
19
+ ```
20
+
21
+ ## Props
22
+
23
+ | | | |
24
+ | ------------- | ----------------------------------------------------- | - |
25
+ | projectConfig | [MavenProjectConfig](../../types/mavenprojectconfig/) | |
@@ -0,0 +1,25 @@
1
+ # PomFileBuild
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { PomFileBuild } from "@alloy-js/java";
7
+
8
+
9
+ <PomFileBuild projectConfig={MavenProjectConfig} />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { PomFileBuild } from "@alloy-js/java/stc";
16
+
17
+
18
+ PomFileBuild({ projectConfig: MavenProjectConfig }).children(children)
19
+ ```
20
+
21
+ ## Props
22
+
23
+ | | | |
24
+ | ------------- | ----------------------------------------------------- | - |
25
+ | projectConfig | [MavenProjectConfig](../../types/mavenprojectconfig/) | |
@@ -0,0 +1,40 @@
1
+ # ProjectDirectory
2
+
3
+ Represents a java project directory. Use if you want to generate a Java project with a build tool included (maven, gradle etc).
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { ProjectDirectory } from "@alloy-js/java";
9
+
10
+
11
+ <ProjectDirectory
12
+ gradleProjectConfig={GradleProjectConfig}
13
+ mavenProjectConfig={MavenProjectConfig}
14
+ name="string"
15
+ >
16
+ {children}
17
+ </ProjectDirectory>
18
+ ```
19
+
20
+ * stc
21
+
22
+ ```ts
23
+ import { ProjectDirectory } from "@alloy-js/java/stc";
24
+
25
+
26
+ ProjectDirectory({
27
+ gradleProjectConfig: GradleProjectConfig,
28
+ mavenProjectConfig: MavenProjectConfig,
29
+ name: string,
30
+ }).children(children)
31
+ ```
32
+
33
+ ## Props
34
+
35
+ | | | |
36
+ | ------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
37
+ | children | optional [Children](../../../core/types/children/) | |
38
+ | gradleProjectConfig | optional [GradleProjectConfig](../../types/gradleprojectconfig/) | |
39
+ | mavenProjectConfig | optional [MavenProjectConfig](../../types/mavenprojectconfig/) | Specify project configuration for either maven or gradle. If not specified, will create generic Java project |
40
+ | name | string | |
@@ -0,0 +1,25 @@
1
+ # Reference
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { Reference } from "@alloy-js/java";
7
+
8
+
9
+ <Reference refkey={Refkey} />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { Reference } from "@alloy-js/java/stc";
16
+
17
+
18
+ Reference({ refkey: Refkey }).children(children)
19
+ ```
20
+
21
+ ## Props
22
+
23
+ | | | |
24
+ | ------ | ------------------------------------- | - |
25
+ | refkey | [Refkey](../../../core/types/refkey/) | |
@@ -0,0 +1,32 @@
1
+ # SourceFile
2
+
3
+ Represents a Java source file.
4
+
5
+ Handles top level package declaration, as well as importing other sources
6
+
7
+ * jsx
8
+
9
+ ```tsx
10
+ import { SourceFile } from "@alloy-js/java";
11
+
12
+
13
+ <SourceFile path="string">
14
+ {children}
15
+ </SourceFile>
16
+ ```
17
+
18
+ * stc
19
+
20
+ ```ts
21
+ import { SourceFile } from "@alloy-js/java/stc";
22
+
23
+
24
+ SourceFile({ path: string }).children(children)
25
+ ```
26
+
27
+ ## Props
28
+
29
+ | | | |
30
+ | -------- | -------------------------------------------------- | - |
31
+ | children | optional [Children](../../../core/types/children/) | |
32
+ | path | string | |
@@ -0,0 +1,29 @@
1
+ # TypeArguments
2
+
3
+ Type arguments for a generic type. Can be called with either an array of Children which are rendered as type arguments, or an array of [TypeArgumentDescriptor](../../types/typeargumentdescriptor/)s which allow for specifying use-site variance.
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { TypeArguments } from "@alloy-js/java";
9
+
10
+
11
+ <TypeArguments args={Children[] | TypeArgumentDescriptor[]} />
12
+ ```
13
+
14
+ * stc
15
+
16
+ ```ts
17
+ import { TypeArguments } from "@alloy-js/java/stc";
18
+
19
+
20
+ TypeArguments({
21
+ args: Children[] | TypeArgumentDescriptor[],
22
+ }).children(children)
23
+ ```
24
+
25
+ ## Props
26
+
27
+ | | | |
28
+ | ---- | ------------------------------------------------------------------------------------------------------------------------- | - |
29
+ | args | optional [Children](../../../core/types/children/)\[] \| [TypeArgumentDescriptor](../../types/typeargumentdescriptor/)\[] | |
@@ -0,0 +1,27 @@
1
+ # TypeParameters
2
+
3
+ Render a set of generic types for a method or class.
4
+
5
+ * jsx
6
+
7
+ ```tsx
8
+ import { TypeParameters } from "@alloy-js/java";
9
+
10
+
11
+ <TypeParameters generics={Record<string, Children>} />
12
+ ```
13
+
14
+ * stc
15
+
16
+ ```ts
17
+ import { TypeParameters } from "@alloy-js/java/stc";
18
+
19
+
20
+ TypeParameters({ generics: Record<string, Children> }).children(children)
21
+ ```
22
+
23
+ ## Props
24
+
25
+ | | | |
26
+ | -------- | ------------------------------------------------------------------- | - |
27
+ | generics | optional Record\<string, [Children](../../../core/types/children/)> | |
@@ -0,0 +1,25 @@
1
+ # Value
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { Value } from "@alloy-js/java";
7
+
8
+
9
+ <Value value={unknown} />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { Value } from "@alloy-js/java/stc";
16
+
17
+
18
+ Value({ value: unknown }).children(children)
19
+ ```
20
+
21
+ ## Props
22
+
23
+ | | | |
24
+ | ----- | ---------------- | - |
25
+ | value | optional unknown | |
@@ -0,0 +1,71 @@
1
+ # Variable
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { Variable } from "@alloy-js/java";
7
+
8
+
9
+ <Variable
10
+ abstract
11
+ default
12
+ final
13
+ name={string | Namekey}
14
+ native
15
+ private
16
+ protected
17
+ public
18
+ static
19
+ strictfp
20
+ synchronized
21
+ transient
22
+ type={Children}
23
+ value={Children}
24
+ volatile
25
+ />
26
+ ```
27
+
28
+ * stc
29
+
30
+ ```ts
31
+ import { Variable } from "@alloy-js/java/stc";
32
+
33
+
34
+ Variable({
35
+ abstract: boolean,
36
+ default: boolean,
37
+ final: boolean,
38
+ name: string | Namekey,
39
+ native: boolean,
40
+ private: boolean,
41
+ protected: boolean,
42
+ public: boolean,
43
+ static: boolean,
44
+ strictfp: boolean,
45
+ synchronized: boolean,
46
+ transient: boolean,
47
+ type: Children,
48
+ value: Children,
49
+ volatile: boolean,
50
+ }).children(children)
51
+ ```
52
+
53
+ ## Props
54
+
55
+ | | | |
56
+ | ------------ | -------------------------------------------------- | - |
57
+ | abstract | optional boolean | |
58
+ | default | optional boolean | |
59
+ | final | optional boolean | |
60
+ | name | string \| [Namekey](../../../core/types/namekey/) | |
61
+ | native | optional boolean | |
62
+ | private | optional boolean | |
63
+ | protected | optional boolean | |
64
+ | public | optional boolean | |
65
+ | static | optional boolean | |
66
+ | strictfp | optional boolean | |
67
+ | synchronized | optional boolean | |
68
+ | transient | optional boolean | |
69
+ | type | [Children](../../../core/types/children/) | |
70
+ | value | optional [Children](../../../core/types/children/) | |
71
+ | volatile | optional boolean | |
@@ -0,0 +1,32 @@
1
+ # java — components
2
+
3
+ - [ArgumentList](ArgumentList.md) — A list of arguments to be passed to a function, constructor, enum, and so forth.
4
+ - [Class](Class.md) — import { Class } from "@alloy-js/java";
5
+ - [Constructor](Constructor.md) — Declare a constructor, usually for a class or enum If no name is provided, will try take name from class or enum declara
6
+ - [Declaration](Declaration.md) — Declare a symbol in the program.
7
+ - [Enum](Enum.md) — import { Enum } from "@alloy-js/java";
8
+ - [EnumMember](EnumMember.md) — import { EnumMember } from "@alloy-js/java";
9
+ - [EnumMemberList](EnumMemberList.md) — Create a list of enum members, joining with a comma and a hardline, and ending with a semicolon.
10
+ - [ExtendsClause](ExtendsClause.md) — The extends clause for a class or interface.
11
+ - [ImplementsClause](ImplementsClause.md) — The implements clause for a class, interface, or enum.
12
+ - [ImportStatement](ImportStatement.md) — import { ImportStatement } from "@alloy-js/java";
13
+ - [ImportStatements](ImportStatements.md) — import { ImportStatements } from "@alloy-js/java";
14
+ - [Interface](Interface.md) — import { Interface } from "@alloy-js/java";
15
+ - [MavenProject](MavenProject.md) — Represents a maven project.
16
+ - [Method](Method.md) — import { Method } from "@alloy-js/java";
17
+ - [Modifiers](Modifiers.md) — Renders the modifiers based on the provided props.
18
+ - [Name](Name.md) — import { Name } from "@alloy-js/java";
19
+ - [NamedArgumentList](NamedArgumentList.md) — Collect a set of named arguments.
20
+ - [ObjectDeclaration](ObjectDeclaration.md) — Shorthand to instantiate a new object.
21
+ - [PackageDirectory](PackageDirectory.md) — import { PackageDirectory } from "@alloy-js/java";
22
+ - [Parameters_2](Parameters_2.md) — Render a set of parameters for a method or constructor
23
+ - [PomFile](PomFile.md) — import { PomFile } from "@alloy-js/java";
24
+ - [PomFileBuild](PomFileBuild.md) — import { PomFileBuild } from "@alloy-js/java";
25
+ - [ProjectDirectory](ProjectDirectory.md) — Represents a java project directory.
26
+ - [Reference](Reference.md) — import { Reference } from "@alloy-js/java";
27
+ - [SourceFile](SourceFile.md) — Represents a Java source file.
28
+ - [TypeArguments](TypeArguments.md) — Type arguments for a generic type.
29
+ - [TypeParameters](TypeParameters.md) — Render a set of generic types for a method or class.
30
+ - [usePackage](usePackage.md) — import { usePackage } from "@alloy-js/java";
31
+ - [Value](Value.md) — import { Value } from "@alloy-js/java";
32
+ - [Variable](Variable.md) — import { Variable } from "@alloy-js/java";
@@ -0,0 +1,19 @@
1
+ # usePackage
2
+
3
+ * jsx
4
+
5
+ ```tsx
6
+ import { usePackage } from "@alloy-js/java";
7
+
8
+
9
+ <usePackage />
10
+ ```
11
+
12
+ * stc
13
+
14
+ ```ts
15
+ import { usePackage } from "@alloy-js/java/stc";
16
+
17
+
18
+ usePackage({ }).children(children)
19
+ ```
@@ -0,0 +1,20 @@
1
+ # PackageDirectory context
2
+
3
+ ```ts
4
+ const PackageDirectoryContext: ComponentContext<PackageDirectoryContext>
5
+ ```
6
+
7
+ ## Accessor
8
+
9
+ ```ts
10
+ const myContext = useContext(PackageDirectoryContext);
11
+ ```
12
+
13
+ ## Context interface
14
+
15
+ | | | |
16
+ | ------------- | ------------------------------------------------- | - |
17
+ | name | string | |
18
+ | path | string | |
19
+ | qualifiedName | string | |
20
+ | scope | [JavaPackageScope](../../types/javapackagescope/) | |
@@ -0,0 +1,20 @@
1
+ # Project context
2
+
3
+ ```ts
4
+ const ProjectContext: ComponentContext<ProjectContext>
5
+ ```
6
+
7
+ ## Accessor
8
+
9
+ ```ts
10
+ import { useProject } from "@alloy-js/core";
11
+
12
+
13
+ const myContext = useProject();
14
+ ```
15
+
16
+ ## Context interface
17
+
18
+ | | | |
19
+ | ----- | ------------------------------------------------- | - |
20
+ | scope | [JavaProjectScope](../../types/javaprojectscope/) | |
@@ -0,0 +1,17 @@
1
+ # SourceFile context
2
+
3
+ ```ts
4
+ const SourceFileContext: ComponentContext<SourceFileContext>
5
+ ```
6
+
7
+ ## Accessor
8
+
9
+ ```ts
10
+ const myContext = useContext(SourceFileContext);
11
+ ```
12
+
13
+ ## Context interface
14
+
15
+ | | | |
16
+ | --------- | -------------------------------- | - |
17
+ | addImport | (symbol: OutputSymbol) => string | |
@@ -0,0 +1,5 @@
1
+ # java — contexts
2
+
3
+ - [PackageDirectory context](PackageDirectory-context.md) — const PackageDirectoryContext: ComponentContext<PackageDirectoryContext>
4
+ - [Project context](Project-context.md) — const ProjectContext: ComponentContext<ProjectContext>
5
+ - [SourceFile context](SourceFile-context.md) — const SourceFileContext: ComponentContext<SourceFileContext>