@cyberskill/shared 1.216.0 → 2.0.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 (93) hide show
  1. package/README.md +330 -222
  2. package/dist/config/config.util.d.ts +17 -0
  3. package/dist/config/env/env.util.d.ts +26 -0
  4. package/dist/config/eslint/index.d.ts +4 -0
  5. package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -1
  6. package/dist/config/graphql-codegen/graphql-codegen.util.d.ts +23 -0
  7. package/dist/config/graphql-codegen/graphql-codegen.util.js +2 -1
  8. package/dist/config/vitest/vitest.e2e.cjs +1 -1
  9. package/dist/config/vitest/vitest.e2e.d.ts +16 -0
  10. package/dist/config/vitest/vitest.e2e.js +1 -1
  11. package/dist/config/vitest/vitest.unit.cjs +1 -1
  12. package/dist/config/vitest/vitest.unit.d.ts +18 -0
  13. package/dist/config/vitest/vitest.unit.js +1 -1
  14. package/dist/constant/common.d.ts +4 -0
  15. package/dist/constant/index.d.ts +3 -0
  16. package/dist/node/apollo-server/apollo-server.util.d.ts +15 -1
  17. package/dist/node/apollo-server/index.cjs +1 -1
  18. package/dist/node/apollo-server/index.js +1 -1
  19. package/dist/node/command/command.type.d.ts +26 -6
  20. package/dist/node/command/command.util.d.ts +50 -0
  21. package/dist/node/express/express.util.cjs +1 -1
  22. package/dist/node/express/express.util.d.ts +47 -0
  23. package/dist/node/express/express.util.js +9 -9
  24. package/dist/node/fs/fs.type.d.ts +6 -0
  25. package/dist/node/fs/fs.util.d.ts +48 -1
  26. package/dist/node/log/log.type.d.ts +6 -1
  27. package/dist/node/log/log.util.cjs +1 -1
  28. package/dist/node/log/log.util.d.ts +30 -2
  29. package/dist/node/log/log.util.js +33 -20
  30. package/dist/node/mongo/mongo.constant.d.ts +5 -0
  31. package/dist/node/mongo/mongo.type.d.ts +4 -4
  32. package/dist/node/mongo/mongo.util.cjs +5 -5
  33. package/dist/node/mongo/mongo.util.d.ts +337 -3
  34. package/dist/node/mongo/mongo.util.js +406 -79
  35. package/dist/node/package/package.type.d.ts +2 -2
  36. package/dist/node/package/package.util.cjs +1 -1
  37. package/dist/node/package/package.util.d.ts +52 -1
  38. package/dist/node/package/package.util.js +97 -92
  39. package/dist/node/path/path.constant.d.ts +9 -0
  40. package/dist/node/path/path.util.d.ts +24 -0
  41. package/dist/node/storage/storage.util.d.ts +44 -0
  42. package/dist/node/storage/storage.util.js +39 -0
  43. package/dist/node/upload/upload.util.d.ts +21 -0
  44. package/dist/node/ws/ts.util.d.ts +16 -0
  45. package/dist/react/apollo-client/apollo-client.component.d.ts +19 -1
  46. package/dist/react/apollo-client/apollo-client.component.js +1 -4
  47. package/dist/react/apollo-client/apollo-client.constant.d.ts +5 -0
  48. package/dist/react/apollo-client/apollo-client.context.d.ts +15 -0
  49. package/dist/react/apollo-client/apollo-client.hook.d.ts +12 -0
  50. package/dist/react/apollo-client/apollo-client.util.d.ts +48 -0
  51. package/dist/react/apollo-client/apollo-client.util.js +9 -0
  52. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +19 -1
  53. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +1 -4
  54. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +10 -0
  55. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.d.ts +10 -0
  56. package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
  57. package/dist/react/apollo-error/apollo-error.component.d.ts +17 -0
  58. package/dist/react/apollo-error/apollo-error.component.js +10 -10
  59. package/dist/react/apollo-error/apollo-error.hook.d.ts +12 -0
  60. package/dist/react/apollo-error/apollo-error.provider.d.ts +15 -0
  61. package/dist/react/apollo-error/apollo-error.util.d.ts +17 -0
  62. package/dist/react/i18next/i18next.hook.d.ts +9 -0
  63. package/dist/react/i18next/i18next.util.d.ts +10 -0
  64. package/dist/react/loading/loading.component.d.ts +21 -0
  65. package/dist/react/loading/loading.hook.d.ts +12 -0
  66. package/dist/react/loading/loading.provider.d.ts +15 -0
  67. package/dist/react/log/log.util.d.ts +17 -0
  68. package/dist/react/next-intl/next-intl.constant.d.ts +9 -0
  69. package/dist/react/next-intl/next-intl.hoc.d.ts +16 -0
  70. package/dist/react/next-intl/next-intl.hook.d.ts +21 -0
  71. package/dist/react/next-intl/next-intl.provider.d.ts +21 -0
  72. package/dist/react/storage/storage.hook.d.ts +19 -0
  73. package/dist/react/storage/storage.hook.js +28 -30
  74. package/dist/react/storage/storage.util.d.ts +39 -0
  75. package/dist/react/storage/storage.util.js +33 -0
  76. package/dist/react/userback/userback.component.d.ts +18 -0
  77. package/dist/typescript/common.type.d.ts +6 -0
  78. package/dist/typescript/index.d.ts +3 -0
  79. package/dist/util/common/common.util.d.ts +19 -7
  80. package/dist/util/common/index.d.ts +3 -0
  81. package/dist/util/index.d.ts +3 -0
  82. package/dist/util/object/object.util.d.ts +25 -12
  83. package/dist/util/serializer/serializer.type.d.ts +1 -1
  84. package/dist/util/serializer/serializer.util.d.ts +8 -0
  85. package/dist/util/serializer/serializer.util.js +4 -4
  86. package/dist/util/string/string.util.cjs +1 -1
  87. package/dist/util/string/string.util.d.ts +30 -17
  88. package/dist/util/string/string.util.js +14 -16
  89. package/dist/util/validate/validate.util.d.ts +9 -3
  90. package/dist/util/validate/validate.util.js +5 -3
  91. package/package.json +21 -18
  92. /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.13_@vitest_browser@3.2.4_jiti@2.4.2_j_cac3da623d5688a51c0b1a2270e144db → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.15_@vitest_browser@3.2.4_jiti@2.4.2_j_e4a333d8aa4b05d17db10875e249d94f}/node_modules/vitest/dist/config.cjs +0 -0
  93. /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.13_@vitest_browser@3.2.4_jiti@2.4.2_j_cac3da623d5688a51c0b1a2270e144db → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.15_@vitest_browser@3.2.4_jiti@2.4.2_j_e4a333d8aa4b05d17db10875e249d94f}/node_modules/vitest/dist/config.js +0 -0
