@alloy-js/csharp 0.1.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 (125) hide show
  1. package/LICENSE.txt +7 -0
  2. package/api-extractor.json +4 -0
  3. package/babel.config.cjs +4 -0
  4. package/dist/src/components/Class.d.ts +33 -0
  5. package/dist/src/components/Class.d.ts.map +1 -0
  6. package/dist/src/components/Class.js +170 -0
  7. package/dist/src/components/Class.js.map +1 -0
  8. package/dist/src/components/Declaration.d.ts +8 -0
  9. package/dist/src/components/Declaration.d.ts.map +1 -0
  10. package/dist/src/components/Declaration.js +18 -0
  11. package/dist/src/components/Declaration.js.map +1 -0
  12. package/dist/src/components/Enum.d.ts +13 -0
  13. package/dist/src/components/Enum.d.ts.map +1 -0
  14. package/dist/src/components/Enum.js +65 -0
  15. package/dist/src/components/Enum.js.map +1 -0
  16. package/dist/src/components/Name.d.ts +2 -0
  17. package/dist/src/components/Name.d.ts.map +1 -0
  18. package/dist/src/components/Name.js +12 -0
  19. package/dist/src/components/Name.js.map +1 -0
  20. package/dist/src/components/Namespace.d.ts +11 -0
  21. package/dist/src/components/Namespace.d.ts.map +1 -0
  22. package/dist/src/components/Namespace.js +35 -0
  23. package/dist/src/components/Namespace.js.map +1 -0
  24. package/dist/src/components/Parameters.d.ts +13 -0
  25. package/dist/src/components/Parameters.d.ts.map +1 -0
  26. package/dist/src/components/Parameters.js +34 -0
  27. package/dist/src/components/Parameters.js.map +1 -0
  28. package/dist/src/components/ProjectDirectory.d.ts +12 -0
  29. package/dist/src/components/ProjectDirectory.d.ts.map +1 -0
  30. package/dist/src/components/ProjectDirectory.js +48 -0
  31. package/dist/src/components/ProjectDirectory.js.map +1 -0
  32. package/dist/src/components/Reference.d.ts +6 -0
  33. package/dist/src/components/Reference.d.ts.map +1 -0
  34. package/dist/src/components/Reference.js +9 -0
  35. package/dist/src/components/Reference.js.map +1 -0
  36. package/dist/src/components/SourceFile.d.ts +12 -0
  37. package/dist/src/components/SourceFile.d.ts.map +1 -0
  38. package/dist/src/components/SourceFile.js +72 -0
  39. package/dist/src/components/SourceFile.js.map +1 -0
  40. package/dist/src/components/UsingDirective.d.ts +5 -0
  41. package/dist/src/components/UsingDirective.d.ts.map +1 -0
  42. package/dist/src/components/UsingDirective.js +13 -0
  43. package/dist/src/components/UsingDirective.js.map +1 -0
  44. package/dist/src/components/index.d.ts +11 -0
  45. package/dist/src/components/index.d.ts.map +1 -0
  46. package/dist/src/components/index.js +11 -0
  47. package/dist/src/components/index.js.map +1 -0
  48. package/dist/src/components/stc/index.d.ts +43 -0
  49. package/dist/src/components/stc/index.d.ts.map +1 -0
  50. package/dist/src/components/stc/index.js +13 -0
  51. package/dist/src/components/stc/index.js.map +1 -0
  52. package/dist/src/index.d.ts +5 -0
  53. package/dist/src/index.d.ts.map +1 -0
  54. package/dist/src/index.js +5 -0
  55. package/dist/src/index.js.map +1 -0
  56. package/dist/src/modifiers.d.ts +5 -0
  57. package/dist/src/modifiers.d.ts.map +1 -0
  58. package/dist/src/modifiers.js +35 -0
  59. package/dist/src/modifiers.js.map +1 -0
  60. package/dist/src/name-policy.d.ts +5 -0
  61. package/dist/src/name-policy.d.ts.map +1 -0
  62. package/dist/src/name-policy.js +30 -0
  63. package/dist/src/name-policy.js.map +1 -0
  64. package/dist/src/symbols/csharp-output-symbol.d.ts +7 -0
  65. package/dist/src/symbols/csharp-output-symbol.d.ts.map +1 -0
  66. package/dist/src/symbols/csharp-output-symbol.js +20 -0
  67. package/dist/src/symbols/csharp-output-symbol.js.map +1 -0
  68. package/dist/src/symbols/index.d.ts +4 -0
  69. package/dist/src/symbols/index.d.ts.map +1 -0
  70. package/dist/src/symbols/index.js +4 -0
  71. package/dist/src/symbols/index.js.map +1 -0
  72. package/dist/src/symbols/reference.d.ts +3 -0
  73. package/dist/src/symbols/reference.d.ts.map +1 -0
  74. package/dist/src/symbols/reference.js +55 -0
  75. package/dist/src/symbols/reference.js.map +1 -0
  76. package/dist/src/symbols/scopes.d.ts +16 -0
  77. package/dist/src/symbols/scopes.d.ts.map +1 -0
  78. package/dist/src/symbols/scopes.js +37 -0
  79. package/dist/src/symbols/scopes.js.map +1 -0
  80. package/dist/test/class.test.d.ts +2 -0
  81. package/dist/test/class.test.d.ts.map +1 -0
  82. package/dist/test/enum.test.d.ts +2 -0
  83. package/dist/test/enum.test.d.ts.map +1 -0
  84. package/dist/test/namespace.test.d.ts +2 -0
  85. package/dist/test/namespace.test.d.ts.map +1 -0
  86. package/dist/test/projectdirectory.test.d.ts +2 -0
  87. package/dist/test/projectdirectory.test.d.ts.map +1 -0
  88. package/dist/test/sourcefile.test.d.ts +2 -0
  89. package/dist/test/sourcefile.test.d.ts.map +1 -0
  90. package/dist/test/using.test.d.ts +2 -0
  91. package/dist/test/using.test.d.ts.map +1 -0
  92. package/dist/test/utils.d.ts +6 -0
  93. package/dist/test/utils.d.ts.map +1 -0
  94. package/dist/tsconfig.tsbuildinfo +1 -0
  95. package/package.json +51 -0
  96. package/src/components/Class.tsx +210 -0
  97. package/src/components/Declaration.tsx +17 -0
  98. package/src/components/Enum.tsx +74 -0
  99. package/src/components/Name.tsx +11 -0
  100. package/src/components/Namespace.tsx +39 -0
  101. package/src/components/Parameters.tsx +52 -0
  102. package/src/components/ProjectDirectory.tsx +54 -0
  103. package/src/components/Reference.tsx +13 -0
  104. package/src/components/SourceFile.tsx +69 -0
  105. package/src/components/UsingDirective.tsx +19 -0
  106. package/src/components/index.ts +10 -0
  107. package/src/components/stc/index.ts +13 -0
  108. package/src/index.ts +4 -0
  109. package/src/modifiers.ts +45 -0
  110. package/src/name-policy.ts +41 -0
  111. package/src/symbols/csharp-output-symbol.ts +26 -0
  112. package/src/symbols/index.ts +3 -0
  113. package/src/symbols/reference.ts +65 -0
  114. package/src/symbols/scopes.ts +60 -0
  115. package/temp/api.json +3474 -0
  116. package/test/class.test.tsx +249 -0
  117. package/test/enum.test.tsx +147 -0
  118. package/test/namespace.test.tsx +59 -0
  119. package/test/projectdirectory.test.tsx +106 -0
  120. package/test/sourcefile.test.tsx +46 -0
  121. package/test/using.test.tsx +97 -0
  122. package/test/utils.tsx +69 -0
  123. package/tsconfig.json +11 -0
  124. package/tsdoc-metadata.json +11 -0
  125. package/vitest.config.ts +18 -0
