@powerlines/plugin-alloy 0.21.3 → 0.21.4

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 (87) hide show
  1. package/dist/core/components/output.d.cts +2 -2
  2. package/dist/core/components/output.d.mts +2 -2
  3. package/dist/core/components/single-line-comment.d.cts +2 -2
  4. package/dist/core/components/single-line-comment.d.mts +2 -2
  5. package/dist/core/components/source-file.d.cts +2 -2
  6. package/dist/core/contexts/reflection.d.cts.map +1 -1
  7. package/dist/helpers/index.cjs +1 -1
  8. package/dist/helpers/index.d.cts +2 -2
  9. package/dist/helpers/index.d.mts +2 -2
  10. package/dist/helpers/index.mjs +2 -2
  11. package/dist/helpers/typescript.cjs +2 -2
  12. package/dist/helpers/typescript.d.cts +6 -6
  13. package/dist/helpers/typescript.d.cts.map +1 -1
  14. package/dist/helpers/typescript.d.mts +6 -6
  15. package/dist/helpers/typescript.d.mts.map +1 -1
  16. package/dist/helpers/typescript.mjs +2 -2
  17. package/dist/helpers/typescript.mjs.map +1 -1
  18. package/dist/markdown/components/front-matter.d.cts +2 -2
  19. package/dist/markdown/components/front-matter.d.mts +2 -2
  20. package/dist/markdown/components/markdown-file.d.mts +3 -3
  21. package/dist/markdown/components/markdown-table.d.cts +4 -4
  22. package/dist/typescript/components/builtin-file.d.cts +2 -2
  23. package/dist/typescript/components/builtin-file.d.mts +2 -2
  24. package/dist/typescript/components/class-declaration.cjs +40 -9
  25. package/dist/typescript/components/class-declaration.d.cts +31 -0
  26. package/dist/typescript/components/class-declaration.d.cts.map +1 -1
  27. package/dist/typescript/components/class-declaration.d.mts +31 -0
  28. package/dist/typescript/components/class-declaration.d.mts.map +1 -1
  29. package/dist/typescript/components/class-declaration.mjs +41 -10
  30. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  31. package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
  32. package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
  33. package/dist/typescript/components/entry-file.d.cts +2 -2
  34. package/dist/typescript/components/entry-file.d.mts +2 -2
  35. package/dist/typescript/components/index.cjs +12 -10
  36. package/dist/typescript/components/index.d.cts +4 -4
  37. package/dist/typescript/components/index.d.mts +4 -4
  38. package/dist/typescript/components/index.mjs +5 -5
  39. package/dist/typescript/components/interface-declaration.cjs +225 -0
  40. package/dist/typescript/components/interface-declaration.d.cts +82 -0
  41. package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
  42. package/dist/typescript/components/interface-declaration.d.mts +82 -0
  43. package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
  44. package/dist/typescript/components/interface-declaration.mjs +222 -0
  45. package/dist/typescript/components/interface-declaration.mjs.map +1 -0
  46. package/dist/typescript/components/{typescript-object.cjs → object-declaration.cjs} +6 -6
  47. package/dist/typescript/components/object-declaration.d.cts +30 -0
  48. package/dist/typescript/components/object-declaration.d.cts.map +1 -0
  49. package/dist/typescript/components/object-declaration.d.mts +30 -0
  50. package/dist/typescript/components/object-declaration.d.mts.map +1 -0
  51. package/dist/typescript/components/{typescript-object.mjs → object-declaration.mjs} +6 -6
  52. package/dist/typescript/components/object-declaration.mjs.map +1 -0
  53. package/dist/typescript/components/{typescript-property-name.cjs → property-name.cjs} +3 -3
  54. package/dist/typescript/components/{typescript-property-name.d.mts → property-name.d.cts} +6 -6
  55. package/dist/typescript/components/property-name.d.cts.map +1 -0
  56. package/dist/typescript/components/{typescript-property-name.d.cts → property-name.d.mts} +7 -7
  57. package/dist/typescript/components/property-name.d.mts.map +1 -0
  58. package/dist/typescript/components/{typescript-property-name.mjs → property-name.mjs} +4 -4
  59. package/dist/typescript/components/property-name.mjs.map +1 -0
  60. package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
  61. package/dist/typescript/components/tsdoc-reflection.d.mts +4 -4
  62. package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -1
  63. package/dist/typescript/components/tsdoc.cjs +1 -1
  64. package/dist/typescript/components/tsdoc.mjs +1 -1
  65. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  66. package/dist/typescript/contexts/lexical-scope.d.cts +2 -2
  67. package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -1
  68. package/dist/typescript/index.cjs +11 -9
  69. package/dist/typescript/index.d.cts +4 -4
  70. package/dist/typescript/index.d.mts +4 -4
  71. package/dist/typescript/index.mjs +5 -5
  72. package/package.json +44 -44
  73. package/dist/typescript/components/typescript-interface.cjs +0 -73
  74. package/dist/typescript/components/typescript-interface.d.cts +0 -26
  75. package/dist/typescript/components/typescript-interface.d.cts.map +0 -1
  76. package/dist/typescript/components/typescript-interface.d.mts +0 -26
  77. package/dist/typescript/components/typescript-interface.d.mts.map +0 -1
  78. package/dist/typescript/components/typescript-interface.mjs +0 -72
  79. package/dist/typescript/components/typescript-interface.mjs.map +0 -1
  80. package/dist/typescript/components/typescript-object.d.cts +0 -30
  81. package/dist/typescript/components/typescript-object.d.cts.map +0 -1
  82. package/dist/typescript/components/typescript-object.d.mts +0 -30
  83. package/dist/typescript/components/typescript-object.d.mts.map +0 -1
  84. package/dist/typescript/components/typescript-object.mjs.map +0 -1
  85. package/dist/typescript/components/typescript-property-name.d.cts.map +0 -1
  86. package/dist/typescript/components/typescript-property-name.d.mts.map +0 -1
  87. package/dist/typescript/components/typescript-property-name.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { MetaItem } from "../contexts/meta.cjs";
2
2
  import "../contexts/index.cjs";
