@graphql-markdown/printer-legacy 1.14.0 → 1.16.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 (71) hide show
  1. package/dist/badge.d.ts +10 -3
  2. package/dist/badge.d.ts.map +1 -1
  3. package/dist/badge.js +19 -9
  4. package/dist/code.d.ts +1 -1
  5. package/dist/code.d.ts.map +1 -1
  6. package/dist/common.d.ts +5 -13
  7. package/dist/common.d.ts.map +1 -1
  8. package/dist/common.js +5 -6
  9. package/dist/const/options.d.ts +11 -2
  10. package/dist/const/options.d.ts.map +1 -1
  11. package/dist/const/options.js +27 -10
  12. package/dist/const/strings.d.ts +1 -3
  13. package/dist/const/strings.d.ts.map +1 -1
  14. package/dist/const/strings.js +4 -6
  15. package/dist/directive.d.ts +4 -4
  16. package/dist/directive.d.ts.map +1 -1
  17. package/dist/directive.js +9 -12
  18. package/dist/events.d.ts +77 -0
  19. package/dist/events.d.ts.map +1 -0
  20. package/dist/events.js +85 -0
  21. package/dist/example.d.ts.map +1 -1
  22. package/dist/example.js +12 -7
  23. package/dist/format-helpers.d.ts +9 -0
  24. package/dist/format-helpers.d.ts.map +1 -1
  25. package/dist/format-helpers.js +10 -1
  26. package/dist/formatter.d.ts.map +1 -1
  27. package/dist/formatter.js +9 -30
  28. package/dist/frontmatter.d.ts.map +1 -1
  29. package/dist/graphql/directive.d.ts +4 -4
  30. package/dist/graphql/directive.d.ts.map +1 -1
  31. package/dist/graphql/directive.js +3 -3
  32. package/dist/graphql/enum.d.ts +4 -4
  33. package/dist/graphql/enum.d.ts.map +1 -1
  34. package/dist/graphql/enum.js +2 -2
  35. package/dist/graphql/input.d.ts.map +1 -1
  36. package/dist/graphql/input.js +1 -1
  37. package/dist/graphql/interface.d.ts.map +1 -1
  38. package/dist/graphql/interface.js +1 -1
  39. package/dist/graphql/object.d.ts +3 -3
  40. package/dist/graphql/object.d.ts.map +1 -1
  41. package/dist/graphql/object.js +4 -4
  42. package/dist/graphql/operation.d.ts +4 -12
  43. package/dist/graphql/operation.d.ts.map +1 -1
  44. package/dist/graphql/operation.js +43 -11
  45. package/dist/graphql/scalar.d.ts +6 -6
  46. package/dist/graphql/scalar.d.ts.map +1 -1
  47. package/dist/graphql/scalar.js +7 -7
  48. package/dist/graphql/union.d.ts +4 -4
  49. package/dist/graphql/union.d.ts.map +1 -1
  50. package/dist/graphql/union.js +2 -2
  51. package/dist/group.d.ts +2 -2
  52. package/dist/group.d.ts.map +1 -1
  53. package/dist/group.js +7 -6
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +6 -2
  57. package/dist/link.d.ts +6 -14
  58. package/dist/link.d.ts.map +1 -1
  59. package/dist/link.js +9 -9
  60. package/dist/mdx/index.d.ts +1 -1
  61. package/dist/mdx/index.d.ts.map +1 -1
  62. package/dist/mdx/index.js +2 -2
  63. package/dist/printer.d.ts +51 -34
  64. package/dist/printer.d.ts.map +1 -1
  65. package/dist/printer.js +234 -118
  66. package/dist/relation.d.ts +2 -2
  67. package/dist/relation.d.ts.map +1 -1
  68. package/dist/section.d.ts +5 -5
  69. package/dist/section.d.ts.map +1 -1
  70. package/dist/section.js +26 -11
  71. package/package.json +18 -6