@@ -0,0 +1,72 @@
1
+ import { Indent as _$Indent } from "@alloy-js/core";
2
+ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
+ import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
4
+ import * as core from "@alloy-js/core";
5
+ import { useNamespace } from "./Namespace.js";
6
+ import { Reference } from "./Reference.js";
7
+ import { UsingDirective } from "./UsingDirective.js";
8
+
9
+ // contains the info for the current source file
10
+
11
+ const SourceFileContext = core.createContext();
12
+
13
+ // returns the current source file
14
+ export function useSourceFile() {
15
+ return core.useContext(SourceFileContext);
16
+ }
17
+
18
+ // properties fro creating a C# source file
19
+
20
+ // a C# source file. exists within the context of a namespace
21
+ // contains using statements and declarations
22
+ export function SourceFile(props) {
23
+ const namespaceCtx = useNamespace();
24
+ if (!namespaceCtx) {
25
+ throw new Error("SourceFile must be declared inside a namespace");
26
+ }
27
+ const using = core.reactive(new Array());
28
+ if (props.using) {
29
+ using.push(...props.using);
30
+ }
31
+
32
+ // adds the specified namespace to the array of using statements.
33
+ // called via SourceFileContext.addUsing when resolving refkeys.
34
+ function addUsing(namespace) {
35
+ if (!using.includes(namespace)) {
36
+ using.push(namespace);
37
+ }
38
+ }
39
+ const sourceFileCtx = {
40
+ addUsing
41
+ };
42
+ return _$createComponent(core.SourceFile, {
43
+ get path() {
44
+ return props.path;
45
+ },
46
+ filetype: "cs",
47
+ reference: Reference,
48
+ get children() {
49
+ return _$createComponent(SourceFileContext.Provider, {
50
+ value: sourceFileCtx,
51
+ get children() {
52
+ return _$createComponent(core.Scope, {
53
+ get name() {
54
+ return props.path;
55
+ },
56
+ kind: "source-file",
57
+ get children() {
58
+ return [_$memo(() => _$memo(() => using.length > 0)() ? [_$createComponent(UsingDirective, {
59
+ namespaces: using
60
+ }), "\n"] : undefined), "namespace ", _$memo(() => namespaceCtx.name), _$memo(() => !props.children && " {}"), _$memo(() => _$memo(() => !!props.children)() && ["\n{", _$createComponent(_$Indent, {
61
+ get children() {
62
+ return ["\n", _$memo(() => props.children)];
63
+ }
64
+ }), "\n", "}"])];
65
+ }
66
+ });
67
+ }
68
+ });
69
+ }
70
+ });
71
+ }
72
+ //# sourceMappingURL=SourceFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SourceFile.js","names":["core","useNamespace","Reference","UsingDirective","SourceFileContext","createContext","useSourceFile","useContext","SourceFile","props","namespaceCtx","Error","using","reactive","Array","push","addUsing","namespace","includes","sourceFileCtx","_$createComponent","path","filetype","reference","children","Provider","value","Scope","name","kind","_$memo","length","namespaces","undefined","_$Indent"],"sources":["../../../src/components/SourceFile.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,SAASC,YAAY;AACrB,SAASC,SAAS;AAClB,SAASC,cAAc;;AAEvB;;AAMA,MAAMC,iBAAiB,GAAGJ,IAAI,CAACK,aAAa,CAAoB,CAAC;;AAEjE;AACA,OAAO,SAASC,aAAaA,CAAA,EAAkC;EAC7D,OAAON,IAAI,CAACO,UAAU,CAACH,iBAAiB,CAAC;AAC3C;;AAEA;;AAOA;AACA;AACA,OAAO,SAASI,UAAUA,CAACC,KAAsB,EAAE;EACjD,MAAMC,YAAY,GAAGT,YAAY,CAAC,CAAC;EAEnC,IAAI,CAACS,YAAY,EAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,gDAAgD,CAAC;EACnE;EAEA,MAAMC,KAAoB,GAAGZ,IAAI,CAACa,QAAQ,CAAC,IAAIC,KAAK,CAAS,CAAC,CAAC;EAC/D,IAAIL,KAAK,CAACG,KAAK,EAAE;IACfA,KAAK,CAACG,IAAI,CAAC,GAAGN,KAAK,CAACG,KAAK,CAAC;EAC5B;;EAEA;EACA;EACA,SAASI,QAAQA,CAACC,SAAiB,EAAQ;IACzC,IAAI,CAACL,KAAK,CAACM,QAAQ,CAACD,SAAS,CAAC,EAAE;MAC9BL,KAAK,CAACG,IAAI,CAACE,SAAS,CAAC;IACvB;EACF;EAEA,MAAME,aAAgC,GAAG;IACvCH;EACF,CAAC;EAED,OAAAI,iBAAA,CAAQpB,IAAI,CAACQ,UAAU;IAAA,IAACa,IAAIA,CAAA;MAAA,OAAEZ,KAAK,CAACY,IAAI;IAAA;IAAEC,QAAQ;IAAMC,SAAS,EAAErB,SAAS;IAAA,IAAAsB,SAAA;MAAA,OAAAJ,iBAAA,CACvEhB,iBAAiB,CAACqB,QAAQ;QAACC,KAAK,EAAEP,aAAa;QAAA,IAAAK,SAAA;UAAA,OAAAJ,iBAAA,CAC7CpB,IAAI,CAAC2B,KAAK;YAAA,IAACC,IAAIA,CAAA;cAAA,OAAEnB,KAAK,CAACY,IAAI;YAAA;YAAEQ,IAAI;YAAA,IAAAL,SAAA;cAAA,QAAAM,MAAA,OAC/BA,MAAA,OAAAlB,KAAK,CAACmB,MAAM,GAAG,CAAC,OAAAX,iBAAA,CAEZjB,cAAc;gBAAC6B,UAAU,EAAEpB;cAAK,IAAK,IAAI,IAE1CqB,SAAS,iBAAAH,MAAA,OAAYpB,YAAY,CAACkB,IAAI,GAAAE,MAAA,OAAE,CAACrB,KAAK,CAACe,QAAQ,IAAI,KAAK,GAAAM,MAAA,OAAEA,MAAA,SAAArB,KAAK,CAACe,QAAQ,QAE/E,KAAK,EAAAJ,iBAAA,CAAAc,QAAA;gBAAA,IAAAV,SAAA;kBAAA,cAAAM,MAAA,OACHrB,KAAK,CAACe,QAAQ;gBAAA;cAAA,UAChB,GAAG,CACH;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAKf","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export interface UsingDirectiveProps {
2
+ namespaces: Array<string>;
3
+ }
4
+ export declare function UsingDirective(props: UsingDirectiveProps): () => string;
5
+ //# sourceMappingURL=UsingDirective.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UsingDirective.d.ts","sourceRoot":"","sources":["../../../src/components/UsingDirective.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC3B;AAGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,gBAWxD"}
@@ -0,0 +1,13 @@
1
+ import * as core from "@alloy-js/core";
2
+ // one ore more C# using directives
3
+ export function UsingDirective(props) {
4
+ // we need core.memo here so that the contents are in a reactive context.
5
+ // the values for namespaces are reactive thus we need to observe any changes.
6
+ return core.memo(() => {
7
+ props.namespaces.sort();
8
+ return core.mapJoin(props.namespaces, namespace => {
9
+ return `using ${namespace};`;
10
+ }).join("");
11
+ });
12
+ }
13
+ //# sourceMappingURL=UsingDirective.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UsingDirective.js","names":["core","UsingDirective","props","memo","namespaces","sort","mapJoin","namespace","join"],"sources":["../../../src/components/UsingDirective.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AAMtC;AACA,OAAO,SAASC,cAAcA,CAACC,KAA0B,EAAE;EACzD;EACA;EACA,OAAOF,IAAI,CAACG,IAAI,CAAC,MAAM;IACrBD,KAAK,CAACE,UAAU,CAACC,IAAI,CAAC,CAAC;IACvB,OAAOL,IAAI,CACRM,OAAO,CAACJ,KAAK,CAACE,UAAU,EAAGG,SAAS,IAAK;MACxC,OAAO,SAASA,SAAS,GAAG;IAC9B,CAAC,CAAC,CACDC,IAAI,CAAC,EAAE,CAAC;EACb,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ export * from "./Class.js";
2
+ export * from "./Declaration.js";
3
+ export * from "./Enum.js";
4
+ export * from "./Name.js";
5
+ export * from "./Namespace.js";
6
+ export * from "./Parameters.js";
7
+ export * from "./ProjectDirectory.js";
8
+ export * from "./Reference.js";
9
+ export * from "./SourceFile.js";
10
+ export * from "./UsingDirective.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export * from "./Class.js";
2
+ export * from "./Declaration.js";
3
+ export * from "./Enum.js";
4
+ export * from "./Name.js";
5
+ export * from "./Namespace.js";
6
+ export * from "./Parameters.js";
7
+ export * from "./ProjectDirectory.js";
8
+ export * from "./Reference.js";
9
+ export * from "./SourceFile.js";
10
+ export * from "./UsingDirective.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,kBAAkB;AAChC,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB;AACrC,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ import * as core from "@alloy-js/core";
2
+ import * as base from "../index.js";
3
+ export declare const Class: (props: base.ClassProps) => core.ComponentCreator<base.ClassProps> & {
4
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.ClassProps>;
5
+ children(...children: core.Children[]): core.ComponentCreator<base.ClassProps>;
6
+ };
7
+ export declare const ClassConstructor: (props?: base.ClassConstructorProps | undefined) => core.ComponentCreator<base.ClassConstructorProps> & {
8
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.ClassConstructorProps>;
9
+ children(...children: core.Children[]): core.ComponentCreator<base.ClassConstructorProps>;
10
+ };
11
+ export declare const ClassMember: (props: base.ClassMemberProps) => core.ComponentCreator<base.ClassMemberProps> & {
12
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.ClassMemberProps>;
13
+ children(...children: core.Children[]): core.ComponentCreator<base.ClassMemberProps>;
14
+ };
15
+ export declare const ClassMethod: (props: base.ClassMethodProps) => core.ComponentCreator<base.ClassMethodProps> & {
16
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.ClassMethodProps>;
17
+ children(...children: core.Children[]): core.ComponentCreator<base.ClassMethodProps>;
18
+ };
19
+ export declare const Enum: (props: base.EnumProps) => core.ComponentCreator<base.EnumProps> & {
20
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.EnumProps>;
21
+ children(...children: core.Children[]): core.ComponentCreator<base.EnumProps>;
22
+ };
23
+ export declare const EnumMember: (props: base.EnumMemberProps) => core.ComponentCreator<base.EnumMemberProps> & {
24
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.EnumMemberProps>;
25
+ children(...children: core.Children[]): core.ComponentCreator<base.EnumMemberProps>;
26
+ };
27
+ export declare const Parameter: (props: base.ParameterProps) => core.ComponentCreator<base.ParameterProps> & {
28
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.ParameterProps>;
29
+ children(...children: core.Children[]): core.ComponentCreator<base.ParameterProps>;
30
+ };
31
+ export declare const Parameters: (props: base.ParametersProps) => core.ComponentCreator<base.ParametersProps> & {
32
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.ParametersProps>;
33
+ children(...children: core.Children[]): core.ComponentCreator<base.ParametersProps>;
34
+ };
35
+ export declare const ProjectDirectory: (props: base.ProjectDirectoryProps) => core.ComponentCreator<base.ProjectDirectoryProps> & {
36
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.ProjectDirectoryProps>;
37
+ children(...children: core.Children[]): core.ComponentCreator<base.ProjectDirectoryProps>;
38
+ };
39
+ export declare const UsingDirective: (props: base.UsingDirectiveProps) => core.ComponentCreator<base.UsingDirectiveProps> & {
40
+ code(template: TemplateStringsArray, ...substitutions: core.Children[]): core.ComponentCreator<base.UsingDirectiveProps>;
41
+ children(...children: core.Children[]): core.ComponentCreator<base.UsingDirectiveProps>;
42
+ };
43
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/stc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,KAAK;;;CAAuB,CAAC;AAC1C,eAAO,MAAM,gBAAgB;;;CAAkC,CAAC;AAChE,eAAO,MAAM,WAAW;;;CAA6B,CAAC;AACtD,eAAO,MAAM,WAAW;;;CAA6B,CAAC;AACtD,eAAO,MAAM,IAAI;;;CAAsB,CAAC;AACxC,eAAO,MAAM,UAAU;;;CAA4B,CAAC;AACpD,eAAO,MAAM,SAAS;;;CAA2B,CAAC;AAClD,eAAO,MAAM,UAAU;;;CAA4B,CAAC;AACpD,eAAO,MAAM,gBAAgB;;;CAAkC,CAAC;AAChE,eAAO,MAAM,cAAc;;;CAAgC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import * as core from "@alloy-js/core";
2
+ import * as base from "../index.js";
3
+ export const Class = core.stc(base.Class);
4
+ export const ClassConstructor = core.stc(base.ClassConstructor);
5
+ export const ClassMember = core.stc(base.ClassMember);
6
+ export const ClassMethod = core.stc(base.ClassMethod);
7
+ export const Enum = core.stc(base.Enum);
8
+ export const EnumMember = core.stc(base.EnumMember);
9
+ export const Parameter = core.stc(base.Parameter);
10
+ export const Parameters = core.stc(base.Parameters);
11
+ export const ProjectDirectory = core.stc(base.ProjectDirectory);
12
+ export const UsingDirective = core.stc(base.UsingDirective);
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["core","base","Class","stc","ClassConstructor","ClassMember","ClassMethod","Enum","EnumMember","Parameter","Parameters","ProjectDirectory","UsingDirective"],"sources":["../../../../src/components/stc/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,IAAI,MAAM,aAAa;AAEnC,OAAO,MAAMC,KAAK,GAAGF,IAAI,CAACG,GAAG,CAACF,IAAI,CAACC,KAAK,CAAC;AACzC,OAAO,MAAME,gBAAgB,GAAGJ,IAAI,CAACG,GAAG,CAACF,IAAI,CAACG,gBAAgB,CAAC;AAC/D,OAAO,MAAMC,WAAW,GAAGL,IAAI,CAACG,GAAG,CAACF,IAAI,CAACI,WAAW,CAAC;AACrD,OAAO,MAAMC,WAAW,GAAGN,IAAI,CAACG,GAAG,CAACF,IAAI,CAACK,WAAW,CAAC;AACrD,OAAO,MAAMC,IAAI,GAAGP,IAAI,CAACG,GAAG,CAACF,IAAI,CAACM,IAAI,CAAC;AACvC,OAAO,MAAMC,UAAU,GAAGR,IAAI,CAACG,GAAG,CAACF,IAAI,CAACO,UAAU,CAAC;AACnD,OAAO,MAAMC,SAAS,GAAGT,IAAI,CAACG,GAAG,CAACF,IAAI,CAACQ,SAAS,CAAC;AACjD,OAAO,MAAMC,UAAU,GAAGV,IAAI,CAACG,GAAG,CAACF,IAAI,CAACS,UAAU,CAAC;AACnD,OAAO,MAAMC,gBAAgB,GAAGX,IAAI,CAACG,GAAG,CAACF,IAAI,CAACU,gBAAgB,CAAC;AAC/D,OAAO,MAAMC,cAAc,GAAGZ,IAAI,CAACG,GAAG,CAACF,IAAI,CAACW,cAAc,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export * from "./components/index.js";
2
+ export * from "./modifiers.js";
3
+ export * from "./name-policy.js";
4
+ export * from "./symbols/index.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./components/index.js";
2
+ export * from "./modifiers.js";
3
+ export * from "./name-policy.js";
4
+ export * from "./symbols/index.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,oBAAoB","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export type AccessModifier = "public" | "protected" | "private" | "internal" | "protected-internal" | "private-protected" | "file";
2
+ export declare function getAccessModifier(accessModifier?: AccessModifier): string;
3
+ export type MethodModifier = "abstract" | "sealed" | "static" | "virtual";
4
+ export declare function getMethodModifier(methodModifier?: MethodModifier): string;
5
+ //# sourceMappingURL=modifiers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../src/modifiers.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,WAAW,GACX,SAAS,GACT,UAAU,GACV,oBAAoB,GACpB,mBAAmB,GACnB,MAAM,CAAC;AAgBX,wBAAgB,iBAAiB,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAEzE;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAa1E,wBAAgB,iBAAiB,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAEzE"}
@@ -0,0 +1,35 @@
1
+ // the possible C# access modifiers
2
+ // https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers
3
+
4
+ // maps the above access modifier value to its C# syntax.
5
+ // note that the C# keyword includes a trailing space
6
+ const accessModifierLookup = {
7
+ public: "public ",
8
+ protected: "protected ",
9
+ private: "private ",
10
+ internal: "internal ",
11
+ "protected-internal": "protected internal ",
12
+ "private-protected": "private protected ",
13
+ file: "file "
14
+ };
15
+
16
+ // returns the C# syntax for the specified access modifier.
17
+ // if no access modifier is specified, the empty string is returned.
18
+ export function getAccessModifier(accessModifier) {
19
+ return accessModifier ? accessModifierLookup[accessModifier] : "";
20
+ }
21
+ // maps the above method modifier value to its C# syntax.
22
+ // note that the C# keyword includes a trailing space
23
+ const methodModifierLookup = {
24
+ abstract: "abstract ",
25
+ sealed: "sealed ",
26
+ static: "static ",
27
+ virtual: "virtual "
28
+ };
29
+
30
+ // returns the C# syntax for the specified method modifier.
31
+ // if no method modifier is specified, the empty string is returned.
32
+ export function getMethodModifier(methodModifier) {
33
+ return methodModifier ? methodModifierLookup[methodModifier] : "";
34
+ }
35
+ //# sourceMappingURL=modifiers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modifiers.js","names":["accessModifierLookup","public","protected","private","internal","file","getAccessModifier","accessModifier","methodModifierLookup","abstract","sealed","static","virtual","getMethodModifier","methodModifier"],"sources":["../../src/modifiers.ts"],"sourcesContent":[null],"mappings":"AAAA;AACA;;AAUA;AACA;AACA,MAAMA,oBAAoD,GAAG;EAC3DC,MAAM,EAAE,SAAS;EACjBC,SAAS,EAAE,YAAY;EACvBC,OAAO,EAAE,UAAU;EACnBC,QAAQ,EAAE,WAAW;EACrB,oBAAoB,EAAE,qBAAqB;EAC3C,mBAAmB,EAAE,oBAAoB;EACzCC,IAAI,EAAE;AACR,CAAC;;AAED;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACC,cAA+B,EAAU;EACzE,OAAOA,cAAc,GAAGP,oBAAoB,CAACO,cAAc,CAAC,GAAG,EAAE;AACnE;AAIA;AACA;AACA,MAAMC,oBAAoD,GAAG;EAC3DC,QAAQ,EAAE,WAAW;EACrBC,MAAM,EAAE,SAAS;EACjBC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACC,cAA+B,EAAU;EACzE,OAAOA,cAAc,GAAGN,oBAAoB,CAACM,cAAc,CAAC,GAAG,EAAE;AACnE","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import * as core from "@alloy-js/core";
2
+ export type CSharpElements = "class" | "constant" | "enum" | "enum-member" | "function" | "interface" | "class-member-private" | "class-member-public" | "class-method" | "parameter" | "type-parameter";
3
+ export declare function createCSharpNamePolicy(): core.NamePolicy<CSharpElements>;
4
+ export declare function useCSharpNamePolicy(): core.NamePolicy<CSharpElements>;
5
+ //# sourceMappingURL=name-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"name-policy.d.ts","sourceRoot":"","sources":["../../src/name-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAIvC,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,UAAU,GACV,MAAM,GACN,aAAa,GACb,UAAU,GACV,WAAW,GACX,sBAAsB,GACtB,qBAAqB,GACrB,cAAc,GACd,WAAW,GACX,gBAAgB,CAAC;AAGrB,wBAAgB,sBAAsB,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAiBxE;AAGD,wBAAgB,mBAAmB,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAErE"}
@@ -0,0 +1,30 @@
1
+ import * as core from "@alloy-js/core";
2
+ import * as changecase from "change-case";
3
+
4
+ // the context in which the name policy should be applied
5
+
6
+ // creates the C# naming policy
7
+ export function createCSharpNamePolicy() {
8
+ return core.createNamePolicy((name, element) => {
9
+ switch (element) {
10
+ case "class":
11
+ case "enum":
12
+ case "enum-member":
13
+ case "interface":
14
+ case "class-member-public":
15
+ case "class-method":
16
+ case "type-parameter":
17
+ return changecase.pascalCase(name);
18
+ case "constant":
19
+ return changecase.constantCase(name);
20
+ default:
21
+ return changecase.camelCase(name);
22
+ }
23
+ });
24
+ }
25
+
26
+ // gets the active C# naming policy
27
+ export function useCSharpNamePolicy() {
28
+ return core.useNamePolicy();
29
+ }
30
+ //# sourceMappingURL=name-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"name-policy.js","names":["core","changecase","createCSharpNamePolicy","createNamePolicy","name","element","pascalCase","constantCase","camelCase","useCSharpNamePolicy","useNamePolicy"],"sources":["../../src/name-policy.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,UAAU,MAAM,aAAa;;AAEzC;;AAcA;AACA,OAAO,SAASC,sBAAsBA,CAAA,EAAoC;EACxE,OAAOF,IAAI,CAACG,gBAAgB,CAAC,CAACC,IAAI,EAAEC,OAAO,KAAK;IAC9C,QAAQA,OAAO;MACb,KAAK,OAAO;MACZ,KAAK,MAAM;MACX,KAAK,aAAa;MAClB,KAAK,WAAW;MAChB,KAAK,qBAAqB;MAC1B,KAAK,cAAc;MACnB,KAAK,gBAAgB;QACnB,OAAOJ,UAAU,CAACK,UAAU,CAACF,IAAI,CAAC;MACpC,KAAK,UAAU;QACb,OAAOH,UAAU,CAACM,YAAY,CAACH,IAAI,CAAC;MACtC;QACE,OAAOH,UAAU,CAACO,SAAS,CAACJ,IAAI,CAAC;IACrC;EACF,CAAC,CAAC;AACJ;;AAEA;AACA,OAAO,SAASK,mBAAmBA,CAAA,EAAoC;EACrE,OAAOT,IAAI,CAACU,aAAa,CAAC,CAAC;AAC7B","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import * as core from "@alloy-js/core";
2
+ import { CSharpOutputScope } from "./scopes.js";
3
+ export interface CSharpOutputSymbol extends core.OutputSymbol {
4
+ scope: CSharpOutputScope;
5
+ }
6
+ export declare function createCSharpSymbol(props: core.DeclarationProps): CSharpOutputSymbol;
7
+ //# sourceMappingURL=csharp-output-symbol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csharp-output-symbol.d.ts","sourceRoot":"","sources":["../../../src/symbols/csharp-output-symbol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,YAAY;IAC3D,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAGD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,sBAe9D"}
@@ -0,0 +1,20 @@
1
+ import * as core from "@alloy-js/core";
2
+ import { useNamespace } from "../components/Namespace.js";
3
+
4
+ // represents a symbol from a .cs file. Class, enum, interface etc.
5
+
6
+ // creates a new C# symbol
7
+ export function createCSharpSymbol(props) {
8
+ const scope = core.useScope();
9
+ const namespaceCtx = useNamespace();
10
+ if (!namespaceCtx) {
11
+ throw new Error("symbol must be declared inside a namespace");
12
+ }
13
+ const sym = scope.binder.createSymbol({
14
+ name: props.name,
15
+ scope,
16
+ refkey: props.refkey ?? core.refkey(props.name)
17
+ });
18
+ return sym;
19
+ }
20
+ //# sourceMappingURL=csharp-output-symbol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csharp-output-symbol.js","names":["core","useNamespace","createCSharpSymbol","props","scope","useScope","namespaceCtx","Error","sym","binder","createSymbol","name","refkey"],"sources":["../../../src/symbols/csharp-output-symbol.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,SAASC,YAAY;;AAGrB;;AAKA;AACA,OAAO,SAASC,kBAAkBA,CAACC,KAA4B,EAAE;EAC/D,MAAMC,KAAK,GAAGJ,IAAI,CAACK,QAAQ,CAAC,CAAsB;EAElD,MAAMC,YAAY,GAAGL,YAAY,CAAC,CAAC;EACnC,IAAI,CAACK,YAAY,EAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EAEA,MAAMC,GAAG,GAAGJ,KAAK,CAACK,MAAM,CAACC,YAAY,CAAqB;IACxDC,IAAI,EAAER,KAAK,CAACQ,IAAK;IACjBP,KAAK;IACLQ,MAAM,EAAET,KAAK,CAACS,MAAM,IAAIZ,IAAI,CAACY,MAAM,CAACT,KAAK,CAACQ,IAAI;EAChD,CAAC,CAAC;EAEF,OAAOH,GAAG;AACZ","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ export * from "./csharp-output-symbol.js";
2
+ export * from "./reference.js";
3
+ export * from "./scopes.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/symbols/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./csharp-output-symbol.js";
2
+ export * from "./reference.js";
3
+ export * from "./scopes.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/symbols/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,2BAA2B;AACzC,cAAc,gBAAgB;AAC9B,cAAc,aAAa","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import * as core from "@alloy-js/core";
2
+ export declare function ref(refkey: core.Refkey): () => string;
3
+ //# sourceMappingURL=reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/symbols/reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAoBvC,wBAAgB,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,MAAM,MAAM,CA4CrD"}
@@ -0,0 +1,55 @@
1
+ import * as core from "@alloy-js/core";
2
+ import { useNamespace } from "../components/Namespace.js";
3
+ import { useSourceFile } from "../components/SourceFile.js";
4
+
5
+ // when resolving references across source files, the last element
6
+ // in pathDown will be the containing source file. we only need this
7
+ // here so we can find and remove this scope as it's not useful
8
+ // when building the reference
9
+
10
+ // converts a refkey to its fully qualified name
11
+ // e.g. if refkey is for bar in enum type foo, and
12
+ // foo is in the same namespace as the refkey, then
13
+ // the result would be foo.bar.
14
+ export function ref(refkey) {
15
+ const targetNamespaceCtx = useNamespace();
16
+ const resolveResult = core.resolve(refkey);
17
+ return core.memo(() => {
18
+ if (resolveResult.value === undefined) {
19
+ return "<Unresolved Symbol>";
20
+ }
21
+
22
+ // targetDeclaration is the symbol with the refkey
23
+ // pathDown is an array of scopes to that symbol and can be empty.
24
+ // the entries are top-down, so namespace, source-file, member
25
+ // - referencing a type within the same namespace will have an empty path
26
+ // - referencing a member (e.g. enum value) within the same namespace will
27
+ // have a single path entry that contains the owning type
28
+ // - referencing a type within the same namespace but in a different source
29
+ // file will have at least a source-file entry
30
+ // - referencing a symbol outside the current namespace will have at least
31
+ // two entries, namespace, source-file
32
+ const {
33
+ targetDeclaration,
34
+ pathDown
35
+ } = resolveResult.value;
36
+ const sourceNamespace = pathDown.find(v => {
37
+ return v.kind === "namespace";
38
+ });
39
+ if (sourceNamespace && sourceNamespace.name !== targetNamespaceCtx.name) {
40
+ // the source symbol is in a different namespace that the target refkey.
41
+ // add the applicable using statement to the target's source file.
42
+ const targetSrc = useSourceFile();
43
+ targetSrc.addUsing(sourceNamespace.name);
44
+ }
45
+
46
+ // we only need to build the fully-qualified name for members
47
+ // TODO: possibly a subset of members
48
+ const syms = pathDown.filter(v => {
49
+ return v.kind === "member";
50
+ }).map(s => s.owner);
51
+ syms.push(targetDeclaration);
52
+ return syms.map(sym => sym.name).join(".");
53
+ });
54
+ }
55
+ //# sourceMappingURL=reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference.js","names":["core","useNamespace","useSourceFile","ref","refkey","targetNamespaceCtx","resolveResult","resolve","memo","value","undefined","targetDeclaration","pathDown","sourceNamespace","find","v","kind","name","targetSrc","addUsing","syms","filter","map","s","owner","push","sym","join"],"sources":["../../../src/symbols/reference.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,SAASC,YAAY;AACrB,SAASC,aAAa;;AAItB;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,OAAO,SAASC,GAAGA,CAACC,MAAmB,EAAgB;EACrD,MAAMC,kBAAkB,GAAGJ,YAAY,CAAC,CAAC;EACzC,MAAMK,aAAa,GAAGN,IAAI,CAACO,OAAO,CAChCH,MACF,CAAC;EAED,OAAOJ,IAAI,CAACQ,IAAI,CAAC,MAAM;IACrB,IAAIF,aAAa,CAACG,KAAK,KAAKC,SAAS,EAAE;MACrC,OAAO,qBAAqB;IAC9B;;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAM;MAAEC,iBAAiB;MAAEC;IAAS,CAAC,GAAGN,aAAa,CAACG,KAAK;IAE3D,MAAMI,eAAe,GAAGD,QAAQ,CAACE,IAAI,CAAEC,CAAC,IAAK;MAC3C,OAAOA,CAAC,CAACC,IAAI,KAAK,WAAW;IAC/B,CAAC,CAAC;IACF,IAAIH,eAAe,IAAIA,eAAe,CAACI,IAAI,KAAKZ,kBAAkB,CAAEY,IAAI,EAAE;MACxE;MACA;MACA,MAAMC,SAAS,GAAGhB,aAAa,CAAC,CAAC;MACjCgB,SAAS,CAAEC,QAAQ,CAACN,eAAe,CAACI,IAAI,CAAC;IAC3C;;IAEA;IACA;IACA,MAAMG,IAAI,GAAIR,QAAQ,CACnBS,MAAM,CAAEN,CAAC,IAAK;MACb,OAAOA,CAAC,CAACC,IAAI,KAAK,QAAQ;IAC5B,CAAC,CAAC,CACDM,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,KAAK,CAAC;IACtBJ,IAAI,CAACK,IAAI,CAACd,iBAAiB,CAAC;IAE5B,OAAOS,IAAI,CAACE,GAAG,CAAEI,GAAG,IAAKA,GAAG,CAACT,IAAI,CAAC,CAACU,IAAI,CAAC,GAAG,CAAC;EAC9C,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ import * as core from "@alloy-js/core";
2
+ import { CSharpOutputSymbol } from "./csharp-output-symbol.js";
3
+ export interface CSharpNamespaceScope extends core.OutputScope {
4
+ kind: "namespace";
5
+ }
6
+ export declare function createCSharpNamespaceScope(binder: core.Binder, parent: core.OutputScope | undefined, name: string): CSharpNamespaceScope;
7
+ export type CSharpMemberScopeName = "class-decl" | "constructor-decl" | "enum-decl" | "method-decl";
8
+ export interface CSharpMemberScope extends core.OutputScope {
9
+ kind: "member";
10
+ name: CSharpMemberScopeName;
11
+ owner: CSharpOutputSymbol;
12
+ }
13
+ export declare function createCSharpMemberScope(binder: core.Binder, parent: core.OutputScope, owner: CSharpOutputSymbol, name: CSharpMemberScopeName): CSharpMemberScope;
14
+ export type CSharpOutputScope = CSharpMemberScope | CSharpNamespaceScope;
15
+ export declare function useCSharpScope(): CSharpOutputScope;
16
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../../src/symbols/scopes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,WAAW;IAC5D,IAAI,EAAE,WAAW,CAAC;CACnB;AAGD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,MAAM,EAAE,IAAI,CAAC,WAAW,GAAG,SAAS,EACpC,IAAI,EAAE,MAAM,GACX,oBAAoB,CAMtB;AAGD,MAAM,MAAM,qBAAqB,GAC7B,YAAY,GACZ,kBAAkB,GAClB,WAAW,GACX,aAAa,CAAC;AAKlB,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW;IACzD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAID,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,MAAM,EAAE,IAAI,CAAC,WAAW,EACxB,KAAK,EAAE,kBAAkB,EACzB,IAAI,EAAE,qBAAqB,GAC1B,iBAAiB,CAOnB;AAGD,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAGzE,wBAAgB,cAAc,IAAI,iBAAiB,CAElD"}
@@ -0,0 +1,37 @@
1
+ import * as core from "@alloy-js/core";
2
+
3
+ // indicates that the scope for a symbols is at the namespace level
4
+
5
+ // creates a new namespace scope
6
+ export function createCSharpNamespaceScope(binder, parent, name) {
7
+ return binder.createScope({
8
+ kind: "namespace",
9
+ name,
10
+ parent
11
+ });
12
+ }
13
+
14
+ // the kind of member scope. i.e. are we in an enum, class, etc
15
+
16
+ // indicates that the scope for a symbol resides within a type
17
+ // e.g. for an enum value, class field etc, these would have
18
+ // member scope where the owner is the containing type.
19
+
20
+ // creates a new member scope.
21
+ // parent is the owning symbol.
22
+ export function createCSharpMemberScope(binder, parent, owner, name) {
23
+ return binder.createScope({
24
+ kind: "member",
25
+ name: name,
26
+ owner,
27
+ parent
28
+ });
29
+ }
30
+
31
+ // contains the possible scopes where a declaration can reside
32
+
33
+ // returns the current C# scope
34
+ export function useCSharpScope() {
35
+ return core.useScope();
36
+ }
37
+ //# sourceMappingURL=scopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.js","names":["core","createCSharpNamespaceScope","binder","parent","name","createScope","kind","createCSharpMemberScope","owner","useCSharpScope","useScope"],"sources":["../../../src/symbols/scopes.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;;AAGtC;;AAKA;AACA,OAAO,SAASC,0BAA0BA,CACxCC,MAAmB,EACnBC,MAAoC,EACpCC,IAAY,EACU;EACtB,OAAOF,MAAM,CAACG,WAAW,CAAuB;IAC9CC,IAAI,EAAE,WAAW;IACjBF,IAAI;IACJD;EACF,CAAC,CAAC;AACJ;;AAEA;;AAOA;AACA;AACA;;AAOA;AACA;AACA,OAAO,SAASI,uBAAuBA,CACrCL,MAAmB,EACnBC,MAAwB,EACxBK,KAAyB,EACzBJ,IAA2B,EACR;EACnB,OAAOF,MAAM,CAACG,WAAW,CAAoB;IAC3CC,IAAI,EAAE,QAAQ;IACdF,IAAI,EAAEA,IAAI;IACVI,KAAK;IACLL;EACF,CAAC,CAAC;AACJ;;AAEA;;AAGA;AACA,OAAO,SAASM,cAAcA,CAAA,EAAsB;EAClD,OAAOT,IAAI,CAACU,QAAQ,CAAC,CAAC;AACxB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=class.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class.test.d.ts","sourceRoot":"","sources":["../../test/class.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=enum.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum.test.d.ts","sourceRoot":"","sources":["../../test/enum.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=namespace.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.test.d.ts","sourceRoot":"","sources":["../../test/namespace.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=projectdirectory.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectdirectory.test.d.ts","sourceRoot":"","sources":["../../test/projectdirectory.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sourcefile.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourcefile.test.d.ts","sourceRoot":"","sources":["../../test/sourcefile.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=using.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"using.test.d.ts","sourceRoot":"","sources":["../../test/using.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import * as core from "@alloy-js/core";
2
+ export declare function toSourceText(c: core.Children): string;
3
+ export declare function testRender(c: core.Children): core.OutputDirectory;
4
+ export declare function findFile(res: core.OutputDirectory, path: string): core.OutputFile;
5
+ export declare function assertFileContents(res: core.OutputDirectory, expectedFiles: Record<string, string>): void;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../test/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAKvC,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAWrD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAQjE;AAED,wBAAgB,QAAQ,CACtB,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,IAAI,EAAE,MAAM,GACX,IAAI,CAAC,UAAU,CA2BjB;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,IAAI,CAKN"}