@@ -1,3 +1,21 @@
1
1
  import { default as React } from 'react';
2
2
  import { I_ApolloProviderProps } from './apollo-client.type.js';
3
- export declare function ApolloProvider({ options, children, }: I_ApolloProviderProps): React.JSX.Element;
3
+ /**
4
+ * Apollo Provider component that wraps the application with Apollo Client context.
5
+ * This component provides the Apollo Client instance to all child components,
6
+ * enabling GraphQL operations throughout the component tree. It includes
7
+ * error handling and toast integration for a complete GraphQL experience.
8
+ *
9
+ * Features:
10
+ * - Apollo Client context provision
11
+ * - Error boundary integration
12
+ * - Toast notification support
13
+ * - Automatic error handling
14
+ * - Development and production optimizations
15
+ *
16
+ * @param props - Component props containing options and children.
17
+ * @param props.options - Apollo Client configuration options.
18
+ * @param props.children - React children that will have access to Apollo Client context.
19
+ * @returns A React component that provides Apollo Client context to its children.
20
+ */
21
+ export declare function ApolloProvider({ options, children }: I_ApolloProviderProps): React.JSX.Element;
@@ -5,10 +5,7 @@ import { getClient as i } from "./apollo-client.util.js";
5
5
  import { ApolloErrorProvider as p } from "../apollo-error/apollo-error.provider.js";
6
6
  import { ApolloErrorComponent as a } from "../apollo-error/apollo-error.component.js";
7
7
  import { Toaster as c } from "react-hot-toast";