3
- import * as _alloy_js_core3 from "@alloy-js/core";
3
+ import * as _alloy_js_core7 from "@alloy-js/core";
4
4
  import { OutputProps as OutputProps$1 } from "@alloy-js/core";
5
5
  import { PluginContext } from "powerlines/types/context";
6
6
 
@@ -18,7 +18,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext> extends Om
18
18
  /**
19
19
  * Output component for rendering the Powerlines plugin's output files via templates.
20
20
  */
21
- declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core3.Children;
21
+ declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core7.Children;
22
22
  declare type __ΩOutputProps = any[];
23
23
  //#endregion
24
24
  export { Output, OutputProps, __ΩOutputProps };
@@ -1,6 +1,6 @@
1
1
  import { MetaItem } from "../contexts/meta.mjs";
2
2
  import "../contexts/index.mjs";
3
- import * as _alloy_js_core0 from "@alloy-js/core";
3
+ import * as _alloy_js_core1 from "@alloy-js/core";
4
4
  import { OutputProps as OutputProps$1 } from "@alloy-js/core";
5
5
  import { PluginContext } from "powerlines/types/context";
6
6
 
@@ -18,7 +18,7 @@ interface OutputProps<TContext extends PluginContext = PluginContext> extends Om
18
18
  /**
19
19
  * Output component for rendering the Powerlines plugin's output files via templates.
20
20
  */
21
- declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core0.Children;
21
+ declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core1.Children;
22
22
  declare type __ΩOutputProps = any[];
23
23
  //#endregion
24
24
  export { Output, OutputProps, __ΩOutputProps };
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from "../../types/components.cjs";
2
- import * as _alloy_js_core6 from "@alloy-js/core";
2
+ import * as _alloy_js_core8 from "@alloy-js/core";
3
3
 
4
4
  //#region src/core/components/single-line-comment.d.ts
5
5
  type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown";