package/dist/example.js CHANGED
@@ -68,11 +68,15 @@ const parseTypeFields = (type, options, mappedTypes = []) => {
68
68
  const fieldType = (0, graphql_1.hasDirective)(field, [directiveExample.directive])
69
69
  ? field
70
70
  : field.type;
71
+ const graphQLFieldType = fieldType;
72
+ // GraphQL overload resolution can include a void branch in this monorepo; runtime value is used only for list checks.
73
+ // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
74
+ const nullableFieldType = (0, graphql_1.getNullableType)(graphQLFieldType);
71
75
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
72
- const value = parseExampleDirective(fieldType, options, mappedTypes);
76
+ const value = parseExampleDirective(graphQLFieldType, options, mappedTypes);
73
77
  let structuredValue = value;
74
- if ((0, graphql_1.isListType)((0, graphql_1.getNullableType)(fieldType))) {
75
- if (!value && (0, graphql_1.isNonNullType)(fieldType)) {
78
+ if ((0, graphql_1.isListType)(nullableFieldType)) {
79
+ if (!value && (0, graphql_1.isNonNullType)(graphQLFieldType)) {
76
80
  structuredValue = [];
77
81
  }
78
82
  else {
@@ -136,9 +140,9 @@ const parseExampleDirective = (type, options, mappedTypes = []) => {
136
140
  return undefined;
137
141
  }
138
142
  // get type name
139
- const typename = (0, graphql_1.isType)(namedType)
140
- ? (0, utils_1.toString)(namedType)
141
- : (0, utils_1.toString)(namedType.name);
143
+ const typename = (0, utils_1.hasStringProperty)(namedType, "name")
144
+ ? (0, utils_1.toString)(namedType.name)
145
+ : (0, utils_1.toString)(namedType);
142
146
  // recursion check
143
147
  if (mappedTypes.includes(typename)) {
144
148
  return undefined;
@@ -146,7 +150,8 @@ const parseExampleDirective = (type, options, mappedTypes = []) => {
146
150
  mappedTypes.push(typename);
147
151
  try {
148
152
  const arg = (0, graphql_1.getTypeDirectiveArgValue)(directiveExample.directive, namedType, directiveExample.field);
149
- return parser(arg, namedType);
153
+ const parsedValue = parser(arg, namedType);
154
+ return parsedValue;
150
155
  }
151
156
  catch (err) {
152
157
  if (err instanceof graphql_1.IntrospectionError) {
@@ -21,6 +21,15 @@ export declare const formatMDXAdmonition: ({ text, title, type, icon }: Admoniti
21
21
  export declare const formatMDXBullet: (text?: string) => MDXString;
22
22
  /**
23
23
  * Default details formatter.
24
+ *
25
+ * The returned string **must** contain a `\r` (carriage return) character as a
26
+ * delimiter between the opening part (ending after `</summary>`) and the
27
+ * closing part (starting before `</details>`). `printSection` calls
28
+ * `result.split('\r')` to obtain `[openSection, closeSection]`; without this
29
+ * delimiter the closing tag is lost and items are rendered outside the
30
+ * collapsible element.
31
+ *
32
+ * Custom implementations of `formatMDXDetails` must follow the same contract.
24
33
  */
25
34
  export declare const formatMDXDetails: ({ dataOpen, }: CollapsibleOption) => MDXString;
26
35
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../src/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AASjC;;GAEG;AACH,eAAO,MAAM,cAAc,6BAE1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,oFAK/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,8BAE3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,iDAI5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,8EAShC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,8BAEzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,yDAQ/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,4BAEpC,CAAC"}
1
+ {"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../src/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AASjC;;GAEG;AACH,eAAO,MAAM,cAAc,UAAW,KAAK,KAAG,SAE7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,gCACD,cAAc,SACpC,KAAK,CAAC,QAAQ,CAAC,KACrB,SAEF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,qBAAgB,SAE3C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,kBAE1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,aACtB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAMF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAE9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAKF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SAEtD,CAAC"}
@@ -34,9 +34,18 @@ const formatMDXBullet = (text = "") => {
34
34
  exports.formatMDXBullet = formatMDXBullet;
35
35
  /**
36
36
  * Default details formatter.
37
+ *
38
+ * The returned string **must** contain a `\r` (carriage return) character as a
39
+ * delimiter between the opening part (ending after `</summary>`) and the
40
+ * closing part (starting before `</details>`). `printSection` calls
41
+ * `result.split('\r')` to obtain `[openSection, closeSection]`; without this
42
+ * delimiter the closing tag is lost and items are rendered outside the
43
+ * collapsible element.
44
+ *
45
+ * Custom implementations of `formatMDXDetails` must follow the same contract.
37
46
  */
38
47
  const formatMDXDetails = ({ dataOpen, }) => {
39
- return `${strings_1.MARKDOWN_EOP}<details class="gqlmd-mdx-details">${strings_1.MARKDOWN_EOL}<summary class="gqlmd-mdx-details-summary"><span className="gqlmd-mdx-details-summary-open">${dataOpen.toUpperCase()}</span></summary>${strings_1.MARKDOWN_EOL}</details>${strings_1.MARKDOWN_EOP}`;
48
+ return `${strings_1.MARKDOWN_EOP}<details class="gqlmd-mdx-details">${strings_1.MARKDOWN_EOL}<summary class="gqlmd-mdx-details-summary"><span className="gqlmd-mdx-details-summary-open">${dataOpen.toUpperCase()}</span></summary>${strings_1.MARKDOWN_EOL}\r${strings_1.MARKDOWN_EOL}</details>${strings_1.MARKDOWN_EOP}`;
40
49
  };
41
50
  exports.formatMDXDetails = formatMDXDetails;
42
51
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAIV,SAAS,EAMV,MAAM,yBAAyB,CAAC;AAQjC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,iBAkDlC,CAAC"}
1
+ {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAazD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,QAAO,SAWzC,CAAC"}
package/dist/formatter.js CHANGED
@@ -9,7 +9,7 @@
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.createDefaultFormatter = void 0;
12
- const strings_1 = require("./const/strings");
12
+ const defaults_1 = require("@graphql-markdown/formatters/defaults");
13
13
  /**
14
14
  * Creates a default formatter for documentation output.
15
15
  *
@@ -29,35 +29,14 @@ const strings_1 = require("./const/strings");
29
29
  */
30
30
  const createDefaultFormatter = () => {
31
31
  return {
32
- formatMDXBadge: (badge) => {
33
- return `<mark class="gqlmd-mdx-badge">${badge.text}</mark>`;
34
- },
35
- formatMDXAdmonition: ({ text, title, type, icon }, _meta) => {
36
- return `${strings_1.MARKDOWN_EOP}<fieldset class="gqlmd-mdx-admonition-fieldset">${strings_1.MARKDOWN_EOL}<legend class="gqlmd-mdx-admonition-legend"><span class="gqlmd-mdx-admonition-legend-type gqlmd-mdx-admonition-legend-type-${type.toLocaleLowerCase()}">${icon ?? type.toUpperCase()} ${title}</span></legend>${strings_1.MARKDOWN_EOL}<span>${text}</span>${strings_1.MARKDOWN_EOL}</fieldset>`;
37
- },
38
- formatMDXBullet: (text = "") => {
39
- return `<span class="gqlmd-mdx-bullet">&nbsp;●&nbsp;</span>${text}`;
40
- },
41
- formatMDXDetails: ({ dataOpen }) => {
42
- return `${strings_1.MARKDOWN_EOP}<details class="gqlmd-mdx-details">${strings_1.MARKDOWN_EOL}<summary class="gqlmd-mdx-details-summary"><span className="gqlmd-mdx-details-summary-open">${dataOpen.toUpperCase()}</span></summary>${strings_1.MARKDOWN_EOL}</details>${strings_1.MARKDOWN_EOP}`;
43
- },
44
- formatMDXFrontmatter: (_props, formatted) => {
45
- return formatted
46
- ? [strings_1.FRONT_MATTER_DELIMITER, ...formatted, strings_1.FRONT_MATTER_DELIMITER].join(strings_1.MARKDOWN_EOL)
47
- : "";
48
- },
49
- formatMDXLink: (link) => {
50
- return link;
51
- },
52
- formatMDXNameEntity: (name, parentType) => {
53
- const parentName = parentType
54
- ? `<code class="gqlmd-mdx-entity-parent">${parentType}</code>.`
55
- : "";
56
- return `<span class="gqlmd-mdx-entity">${parentName}<code class="gqlmd-mdx-entity-name">${name}</code></span>`;
57
- },
58
- formatMDXSpecifiedByLink: (url) => {
59
- return `<span class="gqlmd-mdx-specifiedby">Specification<a class="gqlmd-mdx-specifiedby-link" target="_blank" href="${url}" title="Specified by ${url}">⎘</a></span>`;
60
- },
32
+ formatMDXAdmonition: defaults_1.formatMDXAdmonition,
33
+ formatMDXBadge: defaults_1.formatMDXBadge,
34
+ formatMDXBullet: defaults_1.formatMDXBullet,
35
+ formatMDXDetails: defaults_1.formatMDXDetails,
36
+ formatMDXFrontmatter: defaults_1.formatMDXFrontmatter,
37
+ formatMDXLink: defaults_1.formatMDXLink,
38
+ formatMDXNameEntity: defaults_1.formatMDXNameEntity,
39
+ formatMDXSpecifiedByLink: defaults_1.formatMDXSpecifiedByLink,
61
40
  };
62
41
  };
63
42
  exports.createDefaultFormatter = createDefaultFormatter;
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,kBAAkB,EAClB,KAAK,EACL,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,wFAY5B,CAAC"}
1
+ {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,kBAAkB,EAClB,KAAK,EACL,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,UACpB,MAAM,SACN,KAAK,CAAC,kBAAkB,CAAC,WACvB,gBAAgB,KACxB,MAQF,CAAC"}
@@ -5,15 +5,15 @@
5
5
  *
6
6
  * @module
7
7
  */
8
- import type { PrintDirectiveOptions, GraphQLDirective, MDXString } from "@graphql-markdown/types";
8
+ import type { PrintDirectiveOptions, GraphQLDirective, Maybe, PageSection } from "@graphql-markdown/types";
9
9
  /**
10
10
  * Prints metadata information for a GraphQL directive, focusing on its arguments.
11
11
  *
12
12
  * @param type - The GraphQL directive to process
13
13
  * @param options - Configuration options for printing directive metadata
14
- * @returns Formatted metadata string in MDX format or empty string if no arguments
14
+ * @returns An "Arguments" PageSection, or undefined when no arguments are available
15
15
  */
16
- export declare const printDirectiveMetadata: (type: GraphQLDirective, options: PrintDirectiveOptions) => string | MDXString;
16
+ export declare const printDirectiveMetadata: (type: GraphQLDirective, options: PrintDirectiveOptions) => Maybe<PageSection>;
17
17
  /**
18
18
  * Generates a string representation of a complete GraphQL directive definition.
19
19
  *
@@ -21,5 +21,5 @@ export declare const printDirectiveMetadata: (type: GraphQLDirective, options: P
21
21
  * @param options - Configuration options for printing the directive (optional)
22
22
  * @returns A formatted string containing the complete directive definition
23
23
  */
24
- export declare const printCodeDirective: (type: GraphQLDirective, options?: PrintDirectiveOptions | undefined) => string;
24
+ export declare const printCodeDirective: (type: GraphQLDirective, options?: PrintDirectiveOptions) => string;
25
25
  //# sourceMappingURL=directive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../src/graphql/directive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,EACV,MAAM,yBAAyB,CAAC;AA4BjC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,gFASlC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,iFAU9B,CAAC"}
1
+ {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../src/graphql/directive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACZ,MAAM,yBAAyB,CAAC;AA4BjC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,SAC3B,gBAAgB,WACb,qBAAqB,KAC7B,KAAK,CAAC,WAAW,CAMnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SACvB,gBAAgB,YAEZ,qBAAqB,KAC9B,MAMF,CAAC"}
@@ -18,7 +18,7 @@ const code_1 = require("../code");
18
18
  * @returns A formatted string of directive locations or empty string if no locations defined
19
19
  */
20
20
  const printCodeDirectiveLocation = (type) => {
21
- if (type.locations === undefined || type.locations.length === 0) {
21
+ if (type.locations.length === 0) {
22
22
  return "";
23
23
  }
24
24
  let code = ` on `;
@@ -34,11 +34,11 @@ const printCodeDirectiveLocation = (type) => {
34
34
  *
35
35
  * @param type - The GraphQL directive to process
36
36
  * @param options - Configuration options for printing directive metadata
37
- * @returns Formatted metadata string in MDX format or empty string if no arguments
37
+ * @returns An "Arguments" PageSection, or undefined when no arguments are available
38
38
  */
39
39
  const printDirectiveMetadata = (type, options) => {
40
40
  if (!("args" in type)) {
41
- return "";
41
+ return undefined;
42
42
  }
43
43
  return (0, section_1.printMetadataSection)(type, type.args, "Arguments", options);
44
44
  };
@@ -2,15 +2,15 @@
2
2
  * Provides utilities for printing GraphQL enum types to Markdown/MDX format
3
3
  * @module
4
4
  */
5
- import type { MDXString, PrintTypeOptions } from "@graphql-markdown/types";
5
+ import type { Maybe, PageSection, PrintTypeOptions } from "@graphql-markdown/types";
6
6
  /**
7
7
  * Prints the metadata section for a GraphQL enum type.
8
8
  *
9
9
  * @param type - The GraphQL enum type to process
10
10
  * @param options - Options for printing the type
11
- * @returns A string containing the metadata section in MDX format, or empty string if type is not an enum
11
+ * @returns A "Values" PageSection, or undefined when `type` is not an enum
12
12
  */
13
- export declare const printEnumMetadata: (type: unknown, options: PrintTypeOptions) => string | MDXString;
13
+ export declare const printEnumMetadata: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection>;
14
14
  /**
15
15
  * Generates a GraphQL SDL code block for an enum type.
16
16
  *
@@ -18,5 +18,5 @@ export declare const printEnumMetadata: (type: unknown, options: PrintTypeOption
18
18
  * @param options - Optional printing options that control directive handling
19
19
  * @returns A string containing the enum type definition in GraphQL SDL, or empty string if type is not an enum
20
20
  */
21
- export declare const printCodeEnum: (type: unknown, options?: PrintTypeOptions | undefined) => string;
21
+ export declare const printCodeEnum: (type: unknown, options?: PrintTypeOptions) => string;
22
22
  //# sourceMappingURL=enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/graphql/enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAY3E;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kEAS7B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,mEA0BzB,CAAC"}
1
+ {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/graphql/enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAYjC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,SACtB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CAMnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAClB,OAAO,YACH,gBAAgB,KACzB,MAuBF,CAAC"}
@@ -14,11 +14,11 @@ const link_1 = require("../link");
14
14
  *
15
15
  * @param type - The GraphQL enum type to process
16
16
  * @param options - Options for printing the type
17
- * @returns A string containing the metadata section in MDX format, or empty string if type is not an enum
17
+ * @returns A "Values" PageSection, or undefined when `type` is not an enum
18
18
  */
19
19
  const printEnumMetadata = (type, options) => {
20
20
  if (!(0, graphql_1.isEnumType)(type)) {
21
- return "";
21
+ return undefined;
22
22
  }
23
23
  return (0, section_1.printMetadataSection)(type, type.getValues(), "Values", options);
24
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/graphql/input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,OAAO,EAAE,mBAAmB,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,sDAK1B,CAAC"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/graphql/input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,OAAO,EAAE,mBAAmB,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,SACnB,OAAO,WACJ,gBAAgB,KACxB,MAEF,CAAC"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.printCodeInput = exports.printInputMetadata = void 0;
4
4
  const object_1 = require("./object");
5
- const object_2 = require("./object");
5
+ var object_2 = require("./object");
6
6
  Object.defineProperty(exports, "printInputMetadata", { enumerable: true, get: function () { return object_2.printObjectMetadata; } });
7
7
  /**
8
8
  * Renders the Markdown code snippet for a GraphQL `input` type by delegating
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/graphql/interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE;;;GAGG;AACH,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,sDAK9B,CAAC"}
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/graphql/interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE;;;GAGG;AACH,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,WACJ,gBAAgB,KACxB,MAEF,CAAC"}
@@ -10,7 +10,7 @@ const object_1 = require("./object");
10
10
  * Prints metadata for a GraphQL interface type.
11
11
  * This is an alias for {@link printObjectMetadata}.
12
12
  */
13
- const object_2 = require("./object");
13
+ var object_2 = require("./object");
14
14
  Object.defineProperty(exports, "printInterfaceMetadata", { enumerable: true, get: function () { return object_2.printObjectMetadata; } });
15
15
  /**
16
16
  * Generates a code block representation of a GraphQL interface type.
@@ -2,14 +2,14 @@
2
2
  * GraphQL Object Type printing utilities
3
3
  * @module
4
4
  */
5
- import type { PrintTypeOptions } from "@graphql-markdown/types";
5
+ import type { Maybe, PageSection, PrintTypeOptions } from "@graphql-markdown/types";
6
6
  /**
7
7
  * Prints the complete metadata section for a GraphQL object type
8
8
  * @param type - The GraphQL type object to process
9
9
  * @param options - Printing options
10
- * @returns Markdown formatted string containing fields and interfaces metadata
10
+ * @returns Ordered metadata sections for fields and interfaces
11
11
  */
12
- export declare const printObjectMetadata: (type: unknown, options: PrintTypeOptions) => string;
12
+ export declare const printObjectMetadata: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection[]>;
13
13
  /**
14
14
  * Prints the GraphQL type definition as a code block
15
15
  * @param type - The GraphQL type object to process
@@ -1 +1 @@
1
- {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/graphql/object.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AA8BhE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sDAa/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,sEAgCzB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,sDAK3B,CAAC"}
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/graphql/object.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AA8BjC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SACxB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,EAAE,CAUrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAClB,OAAO,UACL,MAAM,WACL,gBAAgB,KACxB,MA4BF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SACpB,OAAO,WACJ,gBAAgB,KACxB,MAEF,CAAC"}
@@ -13,14 +13,14 @@ const strings_1 = require("../const/strings");
13
13
  * Prints the metadata section for interfaces implemented by a GraphQL type
14
14
  * @param type - The GraphQL type object to process
15
15
  * @param options - Printing options
16
- * @returns Markdown formatted string of implemented interfaces
16
+ * @returns An "Interfaces" PageSection, or undefined when the type has no interfaces
17
17
  */
18
18
  const printImplementedInterfaceMetadata = (type, options) => {
19
19
  if (typeof type !== "object" ||
20
20
  type === null ||
21
21
  !("getInterfaces" in type) ||
22
22
  typeof type.getInterfaces !== "function") {
23
- return "";
23
+ return undefined;
24
24
  }
25
25
  return (0, section_1.printSection)(type.getInterfaces(), "Interfaces", options);
26
26
  };
@@ -28,12 +28,12 @@ const printImplementedInterfaceMetadata = (type, options) => {
28
28
  * Prints the complete metadata section for a GraphQL object type
29
29
  * @param type - The GraphQL type object to process
30
30
  * @param options - Printing options
31
- * @returns Markdown formatted string containing fields and interfaces metadata
31
+ * @returns Ordered metadata sections for fields and interfaces
32
32
  */
33
33
  const printObjectMetadata = (type, options) => {
34
34
  const interfaceMeta = printImplementedInterfaceMetadata(type, options);
35
35
  const metadata = (0, section_1.printMetadataSection)(type, (0, graphql_1.getFields)(type), "Fields", options);
36
- return `${metadata}${interfaceMeta}`;
36
+ return [metadata, interfaceMeta].filter(Boolean);
37
37
  };
38
38
  exports.printObjectMetadata = printObjectMetadata;
39
39
  /**
@@ -3,24 +3,16 @@
3
3
  * Provides utilities to print operation types, metadata, and code representations.
4
4
  * @module
5
5
  */
6
- import type { PrintTypeOptions, MDXString } from "@graphql-markdown/types";
7
- /**
8
- * Prints the operation type information.
9
- * @param type - The operation type to print
10
- * @param options - Print type options for customizing output
11
- * @returns Formatted string representation of the operation type or empty string if invalid
12
- */
13
- export declare const printOperationType: (type: unknown, options: PrintTypeOptions) => string | MDXString;
6
+ import type { PrintTypeOptions, MDXString, Maybe, PageSection } from "@graphql-markdown/types";
14
7
  /**
15
8
  * Prints the operation metadata including arguments and type information.
16
9
  * @param type - The operation type to print metadata for
17
10
  * @param options - Print type options for customizing output
18
- * @returns Formatted string containing operation metadata or empty string if invalid
11
+ * @returns Ordered operation metadata sections, or undefined when `type` is not an operation
19
12
  */
20
- export declare const printOperationMetadata: (type: unknown, options: PrintTypeOptions) => string | MDXString;
13
+ export declare const printOperationMetadata: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection[]>;
21
14
  /**
22
15
  * Prints the code representation of an operation.
23
- * @see printCodeField
24
16
  */
25
- export { printCodeField as printCodeOperation } from "../code";
17
+ export declare const printCodeOperation: (type: unknown, options?: PrintTypeOptions) => MDXString | string;
26
18
  //# sourceMappingURL=operation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/graphql/operation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAI3E;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,kEAa9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,kEAYlC,CAAC;AAEF;;;GAGG;AACH,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/graphql/operation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,WAAW,EACZ,MAAM,yBAAyB,CAAC;AA2BjC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAC3B,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,EAAE,CASrB,CAAC;AAkCF;;GAEG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,YACH,gBAAgB,KACzB,SAAS,GAAG,MAWd,CAAC"}
@@ -5,18 +5,20 @@
5
5
  * @module
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.printCodeOperation = exports.printOperationMetadata = exports.printOperationType = void 0;
8
+ exports.printCodeOperation = exports.printOperationMetadata = void 0;
9
9
  const graphql_1 = require("@graphql-markdown/graphql");
10
+ const strings_1 = require("../const/strings");
11
+ const code_1 = require("../code");
10
12
  const section_1 = require("../section");
11
13
  /**
12
14
  * Prints the operation type information.
13
15
  * @param type - The operation type to print
14
16
  * @param options - Print type options for customizing output
15
- * @returns Formatted string representation of the operation type or empty string if invalid
17
+ * @returns A "Type" PageSection, or undefined when `type` is not an operation
16
18
  */
17
19
  const printOperationType = (type, options) => {
18
20
  if (!(0, graphql_1.isOperation)(type)) {
19
- return "";
21
+ return undefined;
20
22
  }
21
23
  const queryType = (0, graphql_1.getTypeName)(type.type).replaceAll(/[![\]]*/g, "");
22
24
  return (0, section_1.printSection)([options.schema.getType(queryType)], "Type", {
@@ -24,25 +26,55 @@ const printOperationType = (type, options) => {
24
26
  parentTypePrefix: false,
25
27
  });
26
28
  };
27
- exports.printOperationType = printOperationType;
28
29
  /**
29
30
  * Prints the operation metadata including arguments and type information.
30
31
  * @param type - The operation type to print metadata for
31
32
  * @param options - Print type options for customizing output
32
- * @returns Formatted string containing operation metadata or empty string if invalid
33
+ * @returns Ordered operation metadata sections, or undefined when `type` is not an operation
33
34
  */
34
35
  const printOperationMetadata = (type, options) => {
35
36
  if (!(0, graphql_1.isOperation)(type)) {
36
- return "";
37
+ return undefined;
37
38
  }
38
- const response = (0, exports.printOperationType)(type, options);
39
+ const response = printOperationType(type, options);
39
40
  const metadata = (0, section_1.printMetadataSection)(type, type.args, "Arguments", options);
40
- return `${metadata}${response}`;
41
+ return [metadata, response].filter(Boolean);
41
42
  };
42
43
  exports.printOperationMetadata = printOperationMetadata;
44
+ /**
45
+ * Wraps a GraphQL operation snippet in one or more namespace blocks.
46
+ */
47
+ const wrapOperationCodeWithNamespaces = (operationCode, operationNamespaceParts) => {
48
+ if (operationNamespaceParts.length === 0 || operationCode.trim() === "") {
49
+ return operationCode;
50
+ }
51
+ let lines = operationCode
52
+ .trimEnd()
53
+ .split(strings_1.MARKDOWN_EOL)
54
+ .filter((line) => {
55
+ return line.length > 0;
56
+ });
57
+ for (let i = operationNamespaceParts.length - 1; i >= 0; i -= 1) {
58
+ const namespace = operationNamespaceParts[i];
59
+ lines = [
60
+ `${namespace} {`,
61
+ ...lines.map((line) => {
62
+ return `${strings_1.MARKDOWN_CODE_INDENTATION}${line}`;
63
+ }),
64
+ `}`,
65
+ ];
66
+ }
67
+ return `${lines.join(strings_1.MARKDOWN_EOL)}${strings_1.MARKDOWN_EOL}`;
68
+ };
43
69
  /**
44
70
  * Prints the code representation of an operation.
45
- * @see printCodeField
46
71
  */
47
- const code_1 = require("../code");
48
- Object.defineProperty(exports, "printCodeOperation", { enumerable: true, get: function () { return code_1.printCodeField; } });
72
+ const printCodeOperation = (type, options) => {
73
+ const code = (0, code_1.printCodeField)(type, options);
74
+ if (!Array.isArray(options?.operationNamespaceParts) ||
75
+ options.operationNamespaceParts.length === 0) {
76
+ return code;
77
+ }
78
+ return wrapOperationCodeWithNamespaces(code, options.operationNamespaceParts);
79
+ };
80
+ exports.printCodeOperation = printCodeOperation;
@@ -2,27 +2,27 @@
2
2
  * Provides utility functions for handling GraphQL scalar types in markdown generation.
3
3
  * @module
4
4
  */
5
- import type { PrintTypeOptions, MDXString } from "@graphql-markdown/types";
5
+ import type { PrintTypeOptions, PageSection, Maybe } from "@graphql-markdown/types";
6
6
  /**
7
7
  * Generates markdown documentation for a scalar type's specification URL.
8
8
  * @param type - The GraphQL scalar type object
9
9
  * @param options - Options for printing type information
10
- * @returns Markdown string containing the specification link, or empty string if no URL exists
10
+ * @returns A specification PageSection, or undefined when no URL exists
11
11
  */
12
- export declare const printSpecification: (type: unknown, options: PrintTypeOptions) => string | MDXString;
12
+ export declare const printSpecification: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection>;
13
13
  /**
14
14
  * Prints metadata information for a scalar type.
15
15
  * Currently only includes the specification URL if available.
16
16
  * @param type - The GraphQL scalar type object
17
17
  * @param options - Options for printing type information
18
- * @returns Markdown string containing the scalar metadata
18
+ * @returns A scalar metadata PageSection, or undefined when not available
19
19
  */
20
- export declare const printScalarMetadata: (type: unknown, options: PrintTypeOptions) => string | MDXString;
20
+ export declare const printScalarMetadata: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection>;
21
21
  /**
22
22
  * Generates the GraphQL SDL representation of a scalar type.
23
23
  * @param type - The GraphQL scalar type object
24
24
  * @param options - Options for printing type information (unused)
25
25
  * @returns SDL string representation of the scalar type
26
26
  */
27
- export declare const printCodeScalar: (type: unknown, options?: PrintTypeOptions | undefined) => string;
27
+ export declare const printCodeScalar: (type: unknown, options?: PrintTypeOptions) => string;
28
28
  //# sourceMappingURL=scalar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scalar.d.ts","sourceRoot":"","sources":["../../src/graphql/scalar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAO3E;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,kEAiB9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,kEAK/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,mEAK3B,CAAC"}
1
+ {"version":3,"file":"scalar.d.ts","sourceRoot":"","sources":["../../src/graphql/scalar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,KAAK,EACN,MAAM,yBAAyB,CAAC;AAIjC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CAgBnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,SACxB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CAEnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SACpB,OAAO,YACH,gBAAgB,KACzB,MAEF,CAAC"}
@@ -2,24 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.printCodeScalar = exports.printScalarMetadata = exports.printSpecification = void 0;
4
4
  const graphql_1 = require("@graphql-markdown/graphql");
5
- const strings_1 = require("../const/strings");
6
- const options_1 = require("../const/options");
7
5
  /**
8
6
  * Generates markdown documentation for a scalar type's specification URL.
9
7
  * @param type - The GraphQL scalar type object
10
8
  * @param options - Options for printing type information
11
- * @returns Markdown string containing the specification link, or empty string if no URL exists
9
+ * @returns A specification PageSection, or undefined when no URL exists
12
10
  */
13
11
  const printSpecification = (type, options) => {
14
12
  if (typeof type !== "object" ||
15
13
  type === null ||
16
14
  !("specifiedByURL" in type) ||
17
15
  typeof type.specifiedByURL !== "string") {
18
- return "";
16
+ return undefined;
19
17
  }
20
18
  const url = type.specifiedByURL;
21
- // Needs newline between "export const specifiedByLinkCss" and markdown header to prevent compilation error in docusaurus
22
- return `${options_1.SectionLevels.LEVEL.repeat(3)} ${options.formatMDXSpecifiedByLink(url)}${strings_1.MARKDOWN_EOP}`;
19
+ return {
20
+ title: options.formatMDXSpecifiedByLink(url),
21
+ level: 3,
22
+ };
23
23
  };
24
24
  exports.printSpecification = printSpecification;
25
25
  /**
@@ -27,7 +27,7 @@ exports.printSpecification = printSpecification;
27
27
  * Currently only includes the specification URL if available.
28
28
  * @param type - The GraphQL scalar type object
29
29
  * @param options - Options for printing type information
30
- * @returns Markdown string containing the scalar metadata
30
+ * @returns A scalar metadata PageSection, or undefined when not available
31
31
  */
32
32
  const printScalarMetadata = (type, options) => {
33
33
  return (0, exports.printSpecification)(type, options);
@@ -2,19 +2,19 @@
2
2
  * Module for handling GraphQL Union type printing operations.
3
3
  * @module
4
4
  */
5
- import type { PrintTypeOptions, MDXString } from "@graphql-markdown/types";
5
+ import type { PrintTypeOptions, PageSection, Maybe } from "@graphql-markdown/types";
6
6
  /**
7
7
  * Generates metadata documentation for a GraphQL Union type.
8
8
  * @param type - The GraphQL type to process
9
9
  * @param options - Configuration options for printing
10
- * @returns Formatted MDX string containing the union type's possible types
10
+ * @returns A "Possible types" PageSection, or undefined when `type` is not a union
11
11
  */
12
- export declare const printUnionMetadata: (type: unknown, options: PrintTypeOptions) => string | MDXString;
12
+ export declare const printUnionMetadata: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection>;
13
13
  /**
14
14
  * Generates GraphQL SDL code representation of a Union type.
15
15
  * @param type - The GraphQL type to process
16
16
  * @param options - Configuration options for printing (unused)
17
17
  * @returns SDL string representation of the union type
18
18
  */
19
- export declare const printCodeUnion: (type: unknown, options?: PrintTypeOptions | undefined) => string;
19
+ export declare const printCodeUnion: (type: unknown, options?: PrintTypeOptions) => string;
20
20
  //# sourceMappingURL=union.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/graphql/union.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EAEV,MAAM,yBAAyB,CAAC;AAMjC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,kEAY9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,mEAiB1B,CAAC"}
1
+ {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/graphql/union.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,KAAK,EACN,MAAM,yBAAyB,CAAC;AAMjC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CASnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,SACnB,OAAO,YACH,gBAAgB,KACzB,MAcF,CAAC"}
@@ -11,11 +11,11 @@ const section_1 = require("../section");
11
11
  * Generates metadata documentation for a GraphQL Union type.
12
12
  * @param type - The GraphQL type to process
13
13
  * @param options - Configuration options for printing
14
- * @returns Formatted MDX string containing the union type's possible types
14
+ * @returns A "Possible types" PageSection, or undefined when `type` is not a union
15
15
  */
16
16
  const printUnionMetadata = (type, options) => {
17
17
  if (!(0, graphql_1.isUnionType)(type)) {
18
- return "";
18
+ return undefined;
19
19
  }
20
20
  return (0, section_1.printSection)(type.getTypes(), "Possible types", {
21
21
  ...options,
package/dist/group.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Utility module for handling GraphQL schema entity grouping.
3
3
  * @module
4
4
  */
5
- import type { SchemaEntity, Maybe } from "@graphql-markdown/types";
5
+ import type { SchemaEntitiesGroupMap, SchemaEntity, Maybe } from "@graphql-markdown/types";
6
6
  /**
7
7
  * Retrieves the group name for a given GraphQL type based on its category and group mapping.
8
8
  *
@@ -11,5 +11,5 @@ import type { SchemaEntity, Maybe } from "@graphql-markdown/types";
11
11
  * @param typeCategory - The category of the schema entity
12
12
  * @returns The slugified group name or empty string if no group is found
13
13
  */
14
- export declare const getGroup: (type: unknown, groups: Maybe<Partial<Record<SchemaEntity, Record<string, Maybe<string>>>>>, typeCategory: Maybe<SchemaEntity>) => string;
14
+ export declare const getGroup: (type: unknown, groups: Maybe<SchemaEntitiesGroupMap>, typeCategory: Maybe<SchemaEntity>) => string;
15
15
  //# sourceMappingURL=group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAEV,YAAY,EAEZ,KAAK,EACN,MAAM,yBAAyB,CAAC;AAMjC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,2IA+BpB,CAAC"}
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EAEZ,KAAK,EACN,MAAM,yBAAyB,CAAC;AAMjC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,SACb,OAAO,UACL,KAAK,CAAC,sBAAsB,CAAC,gBACvB,KAAK,CAAC,YAAY,CAAC,KAChC,MAyBF,CAAC"}