8
- function s({
9
- options: e,
10
- children: t
11
- }) {
8
+ function s({ options: e, children: t }) {
12
9
  const o = m(
13
10
  () => i(e || {}),
14
11
  [e]
@@ -1 +1,6 @@
1
+ /**
2
+ * Default GraphQL endpoint URI for Apollo Client configuration.
3
+ * This constant provides the standard GraphQL endpoint path that is commonly used
4
+ * in web applications for GraphQL API communication.
5
+ */
1
6
  export declare const GRAPHQL_URI_DEFAULT = "/graphql";
@@ -1,6 +1,21 @@
1
1
  import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
2
2
  import { default as React } from 'react';
3
+ /**
4
+ * React context for providing Apollo Client instance to child components.
5
+ * This context allows components to access the Apollo Client instance without
6
+ * prop drilling, enabling direct access to client methods and cache operations.
7
+ */
3
8
  declare const ApolloClientContext: React.Context<ApolloClient<NormalizedCacheObject> | null>;
9
+ /**
10
+ * Provider component that makes Apollo Client available to the component tree.
11
+ * This component wraps the Apollo Client instance in a React context, allowing
12
+ * any child component to access the client using the useApolloClient hook.
13
+ *
14
+ * @param props - Component props containing client and children.
15
+ * @param props.client - The Apollo Client instance to provide to the component tree.
16
+ * @param props.children - React children that will have access to the Apollo Client context.
17
+ * @returns A React component that provides Apollo Client context to its children.
18
+ */
4
19
  export declare function ApolloClientProvider({ client, children, }: {
5
20
  client: ApolloClient<NormalizedCacheObject>;
6
21
  children: React.ReactNode;
@@ -1,2 +1,14 @@
1
1
  import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
2
+ /**
3
+ * React hook that provides access to the Apollo Client instance.
4
+ * This hook retrieves the Apollo Client from the React context and provides
5
+ * a convenient way to access client methods, cache operations, and other
6
+ * Apollo Client functionality within components.
7
+ *
8
+ * The hook will throw an error if used outside of an ApolloClientProvider,
9
+ * ensuring proper context usage and providing clear error messages for debugging.
10
+ *
11
+ * @returns The Apollo Client instance from the nearest ApolloClientProvider context.
12
+ * @throws {Error} When used outside of an ApolloClientProvider context.
13
+ */
2
14
  export declare function useApolloClient(): ApolloClient<NormalizedCacheObject>;
@@ -3,9 +3,57 @@ import { Observable } from '@apollo/client/utilities';
3
3
  import { ApolloClient } from '@apollo/client/core/core.cjs';
4
4
  import { ApolloLink } from '@apollo/client/link/core/core.cjs';
5
5
  import { I_ApolloOptions } from './apollo-client.type.js';
6
+ /**
7
+ * Custom Apollo Link for development logging of GraphQL operations.
8
+ * This link intercepts GraphQL operations and logs detailed information about
9
+ * each request including operation name, duration, and request count for debugging
10
+ * and performance monitoring purposes.
11
+ *
12
+ * Features:
13
+ * - Request counting for tracking operation frequency
14
+ * - Duration measurement for performance analysis
15
+ * - Operation name logging for easy identification
16
+ * - Development-only logging to avoid production noise
17
+ */
6
18
  export declare class DevLoggerLink extends ApolloLink {
7
19
  private count;
20
+ /**
21
+ * Intercepts and logs GraphQL operations during development.
22
+ * This method wraps each GraphQL operation with timing and logging functionality,
23
+ * providing insights into operation performance and frequency.
24
+ *
25
+ * @param operation - The GraphQL operation to be logged and executed.
26
+ * @param forward - Function to forward the operation to the next link in the chain.
27
+ * @returns An observable that emits the operation result with logging side effects.
28
+ */
8
29
  request(operation: Operation, forward: (op: Operation) => Observable<FetchResult>): Observable<FetchResult>;
9
30
  }
31
+ /**
32
+ * Creates a comprehensive Apollo Link chain with all necessary middleware.
33
+ * This function sets up a complete Apollo Link chain including error handling,
34
+ * logging, file uploads, WebSocket subscriptions, and custom links. The chain
35
+ * is configured to handle both HTTP and WebSocket operations with proper routing.
36
+ *
37
+ * The link chain includes:
38
+ * - Development logging for operation tracking
39
+ * - Error handling with user-friendly notifications
40
+ * - Type name removal for cleaner requests
41
+ * - File upload support
42
+ * - WebSocket subscription support
43
+ * - Custom link integration
44
+ *
45
+ * @param options - Configuration options for the Apollo Client including URI, WebSocket URL, and custom links.
46
+ * @returns An array of Apollo Links configured for the specified options.
47
+ */
10
48
  export declare function createApolloLinks(options: I_ApolloOptions): ApolloLink[];
49
+ /**
50
+ * Creates a fully configured Apollo Client instance.
51
+ * This function creates an Apollo Client with all necessary configuration including
52
+ * the link chain, cache, and any additional options provided. The client is ready
53
+ * for immediate use in React applications with comprehensive error handling and
54
+ * development tooling.
55
+ *
56
+ * @param options - Configuration options for the Apollo Client including links, cache, and other settings.
57
+ * @returns A fully configured Apollo Client instance ready for use.
58
+ */
11
59
  export declare function getClient(options?: I_ApolloOptions): ApolloClient<import('@apollo/client').NormalizedCacheObject>;
@@ -23,6 +23,15 @@ class V extends g {
23
23
  constructor() {
24
24
  super(...arguments), J(this, "count", 0);
25
25
  }
26
+ /**
27
+ * Intercepts and logs GraphQL operations during development.
28
+ * This method wraps each GraphQL operation with timing and logging functionality,
29
+ * providing insights into operation performance and frequency.
30
+ *
31
+ * @param operation - The GraphQL operation to be logged and executed.
32
+ * @param forward - Function to forward the operation to the next link in the chain.
33
+ * @returns An observable that emits the operation result with logging side effects.
34
+ */
26
35
  request(e, o) {
27
36
  const m = Date.now();
28
37
  return this.count += 1, o(e).map((u) => {
@@ -1,3 +1,21 @@
1
1
  import { default as React } from 'react';
2
2
  import { I_ApolloProviderProps } from '../apollo-client/index.js';
3
- export declare function ApolloProvider({ options, children, }: I_ApolloProviderProps): React.JSX.Element;
3
+ /**
4
+ * Next.js Apollo Provider component that wraps the application with Apollo Client context.
5
+ * This component provides the Apollo Client instance to all child components,
6
+ * enabling GraphQL operations throughout the component tree. It includes
7
+ * error handling and toast integration for a complete GraphQL experience.
8
+ *
9
+ * Features:
10
+ * - Apollo Client context provision
11
+ * - Error boundary integration
12
+ * - Toast notification support
13
+ * - Automatic error handling
14
+ * - Next.js specific optimizations
15
+ *
16
+ * @param props - Component props containing options and children.
17
+ * @param props.options - Apollo Client configuration options.
18
+ * @param props.children - React children that will have access to Apollo Client context.
19
+ * @returns A React component that provides Apollo Client context to its children.
20
+ */
21
+ export declare function ApolloProvider({ options, children }: I_ApolloProviderProps): React.JSX.Element;
@@ -4,10 +4,7 @@ import { getClient as n } from "./apollo-client-nextjs.util.js";
4
4
  import { ApolloErrorProvider as p } from "../apollo-error/apollo-error.provider.js";
5
5
  import { ApolloErrorComponent as i } from "../apollo-error/apollo-error.component.js";
6
6
  import { Toaster as a } from "react-hot-toast";
7
- function g({
8
- options: r,
9
- children: o
10
- }) {
7
+ function g({ options: r, children: o }) {
11
8
  const t = m(
12
9
  () => () => n(r || {}),
13
10
  [r]
@@ -1,4 +1,14 @@
1
1
  import { I_ApolloOptions } from '../apollo-client/index.js';
2
+ /**
3
+ * Creates a registered Apollo Client factory for Next.js server components.
4
+ * This function creates a client factory that is registered with Next.js for
5
+ * proper server-side rendering support. The factory function ensures that
6
+ * each request gets its own Apollo Client instance, which is essential for
7
+ * SSR compatibility and preventing client state leakage between requests.
8
+ *
9
+ * @param options - Configuration options for the Apollo Client including URI, WebSocket URL, and custom links.
10
+ * @returns A registered Apollo Client factory function that can be used with Next.js server components.
11
+ */
2
12
  export declare const makeClient: (options?: I_ApolloOptions) => {
3
13
  getClient: () => import('@apollo/client-integration-nextjs').ApolloClient<unknown>;
4
14
  query: <T = any, TVariables extends import('@apollo/client').OperationVariables = import('@apollo/client').OperationVariables>(options: import('@apollo/client').QueryOptions<TVariables, T>) => Promise<import('@apollo/client').ApolloQueryResult<import('@apollo/client').MaybeMasked<T>>>;
@@ -1,3 +1,13 @@
1
1
  import { ApolloClient } from '@apollo/client-integration-nextjs';
2
2
  import { I_ApolloOptions } from '../apollo-client/index.js';
3
+ /**
4
+ * Creates a Next.js optimized Apollo Client instance.
5
+ * This function creates an Apollo Client specifically configured for Next.js applications,
6
+ * using the Next.js integration package for proper server-side rendering support.
7
+ * The client includes all standard Apollo features like error handling, logging,
8
+ * file uploads, and WebSocket subscriptions, but is optimized for Next.js environments.
9
+ *
10
+ * @param options - Configuration options for the Apollo Client including URI, WebSocket URL, and custom links.
11
+ * @returns A Next.js optimized Apollo Client instance ready for use in Next.js applications.
12
+ */
3
13
  export declare function getClient(options?: I_ApolloOptions): ApolloClient<unknown>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),c=require("./apollo-error.context.cjs"),t=require("./apollo-error.module.scss.cjs");function m(){const o=e.use(c.ApolloErrorContext),r=o==null?void 0:o.error;if(!r)return null;const l=(s,n)=>n!=null&&n.length?e.createElement("div",null,e.createElement("strong",null,s,":"),e.createElement("ul",null,n.map(a=>e.createElement("li",{key:a.message},a.message)))):null;return e.createElement("div",{className:t.default["modal-backdrop"]},e.createElement("div",{className:t.default["modal-content"]},e.createElement("button",{type:"button",className:t.default["btn-close"],onClick:o.hideError},"✕"),e.createElement("div",{className:t.default["error-title"]},e.createElement("button",{type:"button",className:t.default["btn-retry"],onClick:()=>window.location.reload()},"Reload")," ",r.message),e.createElement("div",{className:t.default["error-details"]},r.networkError&&e.createElement("pre",{className:"network"},e.createElement("strong",null,"Network Error:")," ",r.networkError.message),l("GraphQL Errors",[...r.graphQLErrors]),l("Protocol Errors",[...r.protocolErrors]),l("Client Errors",[...r.clientErrors]),r.extraInfo&&e.createElement("pre",{className:"extra"},e.createElement("strong",null,"Extra Info:")," ",JSON.stringify(r.extraInfo,null,4)))))}exports.ApolloErrorComponent=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),a=require("./apollo-error.context.cjs"),t=require("./apollo-error.module.scss.cjs");function l(o,r){return r!=null&&r.length?e.createElement("div",null,e.createElement("strong",null,o,":"),e.createElement("ul",null,r.map(n=>e.createElement("li",{key:n.message},n.message)))):null}function c(){const o=e.use(a.ApolloErrorContext),r=o==null?void 0:o.error;return r?e.createElement("div",{className:t.default["modal-backdrop"]},e.createElement("div",{className:t.default["modal-content"]},e.createElement("button",{type:"button",className:t.default["btn-close"],onClick:o.hideError},"✕"),e.createElement("div",{className:t.default["error-title"]},e.createElement("button",{type:"button",className:t.default["btn-retry"],onClick:()=>window.location.reload()},"Reload")," ",r.message),e.createElement("div",{className:t.default["error-details"]},r.networkError&&e.createElement("pre",{className:"network"},e.createElement("strong",null,"Network Error:")," ",r.networkError.message),l("GraphQL Errors",[...r.graphQLErrors]),l("Protocol Errors",[...r.protocolErrors]),l("Client Errors",[...r.clientErrors]),r.extraInfo&&e.createElement("pre",{className:"extra"},e.createElement("strong",null,"Extra Info:")," ",JSON.stringify(r.extraInfo,null,4))))):null}exports.ApolloErrorComponent=c;
@@ -1,2 +1,19 @@
1
1
  import { default as React } from 'react';
2
+ /**
3
+ * Apollo Error Component that displays detailed error information in a modal.
4
+ * This component provides a comprehensive error display interface that shows
5
+ * all types of Apollo errors including GraphQL errors, network errors, protocol
6
+ * errors, and client errors. It includes a reload button for recovery and
7
+ * detailed error information for debugging purposes.
8
+ *
9
+ * Features:
10
+ * - Modal overlay with backdrop for focus
11
+ * - Detailed error categorization and display
12
+ * - Reload functionality for error recovery
13
+ * - Close button to dismiss the error modal
14
+ * - Structured display of different error types
15
+ * - Extra information display for debugging
16
+ *
17
+ * @returns A modal component displaying Apollo error details, or null if no error is present.
18
+ */
2
19
  export declare function ApolloErrorComponent(): React.JSX.Element | null;
@@ -1,12 +1,12 @@
1
- import e, { use as c } from "react";
2
- import { ApolloErrorContext as m } from "./apollo-error.context.js";
1
+ import e, { use as a } from "react";
2
+ import { ApolloErrorContext as s } from "./apollo-error.context.js";
3
3
  import t from "./apollo-error.module.scss.js";
4
- function d() {
5
- const o = c(m), r = o == null ? void 0 : o.error;
6
- if (!r)
7
- return null;
8
- const l = (s, n) => n != null && n.length ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", null, s, ":"), /* @__PURE__ */ e.createElement("ul", null, n.map((a) => /* @__PURE__ */ e.createElement("li", { key: a.message }, a.message)))) : null;
9
- return /* @__PURE__ */ e.createElement("div", { className: t["modal-backdrop"] }, /* @__PURE__ */ e.createElement("div", { className: t["modal-content"] }, /* @__PURE__ */ e.createElement(
4
+ function n(o, r) {
5
+ return r != null && r.length ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", null, o, ":"), /* @__PURE__ */ e.createElement("ul", null, r.map((l) => /* @__PURE__ */ e.createElement("li", { key: l.message }, l.message)))) : null;
6
+ }
7
+ function i() {
8
+ const o = a(s), r = o == null ? void 0 : o.error;
9
+ return r ? /* @__PURE__ */ e.createElement("div", { className: t["modal-backdrop"] }, /* @__PURE__ */ e.createElement("div", { className: t["modal-content"] }, /* @__PURE__ */ e.createElement(
10
10
  "button",
11
11
  {
12
12
  type: "button",
@@ -22,8 +22,8 @@ function d() {
22
22
  onClick: () => window.location.reload()
23
23
  },
24
24
  "Reload"
25
- ), " ", r.message), /* @__PURE__ */ e.createElement("div", { className: t["error-details"] }, r.networkError && /* @__PURE__ */ e.createElement("pre", { className: "network" }, /* @__PURE__ */ e.createElement("strong", null, "Network Error:"), " ", r.networkError.message), l("GraphQL Errors", [...r.graphQLErrors]), l("Protocol Errors", [...r.protocolErrors]), l("Client Errors", [...r.clientErrors]), r.extraInfo && /* @__PURE__ */ e.createElement("pre", { className: "extra" }, /* @__PURE__ */ e.createElement("strong", null, "Extra Info:"), " ", JSON.stringify(r.extraInfo, null, 4)))));
25
+ ), " ", r.message), /* @__PURE__ */ e.createElement("div", { className: t["error-details"] }, r.networkError && /* @__PURE__ */ e.createElement("pre", { className: "network" }, /* @__PURE__ */ e.createElement("strong", null, "Network Error:"), " ", r.networkError.message), n("GraphQL Errors", [...r.graphQLErrors]), n("Protocol Errors", [...r.protocolErrors]), n("Client Errors", [...r.clientErrors]), r.extraInfo && /* @__PURE__ */ e.createElement("pre", { className: "extra" }, /* @__PURE__ */ e.createElement("strong", null, "Extra Info:"), " ", JSON.stringify(r.extraInfo, null, 4))))) : null;
26
26
  }
27
27
  export {
28
- d as ApolloErrorComponent
28
+ i as ApolloErrorComponent
29
29
  };
@@ -1 +1,13 @@
1
+ /**
2
+ * React hook that provides access to Apollo error context.
3
+ * This hook retrieves the Apollo error context which contains the current error state
4
+ * and methods to show or hide errors. It provides a convenient way to access error
5
+ * handling functionality within components.
6
+ *
7
+ * The hook will throw an error if used outside of an ApolloErrorProvider,
8
+ * ensuring proper context usage and providing clear error messages for debugging.
9
+ *
10
+ * @returns The Apollo error context containing error state and control methods.
11
+ * @throws {Error} When used outside of an ApolloErrorProvider context.
12
+ */
1
13
  export declare function useApolloError(): import('./apollo-error.type.js').I_ApolloErrorContext;
@@ -1,4 +1,19 @@
1
1
  import { ReactNode, default as React } from 'react';
2
+ /**
3
+ * Provider component that manages Apollo error state and provides error context.
4
+ * This component sets up error handling for Apollo Client operations and provides
5
+ * error state management to all child components through React context.
6
+ *
7
+ * Features:
8
+ * - Global Apollo error state management
9
+ * - Error context provision to child components
10
+ * - Automatic error handling and display
11
+ * - Integration with error boundaries
12
+ *
13
+ * @param props - Component props containing children.
14
+ * @param props.children - React children that will have access to the error context.
15
+ * @returns A React component that provides Apollo error context to its children.
16
+ */
2
17
  export declare function ApolloErrorProvider({ children }: {
3
18
  children: ReactNode;
4
19
  }): React.JSX.Element;
@@ -1,3 +1,20 @@
1
1
  import { ApolloError } from '@apollo/client';
2
+ /**
3
+ * Sets the global callback function for Apollo error handling.
4
+ * This function registers a callback that will be called whenever a global
5
+ * Apollo error needs to be displayed. The callback is typically set by the
6
+ * ApolloErrorProvider component and used throughout the application for
7
+ * consistent error handling.
8
+ *
9
+ * @param callback - The function to be called when a global Apollo error occurs.
10
+ */
2
11
  export declare function setGlobalApolloErrorCallback(callback: (err: ApolloError) => void): void;
12
+ /**
13
+ * Displays a global Apollo error using the registered callback.
14
+ * This function triggers the global error display system by calling the
15
+ * registered callback function. If no callback is registered, the function
16
+ * does nothing, providing safe error handling even when the provider is not set up.
17
+ *
18
+ * @param error - The Apollo error to display globally.
19
+ */
3
20
  export declare function showGlobalApolloError(error: ApolloError): void;
@@ -1,2 +1,11 @@
1
1
  import { useTranslation } from 'react-i18next';
2
+ /**
3
+ * React hook that provides i18next translation functionality.
4
+ * This hook is a wrapper around react-i18next's useTranslation hook,
5
+ * providing access to translation functions and current language information.
6
+ * It enables internationalization features including text translation,
7
+ * language switching, and pluralization support.
8
+ *
9
+ * @returns The useTranslation hook result with translation functions and language information.
10
+ */
2
11
  export declare const useTranslateI18next: typeof useTranslation;
@@ -1,2 +1,12 @@
1
1
  import { InitOptions } from 'i18next';
2
+ /**
3
+ * Initializes i18next with React integration.
4
+ * This function sets up i18next for use with React applications by configuring
5
+ * the react-i18next plugin and initializing the i18next instance with the provided
6
+ * options. It enables internationalization features including translation,
7
+ * language detection, and pluralization rules.
8
+ *
9
+ * @param options - Configuration options for i18next initialization including languages, namespaces, and plugins.
10
+ * @returns A promise that resolves when i18next initialization is complete.
11
+ */
2
12
  export declare function initI18next(options: InitOptions): Promise<import('i18next').TFunction<"translation", undefined>>;
@@ -1,3 +1,24 @@
1
1
  import { default as React } from 'react';
2
2
  import { I_LoadingProps } from './loading.type.js';
3
+ /**
4
+ * Loading component that displays animated loading indicators.
5
+ * This component provides a customizable loading interface with animated rings
6
+ * and optional full-screen overlay. It includes features for preventing user
7
+ * interaction during loading states and supports both inline and full-screen modes.
8
+ *
9
+ * Features:
10
+ * - Animated loading rings with multiple colors
11
+ * - Full-screen overlay mode with scroll prevention
12
+ * - Context menu prevention during full-screen loading
13
+ * - Customizable loading message
14
+ * - Responsive design with CSS modules
15
+ * - Accessibility considerations with reduced motion support
16
+ *
17
+ * @param props - Component props containing loading configuration.
18
+ * @param props.full - Whether to display the loading indicator in full-screen mode (default: false).
19
+ * @param props.className - Additional CSS classes to apply to the loading container.
20
+ * @param props.message - Custom message to display below the loading animation.
21
+ * @param props.rest - Additional props to spread to the loading container.
22
+ * @returns A React component displaying the loading animation with optional full-screen overlay.
23
+ */
3
24
  export declare function Loading({ full, className, message, ...rest }: I_LoadingProps): React.JSX.Element;
@@ -1 +1,13 @@
1
+ /**
2
+ * React hook that provides access to loading context.
3
+ * This hook retrieves the loading context which contains loading state and
4
+ * control methods. It provides a convenient way to access loading functionality
5
+ * within components, allowing them to show and hide loading states.
6
+ *
7
+ * The hook will throw an error if used outside of a LoadingProvider,
8
+ * ensuring proper context usage and providing clear error messages for debugging.
9
+ *
10
+ * @returns The loading context containing loading state and control methods.
11
+ * @throws {Error} When used outside of a LoadingProvider context.
12
+ */
1
13
  export declare function useLoading(): import('./loading.type.js').I_LoadingContext;
@@ -1,3 +1,18 @@
1
1
  import { default as React } from 'react';
2
2
  import { I_Children } from '../../typescript/index.js';
3
+ /**
4
+ * Provider component that manages loading state and provides loading context.
5
+ * This component sets up loading state management for the application and provides
6
+ * loading context to all child components through React context.
7
+ *
8
+ * Features:
9
+ * - Global loading state management
10
+ * - Loading context provision to child components
11
+ * - Automatic loading state synchronization
12
+ * - Integration with loading components
13
+ *
14
+ * @param props - Component props containing children.
15
+ * @param props.children - React children that will have access to the loading context.
16
+ * @returns A React component that provides loading context to its children.
17
+ */
3
18
  export declare function LoadingProvider({ children }: I_Children): React.JSX.Element;
@@ -1,6 +1,23 @@
1
1
  import { I_Log, I_Return } from '../../typescript/index.js';
2
2
  import { I_CatchErrorOptions } from './log.type.js';
3
+ /**
4
+ * Browser-compatible logging interface using consola.
5
+ * This object provides all standard consola logging methods for use in browser environments,
6
+ * including error, warning, info, success, and debug logging capabilities.
7
+ */
3
8
  export declare const log: I_Log;
9
+ /**
10
+ * Catches and handles errors with configurable behavior for React applications.
11
+ * This function provides a standardized way to handle errors in React components
12
+ * with options for logging control, return value specification, and custom callback execution.
13
+ *
14
+ * The function handles different error input types and provides consistent error
15
+ * response formatting for React applications.
16
+ *
17
+ * @param errorInput - The error to catch and handle, can be Error object, string, or unknown type.
18
+ * @param options - Configuration options for error handling behavior.
19
+ * @returns Either the specified return value or a standardized error response object.
20
+ */
4
21
  export declare function catchError<T = unknown>(errorInput: unknown, options: I_CatchErrorOptions & {
5
22
  returnValue: T;
6
23
  }): T;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Default language configuration for Next.js internationalization.
3
+ * This constant provides the default English (US) language settings including:
4
+ * - Language label and value for display and identification
5
+ * - Flag emoji and icon for UI representation
6
+ * - Date-fns locale adapter for date formatting
7
+ * - Number formatting configuration (locale and currency)
8
+ * - Timezone setting for date/time operations
9
+ */
1
10
  export declare const NEXT_INTL_DEFAULT_LANGUAGE: {
2
11
  label: string;
3
12
  value: string;
@@ -1,6 +1,22 @@
1
1
  import { ComponentType, default as React } from 'react';
2
2
  import { I_Children } from '../../typescript/index.js';
3
3
  import { I_NextIntlLanguage, T_NextIntlMessageList } from './next-intl.type.js';
4
+ /**
5
+ * Higher-Order Component (HOC) that wraps components with Next.js internationalization support.
6
+ * This HOC provides internationalization capabilities to React components by wrapping them
7
+ * with the NextIntlClientProvider. It automatically handles language detection, message
8
+ * loading, and timezone configuration based on the current language settings.
9
+ *
10
+ * Features:
11
+ * - Automatic language detection and message loading
12
+ * - Timezone configuration based on language settings
13
+ * - Fallback to default language when messages are missing
14
+ * - Warning logging for missing message configurations
15
+ * - Proper display name preservation for debugging
16
+ *
17
+ * @param Component - The React component to wrap with internationalization support.
18
+ * @returns A new component with internationalization capabilities and additional props for languages and messages.
19
+ */
4
20
  export declare function withNextIntl<T extends I_Children>(Component: ComponentType<T>): {
5
21
  (props: T & {
6
22
  languages: I_NextIntlLanguage[];
@@ -1,4 +1,25 @@
1
1
  import { useTranslations } from 'next-intl';
2
2
  import { I_NextIntlContext } from './next-intl.type.js';
3
+ /**
4
+ * React hook that provides access to Next.js internationalization context.
5
+ * This hook retrieves the Next.js internationalization context which contains
6
+ * language information and language switching functionality. It provides a
7
+ * convenient way to access internationalization features within components.
8
+ *
9
+ * The hook will throw an error if used outside of a NextIntlProvider,
10
+ * ensuring proper context usage and providing clear error messages for debugging.
11
+ *
12
+ * @returns The Next.js internationalization context containing language state and control methods.
13
+ * @throws {Error} When used outside of a NextIntlProvider context.
14
+ */
3
15
  export declare function useNextIntl(): I_NextIntlContext;
16
+ /**
17
+ * React hook that provides Next.js translation functionality.
18
+ * This hook is a wrapper around next-intl's useTranslations hook,
19
+ * providing access to translation functions and current locale information.
20
+ * It enables internationalization features including text translation,
21
+ * locale switching, and pluralization support for Next.js applications.
22
+ *
23
+ * @returns The useTranslations hook result with translation functions and locale information.
24
+ */
4
25
  export declare const useTranslateNextIntl: typeof useTranslations;
@@ -1,3 +1,24 @@
1
1
  import { default as React } from 'react';
2
2
  import { I_NextIntlProviderProps } from './next-intl.type.js';
3
+ /**
4
+ * Provider component that manages Next.js internationalization state and provides i18n context.
5
+ * This component sets up a complete internationalization system for Next.js applications,
6
+ * including language management, message loading, and persistent language preferences.
7
+ * It integrates with the storage system to remember user language choices and provides
8
+ * a comprehensive i18n context to all child components.
9
+ *
10
+ * Features:
11
+ * - Language state management with persistence
12
+ * - Automatic language detection and fallback
13
+ * - Message loading and caching
14
+ * - Timezone configuration per language
15
+ * - Integration with Next.js internationalization
16
+ * - Memoized context value for performance optimization
17
+ *
18
+ * @param props - Component props containing children, languages, and messages.
19
+ * @param props.children - React children that will have access to the internationalization context.
20
+ * @param props.languages - Array of supported languages with their configurations.
21
+ * @param props.messages - Object containing translation messages for each supported language.
22
+ * @returns A React component that provides internationalization context to its children.
23
+ */
3
24
  export declare function NextIntlProvider({ children, languages, messages, }: I_NextIntlProviderProps): React.JSX.Element;
@@ -1,4 +1,23 @@
1
1
  import { I_Serializer } from '../../util/serializer/index.js';
2
+ /**
3
+ * React hook that provides persistent storage functionality with automatic serialization.
4
+ * This hook manages state that persists across browser sessions using localForage,
5
+ * with automatic serialization/deserialization of complex data types. It provides
6
+ * a React-friendly interface for storage operations with proper error handling.
7
+ *
8
+ * Features:
9
+ * - Automatic data serialization and deserialization
10
+ * - Persistent storage across browser sessions
11
+ * - Initial value handling and fallback
12
+ * - Error handling with graceful degradation
13
+ * - Automatic storage synchronization
14
+ * - Support for complex data types via custom serializers
15
+ *
16
+ * @param key - The unique storage key for the data.
17
+ * @param initialValue - Optional initial value to use if no stored value exists.
18
+ * @param serializer - Optional custom serializer for complex data types (defaults to JSON serializer).
19
+ * @returns An object containing the current value, set function, and remove function.
20
+ */
2
21
  export declare function useStorage<T>(key: string, initialValue?: T, serializer?: I_Serializer<T>): {
3
22
  value: T | undefined;
4
23
  set: (newValue: T | ((val: T | undefined) => T)) => void;