@@ -15,7 +15,7 @@ interface SingleLineCommentProps extends ComponentProps {
15
15
  * A single line comment block. The children are rendered as a prose element, which means that they
16
16
  * are broken into multiple lines
17
17
  */
18
- declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core6.Children;
18
+ declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core8.Children;
19
19
  declare type __ΩSingleLineCommentVariant = any[];
20
20
  declare type __ΩSingleLineCommentProps = any[];
21
21
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from "../../types/components.mjs";
2
- import * as _alloy_js_core1 from "@alloy-js/core";
2
+ import * as _alloy_js_core0 from "@alloy-js/core";
3
3
 
4
4
  //#region src/core/components/single-line-comment.d.ts
5
5
  type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown";
@@ -15,7 +15,7 @@ interface SingleLineCommentProps extends ComponentProps {
15
15
  * A single line comment block. The children are rendered as a prose element, which means that they
16
16
  * are broken into multiple lines
17
17
  */
18
- declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core1.Children;
18
+ declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core0.Children;
19
19
  declare type __ΩSingleLineCommentVariant = any[];
20
20
  declare type __ΩSingleLineCommentProps = any[];
21
21
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from "../../types/components.cjs";
2
- import * as _alloy_js_core0 from "@alloy-js/core";
2
+ import * as _alloy_js_core6 from "@alloy-js/core";
3
3
  import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
4
4
  import { StoragePreset } from "powerlines/types/fs";
5
5
 
@@ -26,7 +26,7 @@ type SourceFileProps = SourceFileProps$1 & ComponentProps & {
26
26
  * @param props - The properties for the source file.
27
27
  * @returns The rendered source file component.
28
28
  */
29
- declare function SourceFile(props: SourceFileProps): _alloy_js_core0.Children;
29
+ declare function SourceFile(props: SourceFileProps): _alloy_js_core6.Children;
30
30
  declare type __ΩSourceFileProps = any[];
31
31
  //#endregion
32
32
  export { SourceFile, SourceFileProps, __ΩSourceFileProps };
@@ -1 +1 @@
1
- {"version":3,"file":"reflection.d.cts","names":[],"sources":["../../../src/core/contexts/reflection.ts"],"sourcesContent":[],"mappings":";;;;;UA4BiB,0CACL,sBAAsB;cAEpB,gBAAgB;EAHb,QAAA,CAAA,EAIJ,2BAJmC,CAIP,CAJO,CAAA;;;;;AAIP,cAM5B,sBAN4B,EAMJ,gBANI,CAOvC,+BAPuC,CAAA,GAAA,CAAA,CAAA;;;AAMzC;AASA;;AACkC,iBADlB,kBACkB,CAAA,UAAtB,MAAsB,CAAA,MAAA,EAAA,GAAA,CAAA,GAAA,MAAA,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,EAAmB,+BAAnB,CAAmB,CAAnB,CAAA;;;;AAkBrB,cAAA,yBAA4C,EAAjB,gBAAiB,CAAA,kBAAD,CAAA;AAQxD;AAeA;AAQA;AAeA;AAQA;iBA9CgB,qBAAA,CAAA,GAAqB;;;;cAexB,yBAAyB,iBAAiB;;;;;;iBAQvC,mBAAA,CAAA,GAAmB;;;;cAetB,4BAA4B,iBAAiB;;;;;;iBAQ1C,sBAAA,CAAA,GAAsB"}
1
+ {"version":3,"file":"reflection.d.cts","names":[],"sources":["../../../src/core/contexts/reflection.ts"],"sourcesContent":[],"mappings":";;;;;UA4BiB,0CACL,sBAAsB;cAEpB,gBAAgB;EAHb,QAAA,CAAA,EAIJ,2BAJmC,CAIP,CAJO,CAAA;;;;;AAIP,cAM5B,sBAN4B,EAMJ,gBANI,CAOvC,+BAPuC,CAAA,GAAA,CAAA,CAAA;;;AAMzC;AASA;;AACkC,iBADlB,kBACkB,CAAA,UAAtB,MAAsB,CAAA,MAAA,EAAA,GAAA,CAAA,GAAA,MAAA,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,EAAmB,+BAAnB,CAAmB,CAAnB,CAAA;;;;AAkBrB,cAAA,yBAA4C,EAAjB,gBAAA,CAAiB,kBAAD,CAAA;AAQxD;AAeA;AAQA;AAeA;AAQA;iBA9CgB,qBAAA,CAAA,GAAqB;;;;cAexB,yBAAyB,iBAAiB;;;;;;iBAQvC,mBAAA,CAAA,GAAmB;;;;cAetB,4BAA4B,iBAAiB;;;;;;iBAQ1C,sBAAA,CAAA,GAAsB"}
@@ -14,7 +14,7 @@ exports.generateCapnpMethodSchema = require_helpers_capnp.generateCapnpMethodSch
14
14
  exports.generateCapnpPrimitive = require_helpers_capnp.generateCapnpPrimitive;
15
15
  exports.generateCapnpSchema = require_helpers_capnp.generateCapnpSchema;
16
16
  exports.generateCapnpStruct = require_helpers_capnp.generateCapnpStruct;
17
- exports.generateTypeScriptObject = require_helpers_typescript.generateTypeScriptObject;
17
+ exports.generateObjectDeclaration = require_helpers_typescript.generateObjectDeclaration;
18
18
  exports.getCapnpEnumTypes = require_helpers_capnp.getCapnpEnumTypes;
19
19
  exports.getCapnpUnionTypes = require_helpers_capnp.getCapnpUnionTypes;
20
20
  exports.isCapnpStringUnion = require_helpers_capnp.isCapnpStringUnion;
@@ -1,5 +1,5 @@
1
1
  import { GenerateCapnpOptions, GenerateCapnpStructOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩIOType, __ΩStdioOptions, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue } from "./capnp.cjs";
2
2
  import { CreateBuiltinOptions, __ΩCreateBuiltinOptions, createBuiltin } from "./create-builtin.cjs";
3
3
  import { refkey } from "./refkey.cjs";
4
- import { GenerateTypeScriptInterfaceOptions, GenerateTypeScriptObjectOptions, __ΩGenerateTypeScriptInterfaceOptions, __ΩGenerateTypeScriptObjectOptions, generateTypeScriptObject } from "./typescript.cjs";
5
- export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions, GenerateTypeScriptInterfaceOptions, GenerateTypeScriptObjectOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩCreateBuiltinOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩGenerateTypeScriptInterfaceOptions, __ΩGenerateTypeScriptObjectOptions, __ΩIOType, __ΩStdioOptions, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateTypeScriptObject, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
4
+ import { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration } from "./typescript.cjs";
5
+ export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions, GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩCreateBuiltinOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, __ΩIOType, __ΩStdioOptions, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateObjectDeclaration, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
@@ -1,5 +1,5 @@
1
1
  import { GenerateCapnpOptions, GenerateCapnpStructOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩIOType, __ΩStdioOptions, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue } from "./capnp.mjs";
2
2
  import { CreateBuiltinOptions, __ΩCreateBuiltinOptions, createBuiltin } from "./create-builtin.mjs";
3
3
  import { refkey } from "./refkey.mjs";
4
- import { GenerateTypeScriptInterfaceOptions, GenerateTypeScriptObjectOptions, __ΩGenerateTypeScriptInterfaceOptions, __ΩGenerateTypeScriptObjectOptions, generateTypeScriptObject } from "./typescript.mjs";
5
- export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions, GenerateTypeScriptInterfaceOptions, GenerateTypeScriptObjectOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩCreateBuiltinOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩGenerateTypeScriptInterfaceOptions, __ΩGenerateTypeScriptObjectOptions, __ΩIOType, __ΩStdioOptions, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateTypeScriptObject, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
4
+ import { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration } from "./typescript.mjs";
5
+ export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions, GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩCreateBuiltinOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, __ΩIOType, __ΩStdioOptions, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateObjectDeclaration, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
@@ -1,6 +1,6 @@
1
- import { generateTypeScriptObject } from "./typescript.mjs";
1
+ import { generateObjectDeclaration } from "./typescript.mjs";
2
2
  import { refkey } from "./refkey.mjs";
3
3
  import { LARGE_BUFFER, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue } from "./capnp.mjs";
4
4
  import { createBuiltin } from "./create-builtin.mjs";
5
5
 
6
- export { LARGE_BUFFER, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateTypeScriptObject, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
6
+ export { LARGE_BUFFER, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateObjectDeclaration, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
@@ -12,7 +12,7 @@ let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefine
12
12
  * @param options - Options for generating the object.
13
13
  * @returns A string containing the TypeScript object definition.
14
14
  */
15
- function generateTypeScriptObject(reflection, options = {}) {
15
+ function generateObjectDeclaration(reflection, options = {}) {
16
16
  if (!reflection) return "";
17
17
  return `
18
18
  /**
@@ -43,4 +43,4 @@ export const ${(0, __stryke_string_format_camel_case.camelCase)(options.override
43
43
  }
44
44
 
45
45
  //#endregion
46
- exports.generateTypeScriptObject = generateTypeScriptObject;
46
+ exports.generateObjectDeclaration = generateObjectDeclaration;
@@ -1,12 +1,12 @@
1
1
  import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
2
2
 
3
3
  //#region src/helpers/typescript.d.ts
4
- interface GenerateTypeScriptInterfaceOptions<T> {
4
+ interface GenerateInterfaceDeclarationOptions<T> {
5
5
  overrideName?: string;
6
6
  overrideExtends?: string | false;
7
7
  defaultValues?: Partial<T>;
8
8
  }
9
- interface GenerateTypeScriptObjectOptions<T> {
9
+ interface GenerateObjectDeclarationOptions<T> {
10
10
  overrideName?: string;
11
11
  overrideExtends?: string | false;
12
12
  defaultValues?: Partial<T>;
@@ -18,9 +18,9 @@ interface GenerateTypeScriptObjectOptions<T> {
18
18
  * @param options - Options for generating the object.
19
19
  * @returns A string containing the TypeScript object definition.
20
20
  */
21
- declare function generateTypeScriptObject<T extends Record<string, any>>(reflection: ReflectionClass<T>, options?: GenerateTypeScriptObjectOptions<T>): string;
22
- declare type __ΩGenerateTypeScriptInterfaceOptions = any[];
23
- declare type __ΩGenerateTypeScriptObjectOptions = any[];
21
+ declare function generateObjectDeclaration<T extends Record<string, any>>(reflection: ReflectionClass<T>, options?: GenerateObjectDeclarationOptions<T>): string;
22
+ declare type __ΩGenerateInterfaceDeclarationOptions = any[];
23
+ declare type __ΩGenerateObjectDeclarationOptions = any[];
24
24
  //#endregion
25
- export { GenerateTypeScriptInterfaceOptions, GenerateTypeScriptObjectOptions, __ΩGenerateTypeScriptInterfaceOptions, __ΩGenerateTypeScriptObjectOptions, generateTypeScriptObject };
25
+ export { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration };
26
26
  //# sourceMappingURL=typescript.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.d.cts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;AAAmD,UAblC,+BAakC,CAAA,CAAA,CAAA,CAAA;EACrB,YAAA,CAAA,EAAA,MAAA;EAAhB,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAC6B,aAAA,CAAA,EAZzB,OAYyB,CAZjB,CAYiB,CAAA;;;;;;;;;iBAF3B,mCAAmC,iCACrC,gBAAgB,cACnB,gCAAgC"}
1
+ {"version":3,"file":"typescript.d.cts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;AAAoD,UAbnC,gCAamC,CAAA,CAAA,CAAA,CAAA;EACtB,YAAA,CAAA,EAAA,MAAA;EAAhB,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAC8B,aAAA,CAAA,EAZ1B,OAY0B,CAZlB,CAYkB,CAAA;;;;;;;;;iBAF5B,oCAAoC,iCACtC,gBAAgB,cACnB,iCAAiC"}
@@ -1,12 +1,12 @@
1
1
  import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
2
2
 
3
3
  //#region src/helpers/typescript.d.ts
4
- interface GenerateTypeScriptInterfaceOptions<T> {
4
+ interface GenerateInterfaceDeclarationOptions<T> {
5
5
  overrideName?: string;
6
6
  overrideExtends?: string | false;
7
7
  defaultValues?: Partial<T>;
8
8
  }
9
- interface GenerateTypeScriptObjectOptions<T> {
9
+ interface GenerateObjectDeclarationOptions<T> {
10
10
  overrideName?: string;
11
11
  overrideExtends?: string | false;
12
12
  defaultValues?: Partial<T>;
@@ -18,9 +18,9 @@ interface GenerateTypeScriptObjectOptions<T> {
18
18
  * @param options - Options for generating the object.
19
19
  * @returns A string containing the TypeScript object definition.
20
20
  */
21
- declare function generateTypeScriptObject<T extends Record<string, any>>(reflection: ReflectionClass<T>, options?: GenerateTypeScriptObjectOptions<T>): string;
22
- declare type __ΩGenerateTypeScriptInterfaceOptions = any[];
23
- declare type __ΩGenerateTypeScriptObjectOptions = any[];
21
+ declare function generateObjectDeclaration<T extends Record<string, any>>(reflection: ReflectionClass<T>, options?: GenerateObjectDeclarationOptions<T>): string;
22
+ declare type __ΩGenerateInterfaceDeclarationOptions = any[];
23
+ declare type __ΩGenerateObjectDeclarationOptions = any[];
24
24
  //#endregion
25
- export { GenerateTypeScriptInterfaceOptions, GenerateTypeScriptObjectOptions, __ΩGenerateTypeScriptInterfaceOptions, __ΩGenerateTypeScriptObjectOptions, generateTypeScriptObject };
25
+ export { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration };
26
26
  //# sourceMappingURL=typescript.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.d.mts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;AAAmD,UAblC,+BAakC,CAAA,CAAA,CAAA,CAAA;EACrB,YAAA,CAAA,EAAA,MAAA;EAAhB,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAC6B,aAAA,CAAA,EAZzB,OAYyB,CAZjB,CAYiB,CAAA;;;;;;;;;iBAF3B,mCAAmC,iCACrC,gBAAgB,cACnB,gCAAgC"}
1
+ {"version":3,"file":"typescript.d.mts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;AAAoD,UAbnC,gCAamC,CAAA,CAAA,CAAA,CAAA;EACtB,YAAA,CAAA,EAAA,MAAA;EAAhB,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAC8B,aAAA,CAAA,EAZ1B,OAY0B,CAZlB,CAYkB,CAAA;;;;;;;;;iBAF5B,oCAAoC,iCACtC,gBAAgB,cACnB,iCAAiC"}
@@ -11,7 +11,7 @@ import { isUndefined } from "@stryke/type-checks/is-undefined";
11
11
  * @param options - Options for generating the object.
12
12
  * @returns A string containing the TypeScript object definition.
13
13
  */
14
- function generateTypeScriptObject(reflection, options = {}) {
14
+ function generateObjectDeclaration(reflection, options = {}) {
15
15
  if (!reflection) return "";
16
16
  return `
17
17
  /**
@@ -42,5 +42,5 @@ export const ${camelCase(options.overrideName || reflection.getName())}${options
42
42
  }
43
43
 
44
44
  //#endregion
45
- export { generateTypeScriptObject };
45
+ export { generateObjectDeclaration };
46
46
  //# sourceMappingURL=typescript.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.mjs","names":["stringifyValue","camelCase","titleCase","isUndefined","generateTypeScriptObject","reflection","options","getDescription","overrideName","getClassName","getName","overrideExtends","getSuperReflectionClass","getProperties","filter","item","isIgnored","defaultValues","getNameAsString","getAlias","reduce","ret","alias","undefined","getDefaultValue","sort","a","b","isReadonly","localeCompare","map","getTitle","length","join","getDomain","getPermission","permission","isInternal","isHidden","getType"],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { stringifyValue } from \"@powerlines/deepkit/utilities\";\nimport type { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport interface GenerateTypeScriptInterfaceOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n// /**\n// * Generates a TypeScript interface for the given reflection class.\n// *\n// * @param reflection - The reflection class to generate the interface for.\n// * @returns A string containing the TypeScript interface definition.\n// */\n// export function TypeScriptInterface<T>(\n// reflection: ReflectionClass<T>,\n// options: GenerateTypeScriptInterfaceOptions<T> = {}\n// ): string {\n// if (!reflection) {\n// return \"\";\n// }\n\n// return `\n// /**\n// * Interface for ${reflection.getTitle() || titleCase(options.overrideName || reflection.getName())}.\n// *\n// * @title ${reflection.getTitle() || titleCase(reflection.getName())}${\n// reflection.getAlias().length\n// ? ` ${reflection\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${reflection.getDomain() ? ` * @domain ${reflection.getDomain()}` : \"\"}${\n// reflection.getPermission().length\n// ? `\n// ${reflection\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// reflection.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// reflection.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// reflection.isIgnored()\n// ? `\n// * @ignored`\n// : \"\"\n// }${\n// reflection.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// export interface ${pascalCase(options.overrideName || reflection.getName())}${\n// options.overrideExtends !== false &&\n// (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n// ? ` extends ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n// : \"\"\n// } {\n// ${reflection\n// .getProperties()\n// .filter(item => !item.isIgnored())\n// .sort((a, b) =>\n// (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n// ? a.getNameAsString().localeCompare(b.getNameAsString())\n// : a.isReadonly()\n// ? 1\n// : -1\n// )\n// .map(\n// item =>\n// ` /**\n// * ${\n// item.getDescription() ||\n// item.getTitle() ||\n// titleCase(item.getNameAsString())\n// }\n// *\n// * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n// item.getAlias().length\n// ? `\n// ${item\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// item.getDomain()\n// ? `\n// * @domain ${item.getDomain()}`\n// : \"\"\n// }${\n// item.getPermission().length\n// ? `\n// ${item\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// !isUndefined(item.getDefaultValue()) && item.getDefaultValue() !== \"\"\n// ? `\n// * @defaultValue ${item.getDefaultValue()}`\n// : \"\"\n// }${\n// item.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// item.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// item.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// ${item.isReadonly() ? \"readonly \" : \"\"}${item.getNameAsString()}${\n// isUndefined(\n// (options.defaultValues as Record<string, any>)?.[item.getNameAsString()]\n// ) &&\n// isUndefined(item.getDefaultValue()) &&\n// !item\n// .getAlias()\n// .some(\n// alias =>\n// !isUndefined(\n// (options.defaultValues as Record<string, any>)?.[alias]\n// )\n// ) &&\n// item.isOptional()\n// ? \"?\"\n// : \"\"\n// }: ${stringifyType(item.getType())}`\n// )\n// .join(\", \\n\")}\n// }\n// `;\n// }\n\nexport interface GenerateTypeScriptObjectOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n *\n * @param reflection - The reflection class to generate the object for.\n * @param options - Options for generating the object.\n * @returns A string containing the TypeScript object definition.\n */\nexport function generateTypeScriptObject<T extends Record<string, any>>(\n reflection: ReflectionClass<T>,\n options: GenerateTypeScriptObjectOptions<T> = {}\n) {\n if (!reflection) {\n return \"\";\n }\n\n return `\n/**\n * ${\n reflection.getDescription() ||\n `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`\n }.\n */\nexport const ${camelCase(options.overrideName || reflection.getName())}${\n options.overrideExtends !== false &&\n (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n : \"\"\n } = {\n ${reflection\n .getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (options.defaultValues as Record<string, any>)?.[alias]\n )\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(\n item =>\n ` /**\n * ${\n item.getDescription() ||\n item.getTitle() ||\n titleCase(item.getNameAsString())\n }\n *\n * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n item.getAlias().length\n ? `\n ${item\n .getAlias()\n .map(alias => ` * @alias ${alias}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.getDomain()\n ? `\n * @domain ${item.getDomain()}`\n : \"\"\n }${\n item.getPermission().length\n ? `\n ${item\n .getPermission()\n .map(permission => ` * @permission ${permission}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.isInternal()\n ? `\n * @internal`\n : \"\"\n }${\n item.isReadonly()\n ? `\n * @readonly`\n : \"\"\n }${\n item.isIgnored()\n ? `\n * @ignored`\n : \"\"\n }${\n item.isHidden()\n ? `\n * @hidden`\n : \"\"\n }\n */\n ${item.getNameAsString()}: ${stringifyValue(\n item.getType(),\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined((options.defaultValues as Record<string, any>)?.[alias])\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )}`\n )\n .join(\", \\n\")}\n};\n`;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"typescript.mjs","names":["stringifyValue","camelCase","titleCase","isUndefined","generateObjectDeclaration","reflection","options","getDescription","overrideName","getClassName","getName","overrideExtends","getSuperReflectionClass","getProperties","filter","item","isIgnored","defaultValues","getNameAsString","getAlias","reduce","ret","alias","undefined","getDefaultValue","sort","a","b","isReadonly","localeCompare","map","getTitle","length","join","getDomain","getPermission","permission","isInternal","isHidden","getType"],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { stringifyValue } from \"@powerlines/deepkit/utilities\";\nimport type { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport interface GenerateInterfaceDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n// /**\n// * Generates a TypeScript interface for the given reflection class.\n// *\n// * @param reflection - The reflection class to generate the interface for.\n// * @returns A string containing the TypeScript interface definition.\n// */\n// export function InterfaceDeclaration<T>(\n// reflection: ReflectionClass<T>,\n// options: GenerateInterfaceDeclarationOptions<T> = {}\n// ): string {\n// if (!reflection) {\n// return \"\";\n// }\n\n// return `\n// /**\n// * Interface for ${reflection.getTitle() || titleCase(options.overrideName || reflection.getName())}.\n// *\n// * @title ${reflection.getTitle() || titleCase(reflection.getName())}${\n// reflection.getAlias().length\n// ? ` ${reflection\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${reflection.getDomain() ? ` * @domain ${reflection.getDomain()}` : \"\"}${\n// reflection.getPermission().length\n// ? `\n// ${reflection\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// reflection.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// reflection.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// reflection.isIgnored()\n// ? `\n// * @ignored`\n// : \"\"\n// }${\n// reflection.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// export interface ${pascalCase(options.overrideName || reflection.getName())}${\n// options.overrideExtends !== false &&\n// (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n// ? ` extends ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n// : \"\"\n// } {\n// ${reflection\n// .getProperties()\n// .filter(item => !item.isIgnored())\n// .sort((a, b) =>\n// (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n// ? a.getNameAsString().localeCompare(b.getNameAsString())\n// : a.isReadonly()\n// ? 1\n// : -1\n// )\n// .map(\n// item =>\n// ` /**\n// * ${\n// item.getDescription() ||\n// item.getTitle() ||\n// titleCase(item.getNameAsString())\n// }\n// *\n// * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n// item.getAlias().length\n// ? `\n// ${item\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// item.getDomain()\n// ? `\n// * @domain ${item.getDomain()}`\n// : \"\"\n// }${\n// item.getPermission().length\n// ? `\n// ${item\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// !isUndefined(item.getDefaultValue()) && item.getDefaultValue() !== \"\"\n// ? `\n// * @defaultValue ${item.getDefaultValue()}`\n// : \"\"\n// }${\n// item.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// item.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// item.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// ${item.isReadonly() ? \"readonly \" : \"\"}${item.getNameAsString()}${\n// isUndefined(\n// (options.defaultValues as Record<string, any>)?.[item.getNameAsString()]\n// ) &&\n// isUndefined(item.getDefaultValue()) &&\n// !item\n// .getAlias()\n// .some(\n// alias =>\n// !isUndefined(\n// (options.defaultValues as Record<string, any>)?.[alias]\n// )\n// ) &&\n// item.isOptional()\n// ? \"?\"\n// : \"\"\n// }: ${stringifyType(item.getType())}`\n// )\n// .join(\", \\n\")}\n// }\n// `;\n// }\n\nexport interface GenerateObjectDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n *\n * @param reflection - The reflection class to generate the object for.\n * @param options - Options for generating the object.\n * @returns A string containing the TypeScript object definition.\n */\nexport function generateObjectDeclaration<T extends Record<string, any>>(\n reflection: ReflectionClass<T>,\n options: GenerateObjectDeclarationOptions<T> = {}\n) {\n if (!reflection) {\n return \"\";\n }\n\n return `\n/**\n * ${\n reflection.getDescription() ||\n `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`\n }.\n */\nexport const ${camelCase(options.overrideName || reflection.getName())}${\n options.overrideExtends !== false &&\n (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n : \"\"\n } = {\n ${reflection\n .getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (options.defaultValues as Record<string, any>)?.[alias]\n )\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(\n item =>\n ` /**\n * ${\n item.getDescription() ||\n item.getTitle() ||\n titleCase(item.getNameAsString())\n }\n *\n * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n item.getAlias().length\n ? `\n ${item\n .getAlias()\n .map(alias => ` * @alias ${alias}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.getDomain()\n ? `\n * @domain ${item.getDomain()}`\n : \"\"\n }${\n item.getPermission().length\n ? `\n ${item\n .getPermission()\n .map(permission => ` * @permission ${permission}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.isInternal()\n ? `\n * @internal`\n : \"\"\n }${\n item.isReadonly()\n ? `\n * @readonly`\n : \"\"\n }${\n item.isIgnored()\n ? `\n * @ignored`\n : \"\"\n }${\n item.isHidden()\n ? `\n * @hidden`\n : \"\"\n }\n */\n ${item.getNameAsString()}: ${stringifyValue(\n item.getType(),\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined((options.defaultValues as Record<string, any>)?.[alias])\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )}`\n )\n .join(\", \\n\")}\n};\n`;\n}\n"],"mappings":""}
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core2 from "@alloy-js/core";
1
+ import * as _alloy_js_core1 from "@alloy-js/core";
2
2
 
3
3
  //#region src/markdown/components/front-matter.d.ts
4
4
  interface FrontMatterProps {
@@ -9,7 +9,7 @@ interface FrontMatterProps {
9
9
  *
10
10
  * @see https://jekyllrb.com/docs/front-matter/
11
11
  */
12
- declare function FrontMatter(props: FrontMatterProps): _alloy_js_core2.Children;
12
+ declare function FrontMatter(props: FrontMatterProps): _alloy_js_core1.Children;
13
13
  declare type __ΩFrontMatterProps = any[];
14
14
  //#endregion
15
15
  export { FrontMatter, FrontMatterProps, __ΩFrontMatterProps };
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core7 from "@alloy-js/core";
1
+ import * as _alloy_js_core5 from "@alloy-js/core";
2
2
 
3
3
  //#region src/markdown/components/front-matter.d.ts
4
4
  interface FrontMatterProps {
@@ -9,7 +9,7 @@ interface FrontMatterProps {
9
9
  *
10
10
  * @see https://jekyllrb.com/docs/front-matter/
11
11
  */
12
- declare function FrontMatter(props: FrontMatterProps): _alloy_js_core7.Children;
12
+ declare function FrontMatter(props: FrontMatterProps): _alloy_js_core5.Children;
13
13
  declare type __ΩFrontMatterProps = any[];
14
14
  //#endregion
15
15
  export { FrontMatter, FrontMatterProps, __ΩFrontMatterProps };
@@ -1,7 +1,7 @@
1
1
  import { ComponentProps, SourceFileHeaderProps } from "../../types/components.mjs";
2
2
  import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.mjs";
3
3
  import { FrontMatterProps } from "./front-matter.mjs";
4
- import * as _alloy_js_core5 from "@alloy-js/core";
4
+ import * as _alloy_js_core6 from "@alloy-js/core";
5
5
 
6
6
  //#region src/markdown/components/markdown-file.d.ts
7
7
  type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & MarkdownFileHeaderProps;
@@ -11,7 +11,7 @@ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps &
11
11
  * @param props - The properties for the source file.
12
12
  * @returns The rendered source file component.
13
13
  */
14
- declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core5.Children;
14
+ declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core6.Children;
15
15
  type MarkdownFileHeaderProps = SourceFileHeaderProps & {
16
16
  frontMatter?: FrontMatterProps["data"];
17
17
  };
@@ -21,7 +21,7 @@ type MarkdownFileHeaderProps = SourceFileHeaderProps & {
21
21
  * @param props - The properties for the source file header.
22
22
  * @returns The rendered source file header.
23
23
  */
24
- declare function MarkdownFileHeader(props: MarkdownFileHeaderProps): _alloy_js_core5.Children;
24
+ declare function MarkdownFileHeader(props: MarkdownFileHeaderProps): _alloy_js_core6.Children;
25
25
  declare type __ΩMarkdownFileProps = any[];
26
26
  declare type __ΩMarkdownFileHeaderProps = any[];
27
27
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { ComponentProps } from "../../types/components.cjs";
2
2
  import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.cjs";
3
- import * as _alloy_js_core7 from "@alloy-js/core";
3
+ import * as _alloy_js_core2 from "@alloy-js/core";
4
4
 
5
5
  //#region src/markdown/components/markdown-table.d.ts
6
6
  interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
@@ -9,18 +9,18 @@ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>
9
9
  /**
10
10
  * Component that provides a context for rendering markdown tables.
11
11
  */
12
- declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core7.Children;
12
+ declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core2.Children;
13
13
  type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
14
14
  width?: number;
15
15
  };
16
16
  /**
17
17
  * Component that provides a context for rendering markdown tables.
18
18
  */
19
- declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core7.Children;
19
+ declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core2.Children;
20
20
  /**
21
21
  * Component that provides a context for rendering markdown tables.
22
22
  */
23
- declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core7.Children;
23
+ declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core2.Children;
24
24
  declare type __ΩMarkdownTableProps = any[];
25
25
  declare type __ΩMarkdownTableColumnProps = any[];
26
26
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { TSDocModuleProps } from "./tsdoc.cjs";
2
2
  import { TypescriptFileProps } from "./typescript-file.cjs";
3
- import * as _alloy_js_core19 from "@alloy-js/core";
3
+ import * as _alloy_js_core15 from "@alloy-js/core";
4
4
 
5
5
  //#region src/typescript/components/builtin-file.d.ts
6
6
  type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
@@ -28,7 +28,7 @@ type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProp
28
28
  * @param props - The properties for the source file.
29
29
  * @returns The rendered source file component.
30
30
  */
31
- declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core19.Children;
31
+ declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core15.Children;
32
32
  declare type __ΩBuiltinFileProps = any[];
33
33
  //#endregion
34
34
  export { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps };
@@ -1,6 +1,6 @@
1
1
  import { TSDocModuleProps } from "./tsdoc.mjs";
2
2
  import { TypescriptFileProps } from "./typescript-file.mjs";
3
- import * as _alloy_js_core19 from "@alloy-js/core";
3
+ import * as _alloy_js_core18 from "@alloy-js/core";
4
4
 
5
5
  //#region src/typescript/components/builtin-file.d.ts
6
6
  type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
@@ -28,7 +28,7 @@ type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProp
28
28
  * @param props - The properties for the source file.
29
29
  * @returns The rendered source file component.
30
30
  */
31
- declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core19.Children;
31
+ declare function BuiltinFile(props: BuiltinFileProps): _alloy_js_core18.Children;
32
32
  declare type __ΩBuiltinFileProps = any[];
33
33
  //#endregion
34
34
  export { BuiltinFile, BuiltinFileProps, __ΩBuiltinFileProps };
@@ -5,14 +5,17 @@ require('../contexts/index.cjs');
5
5
  const require_typescript_contexts_member_scope = require('../contexts/member-scope.cjs');
6
6
  const require_typescript_helpers_get_call_signature_props = require('../helpers/get-call-signature-props.cjs');
7
7
  require('../helpers/index.cjs');
8
+ const require_typescript_components_property_name = require('./property-name.cjs');
8
9
  const require_typescript_components_type_parameters = require('./type-parameters.cjs');
9
- const require_typescript_components_typescript_property_name = require('./typescript-property-name.cjs');
10
10
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
11
11
  let __alloy_js_core = require("@alloy-js/core");
12
12
  let __alloy_js_typescript = require("@alloy-js/typescript");
13
13
 
14
14
  //#region src/typescript/components/class-declaration.tsx
15
15
  /**
16
+ * Props for the ClassDeclaration component, which represents a TypeScript class declaration
17
+ */
18
+ /**
16
19
  * Create a TypeScript class declaration.
17
20
  *
18
21
  * @example
@@ -70,9 +73,9 @@ function ClassDeclaration(props) {
70
73
  return Boolean(props.doc);
71
74
  },
72
75
  get children() {
73
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
76
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
74
77
  return props.doc;
75
- } }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
78
+ } });
76
79
  }
77
80
  }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.Declaration, {
78
81
  symbol: sym,
@@ -106,6 +109,15 @@ function ClassDeclaration(props) {
106
109
  })];
107
110
  }
108
111
  ClassDeclaration.TypeParameters = require_typescript_components_type_parameters.TypeParameters;
112
+ /**
113
+ * Generates a TypeScript class member declaration for the given reflection class.
114
+ */
115
+ /**
116
+ * Generates a TypeScript class member declaration for the given reflection class.
117
+ *
118
+ * @param props - The properties of the class member, including its name, visibility, and other modifiers.
119
+ * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
120
+ */
109
121
  function ClassMember(props) {
110
122
  let tsFlags = __alloy_js_typescript.TSSymbolFlags.None;
111
123
  if (props.nullish) tsFlags |= __alloy_js_typescript.TSSymbolFlags.Nullish;
@@ -119,9 +131,9 @@ function ClassMember(props) {
119
131
  return Boolean(props.doc);
120
132
  },
121
133
  get children() {
122
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
134
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
123
135
  return props.doc;
124
- } }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
136
+ } });
125
137
  }
126
138
  }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.MemberDeclaration, {
127
139
  symbol: sym,
@@ -130,12 +142,22 @@ function ClassMember(props) {
130
142
  (0, __alloy_js_core_jsx_runtime.memo)(() => props.public && "public "),
131
143
  (0, __alloy_js_core_jsx_runtime.memo)(() => props.private && "private "),
132
144
  (0, __alloy_js_core_jsx_runtime.memo)(() => props.protected && "protected "),
145
+ (0, __alloy_js_core_jsx_runtime.memo)(() => props.abstract && "abstract "),
133
146
  (0, __alloy_js_core_jsx_runtime.memo)(() => props.static && "static "),
134
147
  (0, __alloy_js_core_jsx_runtime.memo)(() => props.children)
135
148
  ];
136
149
  }
137
150
  })];
138
151
  }
152
+ /**
153
+ * Props for a class field, which is a specific type of class member that represents a property of the class.
154
+ */
155
+ /**
156
+ * Generates a TypeScript class field declaration for the given reflection class.
157
+ *
158
+ * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
159
+ * @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.
160
+ */
139
161
  function ClassField(props) {
140
162
  const optionality = props.optional ? "?" : "";
141
163
  const typeSection = props.type && [
@@ -150,13 +172,22 @@ function ClassField(props) {
150
172
  nullish: props.nullish ?? props.optional,
151
173
  get children() {
152
174
  return [
153
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_property_name.TypescriptPropertyName, {}),
175
+ (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {}),
154
176
  typeSection,
155
177
  initializerSection
156
178
  ];
157
179
  }
158
180
  }));
159
181
  }
182
+ /**
183
+ * Props for a class method, which is a specific type of class member that represents a function defined within the class.
184
+ */
185
+ /**
186
+ * Generates a TypeScript class method declaration for the given reflection class.
187
+ *
188
+ * @param props - The properties of the class method, including its name, visibility, and other modifiers.
189
+ * @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.
190
+ */
160
191
  function ClassMethod(props) {
161
192
  const callProps = require_typescript_helpers_get_call_signature_props.getCallSignatureProps(props);
162
193
  const [_, rest] = (0, __alloy_js_core.splitProps)(props, ["doc"]);
@@ -165,18 +196,18 @@ function ClassMethod(props) {
165
196
  return Boolean(props.doc);
166
197
  },
167
198
  get children() {
168
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get children() {
199
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get children() {
169
200
  return [(0, __alloy_js_core_jsx_runtime.memo)(() => (0, __alloy_js_core_jsx_runtime.memo)(() => !!props.doc)() && (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Prose, { get children() {
170
201
  return props.doc;
171
202
  } })), (0, __alloy_js_core_jsx_runtime.memo)(() => (0, __alloy_js_core_jsx_runtime.memo)(() => !!Array.isArray(rest.parameters))() && (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocParams, { get parameters() {
172
203
  return rest.parameters;
173
204
  } }))];
174
- } }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
205
+ } });
175
206
  }
176
207
  }), (0, __alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, { get children() {
177
208
  return [
178
209
  (0, __alloy_js_core_jsx_runtime.memo)(() => props.async && "async "),
179
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_property_name.TypescriptPropertyName, {}),
210
+ (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {}),
180
211
  (0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_lexical_scope.LexicalScope, { get children() {
181
212
  return [
182
213
  (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.CallSignature, callProps),
@@ -3,6 +3,9 @@ import { Children, Namekey, Refkey } from "@alloy-js/core";
3
3
  import { CallSignatureProps, CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
4
4
 
5
5
  //#region src/typescript/components/class-declaration.d.ts
6
+ /**
7
+ * Props for the ClassDeclaration component, which represents a TypeScript class declaration
8
+ */
6
9
  interface ClassDeclarationProps extends CommonDeclarationProps {
7
10
  /**
8
11
  * An indication of whether this class is abstract
@@ -55,6 +58,9 @@ declare function ClassDeclaration(props: ClassDeclarationProps): Children;
55
58
  declare namespace ClassDeclaration {
56
59
  var TypeParameters: typeof TypeParameters;
57
60
  }
61
+ /**
62
+ * Generates a TypeScript class member declaration for the given reflection class.
63
+ */
58
64
  interface ClassMemberProps {
59
65
  name: string | Namekey;
60
66
  refkey?: Refkey;
@@ -63,21 +69,46 @@ interface ClassMemberProps {
63
69
  protected?: boolean;
64
70
  jsPrivate?: boolean;
65
71
  static?: boolean;
72
+ abstract?: boolean;
66
73
  children?: Children;
67
74
  doc?: Children;
68
75
  nullish?: boolean;
69
76
  }
77
+ /**
78
+ * Generates a TypeScript class member declaration for the given reflection class.
79
+ *
80
+ * @param props - The properties of the class member, including its name, visibility, and other modifiers.
81
+ * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
82
+ */
70
83
  declare function ClassMember(props: ClassMemberProps): Children;
84
+ /**
85
+ * Props for a class field, which is a specific type of class member that represents a property of the class.
86
+ */
71
87
  interface ClassFieldProps extends ClassMemberProps {
72
88
  type?: Children;
73
89
  optional?: boolean;
74
90
  children?: Children;
75
91
  }
92
+ /**
93
+ * Generates a TypeScript class field declaration for the given reflection class.
94
+ *
95
+ * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
96
+ * @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.
97
+ */
76
98
  declare function ClassField(props: ClassFieldProps): Children;
99
+ /**
100
+ * Props for a class method, which is a specific type of class member that represents a function defined within the class.
101
+ */
77
102
  interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {
78
103
  async?: boolean;
79
104
  children?: Children;
80
105
  }
106
+ /**
107
+ * Generates a TypeScript class method declaration for the given reflection class.
108
+ *
109
+ * @param props - The properties of the class method, including its name, visibility, and other modifiers.
110
+ * @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.
111
+ */
81
112
  declare function ClassMethod(props: ClassMethodProps): Children;
82
113
  declare type __ΩClassDeclarationProps = any[];
83
114
  declare type __ΩClassMemberProps = any[];