@cleanweb/oore 2.0.0-alpha.22 → 2.0.0-alpha.24

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 (80) hide show
  1. package/build/_cjs/base/index.d.ts +3 -3
  2. package/build/_cjs/base/index.js +3 -3
  3. package/build/_cjs/base/methods.d.ts +3 -3
  4. package/build/_cjs/base/state/class-types.d.ts +2 -2
  5. package/build/_cjs/base/state/class.d.ts +1 -1
  6. package/build/_cjs/base/state/hook-types.d.ts +1 -1
  7. package/build/_cjs/base/state/hooks.d.ts +1 -1
  8. package/build/_cjs/base/state/hooks.js +1 -1
  9. package/build/_cjs/base/state/index.d.ts +5 -5
  10. package/build/_cjs/base/state/index.js +3 -3
  11. package/build/_cjs/classy/class/index.d.ts +3 -3
  12. package/build/_cjs/classy/class/index.js +3 -3
  13. package/build/_cjs/classy/class/types/extractor.d.ts +1 -1
  14. package/build/_cjs/classy/index.d.ts +3 -3
  15. package/build/_cjs/classy/index.js +3 -3
  16. package/build/_cjs/classy/instance/index.d.ts +3 -3
  17. package/build/_cjs/classy/instance/index.js +3 -3
  18. package/build/_cjs/classy/instance/mount-callbacks.d.ts +1 -1
  19. package/build/_cjs/classy/instance/mount-callbacks.js +1 -1
  20. package/build/_cjs/classy/instance/types/hook.d.ts +1 -1
  21. package/build/_cjs/classy/logic/index.d.ts +2 -2
  22. package/build/_cjs/classy/logic/index.js +1 -1
  23. package/build/_cjs/classy/logic/types/hook.d.ts +1 -1
  24. package/build/_cjs/docs-src/api/base-classes.d.ts +3 -3
  25. package/build/_cjs/docs-src/api/base-classes.js +3 -3
  26. package/build/_cjs/docs-src/api/index.d.ts +8 -8
  27. package/build/_cjs/docs-src/api/index.js +8 -8
  28. package/build/_cjs/docs-src/api/references.d.ts +5 -5
  29. package/build/_cjs/docs-src/api/references.js +5 -5
  30. package/build/_cjs/helpers/index.d.ts +4 -4
  31. package/build/_cjs/helpers/index.js +4 -4
  32. package/build/_cjs/helpers/rerender.js +1 -1
  33. package/build/_cjs/helpers/use-component/index.d.ts +1 -1
  34. package/build/_cjs/index.d.ts +3 -3
  35. package/build/_cjs/index.js +3 -3
  36. package/build/_cjs/slots/hook.d.ts +2 -2
  37. package/build/_cjs/slots/hook.js +1 -1
  38. package/build/_cjs/slots/index.d.ts +1 -1
  39. package/build/_cjs/slots/index.js +1 -1
  40. package/build/base/index.d.ts +3 -3
  41. package/build/base/index.js +3 -3
  42. package/build/base/methods.d.ts +3 -3
  43. package/build/base/state/class-types.d.ts +2 -2
  44. package/build/base/state/class.d.ts +1 -1
  45. package/build/base/state/hook-types.d.ts +1 -1
  46. package/build/base/state/hooks.d.ts +1 -1
  47. package/build/base/state/hooks.js +1 -1
  48. package/build/base/state/index.d.ts +5 -5
  49. package/build/base/state/index.js +3 -3
  50. package/build/classy/class/index.d.ts +3 -3
  51. package/build/classy/class/index.js +3 -3
  52. package/build/classy/class/types/extractor.d.ts +1 -1
  53. package/build/classy/index.d.ts +3 -3
  54. package/build/classy/index.js +3 -3
  55. package/build/classy/instance/index.d.ts +3 -3
  56. package/build/classy/instance/index.js +3 -3
  57. package/build/classy/instance/mount-callbacks.d.ts +1 -1
  58. package/build/classy/instance/mount-callbacks.js +1 -1
  59. package/build/classy/instance/types/hook.d.ts +1 -1
  60. package/build/classy/logic/index.d.ts +2 -2
  61. package/build/classy/logic/index.js +1 -1
  62. package/build/classy/logic/types/hook.d.ts +1 -1
  63. package/build/docs-src/api/base-classes.d.ts +3 -3
  64. package/build/docs-src/api/base-classes.js +3 -3
  65. package/build/docs-src/api/index.d.ts +8 -8
  66. package/build/docs-src/api/index.js +8 -8
  67. package/build/docs-src/api/references.d.ts +5 -5
  68. package/build/docs-src/api/references.js +5 -5
  69. package/build/helpers/index.d.ts +4 -4
  70. package/build/helpers/index.js +4 -4
  71. package/build/helpers/rerender.js +1 -1
  72. package/build/helpers/use-component/index.d.ts +1 -1
  73. package/build/index.d.ts +3 -3
  74. package/build/index.js +3 -3
  75. package/build/slots/hook.d.ts +2 -2
  76. package/build/slots/hook.js +1 -1
  77. package/build/slots/index.d.ts +1 -1
  78. package/build/slots/index.js +1 -1
  79. package/build/tsconfig.json +4 -0
  80. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- export * from './state';
2
- export * from './methods';
3
- export * from './merged-state';
1
+ export * from './state/index.js';
2
+ export * from './methods.js';
3
+ export * from './merged-state.js';
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./state"), exports);
18
- __exportStar(require("./methods"), exports);
19
- __exportStar(require("./merged-state"), exports);
17
+ __exportStar(require("./state/index.js"), exports);
18
+ __exportStar(require("./methods.js"), exports);
19
+ __exportStar(require("./merged-state.js"), exports);
@@ -28,9 +28,9 @@ export declare class ComponentMethods<TProps extends object = {}, TState extends
28
28
  _onHmrUpdate?: <TInstance extends this>(oldInstance: TInstance) => void;
29
29
  }
30
30
  type UseMethods = {
31
- <Class extends typeof ComponentMethods<object, object>>(Methods: Class & Constructor<InstanceType<Class>>, props: InstanceType<Class>['props'], state: InstanceType<Class>['state']): InstanceType<Class>;
32
- <Class extends typeof ComponentMethods<object, null>>(Methods: Class & Constructor<InstanceType<Class>>, props: InstanceType<Class>['props'], state?: null): InstanceType<Class>;
33
- <Class extends typeof ComponentMethods<NeverObject, null>>(Methods: Class & Constructor<InstanceType<Class>>): InstanceType<Class>;
31
+ <Class extends typeof ComponentMethods<object, object>>(Methods: Class, props: InstanceType<Class>['props'], state: InstanceType<Class>['state']): InstanceType<Class>;
32
+ <Class extends typeof ComponentMethods<object, null>>(Methods: Class, props: InstanceType<Class>['props'], state?: null): InstanceType<Class>;
33
+ <Class extends typeof ComponentMethods<NeverObject, null>>(Methods: Class): InstanceType<Class>;
34
34
  };
35
35
  /**
36
36
  * Returns an instance of the provided class,
@@ -1,5 +1,5 @@
1
- import { CleanStateBase } from './class';
2
- import { TCleanState, TStateData } from './hook-types';
1
+ import { CleanStateBase } from './class.js';
2
+ import { TCleanState, TStateData } from './hook-types.js';
3
3
  export type TCleanStateBase = typeof CleanStateBase;
4
4
  export type TCleanStateBaseKeys = keyof TCleanStateBase;
5
5
  export type PutState<TState extends TStateData> = {
@@ -1,4 +1,4 @@
1
- import type { ICleanStateClass, ICleanStateConstructor, PutManyPayload, PutState } from './class-types';
1
+ import type { ICleanStateClass, ICleanStateConstructor, PutManyPayload, PutState } from './class-types.js';
2
2
  /** @internal */
3
3
  export declare class CleanStateBase<TState extends Record<string, any>> {
4
4
  readonly reservedKeys: string[];
@@ -1,4 +1,4 @@
1
- import { CleanStateBase } from './class';
1
+ import { CleanStateBase } from './class.js';
2
2
  /**
3
3
  * Base type for an `initialState` object.
4
4
  * It is a regular object type, with some reserved keys excluded.
@@ -1,4 +1,4 @@
1
- import { TUseCleanState } from './hook-types';
1
+ import { TUseCleanState } from './hook-types.js';
2
2
  /**
3
3
  * Creates a state object, which includes the provided values,
4
4
  * as well as helper methods for updating those values and automatically
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCleanState = void 0;
4
4
  const react_1 = require("react");
5
- const class_1 = require("./class");
5
+ const class_1 = require("./class.js");
6
6
  /**
7
7
  * Creates a state object, which includes the provided values,
8
8
  * as well as helper methods for updating those values and automatically
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @module CleanState
3
3
  */
4
- export { CleanState } from './class';
5
- export { useCleanState } from './hooks';
6
- export type { TCleanState, TStateData, ExtractCleanStateData } from './hook-types';
7
- export type { SF, StateFragment } from './class-types';
8
- export * as MergedState from '../../base/merged-state';
4
+ export { CleanState } from './class.js';
5
+ export { useCleanState } from './hooks.js';
6
+ export type { TCleanState, TStateData, ExtractCleanStateData } from './hook-types.js';
7
+ export type { SF, StateFragment } from './class-types.js';
8
+ export * as MergedState from '../../base/merged-state.js';
@@ -27,8 +27,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.MergedState = exports.useCleanState = exports.CleanState = void 0;
30
- var class_1 = require("./class");
30
+ var class_1 = require("./class.js");
31
31
  Object.defineProperty(exports, "CleanState", { enumerable: true, get: function () { return class_1.CleanState; } });
32
- var hooks_1 = require("./hooks");
32
+ var hooks_1 = require("./hooks.js");
33
33
  Object.defineProperty(exports, "useCleanState", { enumerable: true, get: function () { return hooks_1.useCleanState; } });
34
- exports.MergedState = __importStar(require("../../base/merged-state"));
34
+ exports.MergedState = __importStar(require("../../base/merged-state.js"));
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
- import type { TPropsBase } from '../logic';
3
- import type { Extractor } from './types/extractor';
4
- import { ComponentInstance } from '../instance';
2
+ import type { TPropsBase } from '../logic/index.js';
3
+ import type { Extractor } from './types/extractor.js';
4
+ import { ComponentInstance } from '../instance/index.js';
5
5
  /**
6
6
  * @summary
7
7
  * A modern class component for React that is fully compatible with
@@ -3,9 +3,9 @@ var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Component = exports.ClassComponent = void 0;
5
5
  const react_1 = require("react");
6
- const instance_1 = require("../instance");
7
- const function_name_1 = require("./utils/function-name");
8
- const rerender_1 = require("../../helpers/rerender");
6
+ const instance_1 = require("../instance/index.js");
7
+ const function_name_1 = require("./utils/function-name.js");
8
+ const rerender_1 = require("../../helpers/rerender.js");
9
9
  /**
10
10
  * @summary
11
11
  * A modern class component for React that is fully compatible with
@@ -1,5 +1,5 @@
1
1
  import type { VoidFunctionComponent } from 'react';
2
- import type { ClassComponent } from '..';
2
+ import type { ClassComponent } from '../index.js';
3
3
  type BaseCCConstructor = typeof ClassComponent<object>;
4
4
  export type Extractor = <TComponentClass extends BaseCCConstructor, TProperties extends {} = {}>(this: TComponentClass, Component?: TComponentClass | null, properties?: TProperties) => NonNullable<TProperties> & VoidFunctionComponent<InstanceType<TComponentClass>['props']>;
5
5
  export {};
@@ -1,3 +1,3 @@
1
- export * from './logic';
2
- export * from './instance';
3
- export * from './class';
1
+ export * from './logic/index.js';
2
+ export * from './instance/index.js';
3
+ export * from './class/index.js';
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./logic"), exports);
18
- __exportStar(require("./instance"), exports);
19
- __exportStar(require("./class"), exports);
17
+ __exportStar(require("./logic/index.js"), exports);
18
+ __exportStar(require("./instance/index.js"), exports);
19
+ __exportStar(require("./class/index.js"), exports);
@@ -1,6 +1,6 @@
1
- import type { UseInstance } from './types/hook';
2
- import type { TPropsBase } from '../../classy/logic';
3
- import { ComponentLogic } from '../../classy/logic';
1
+ import type { UseInstance } from './types/hook.js';
2
+ import type { TPropsBase } from '../../classy/logic/index.js';
3
+ import { ComponentLogic } from '../../classy/logic/index.js';
4
4
  type AsyncAllowedEffectCallback = () => Awaitable<IVoidFunction | void>;
5
5
  /**
6
6
  * A superset of {@link ComponentLogic} that adds support for lifecycle methods.
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useInstance = exports.ComponentInstance = void 0;
4
4
  const react_1 = require("react");
5
- const logic_1 = require("../../classy/logic");
6
- const mount_callbacks_1 = require("./mount-callbacks");
7
- const helpers_1 = require("../../helpers");
5
+ const logic_1 = require("../../classy/logic/index.js");
6
+ const mount_callbacks_1 = require("./mount-callbacks.js");
7
+ const helpers_1 = require("../../helpers/index.js");
8
8
  /**
9
9
  * A superset of {@link ComponentLogic} that adds support for lifecycle methods.
10
10
  * This provides a declarative API for working with your React function component's lifecycle,
@@ -1,4 +1,4 @@
1
- import { ComponentInstance } from '.';
1
+ import { ComponentInstance } from './index.js';
2
2
  type UseMountCallbacks = <TInstance extends ComponentInstance>(instance: TInstance) => void;
3
3
  /** @internal */
4
4
  export declare const useMountCallbacks: UseMountCallbacks;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useMountCallbacks = void 0;
4
4
  const react_1 = require("react");
5
- const mount_state_1 = require("../../helpers/mount-state");
5
+ const mount_state_1 = require("../../helpers/mount-state.js");
6
6
  /** @internal */
7
7
  const useMountCallbacks = (instance) => {
8
8
  var _a;
@@ -1,4 +1,4 @@
1
- import { ComponentInstance } from '..';
1
+ import { ComponentInstance } from '../index.js';
2
2
  type UIClassParam = typeof ComponentInstance<NonNullable<any>>;
3
3
  type UIProplessClassParam = typeof ComponentInstance<null>;
4
4
  export type UseInstance = {
@@ -1,5 +1,5 @@
1
- import type { TCleanState } from '../../base/state';
2
- import type { UseLogic } from './types/hook';
1
+ import type { TCleanState } from '../../base/state/index.js';
2
+ import type { UseLogic } from './types/hook.js';
3
3
  /**
4
4
  * The base type for the `props` type argument.
5
5
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLogic = exports.ComponentLogic = void 0;
4
4
  const react_1 = require("react");
5
- const state_1 = require("../../base/state");
5
+ const state_1 = require("../../base/state/index.js");
6
6
  /**
7
7
  * Base class for a class that holds methods to be used in a function component.
8
8
  *
@@ -1,4 +1,4 @@
1
- import type { ComponentLogic } from '..';
1
+ import type { ComponentLogic } from '../index.js';
2
2
  /*************************************
3
3
  * # Hooks *
4
4
  **************************************/
@@ -1,3 +1,3 @@
1
- export { ComponentMethods } from '../../base/methods';
2
- export { ComponentLogic } from '../../classy/logic';
3
- export { ComponentInstance } from '../../classy/instance';
1
+ export { ComponentMethods } from '../../base/methods.js';
2
+ export { ComponentLogic } from '../../classy/logic/index.js';
3
+ export { ComponentInstance } from '../../classy/instance/index.js';
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ComponentInstance = exports.ComponentLogic = exports.ComponentMethods = void 0;
4
- var methods_1 = require("../../base/methods");
4
+ var methods_1 = require("../../base/methods.js");
5
5
  Object.defineProperty(exports, "ComponentMethods", { enumerable: true, get: function () { return methods_1.ComponentMethods; } });
6
- var logic_1 = require("../../classy/logic");
6
+ var logic_1 = require("../../classy/logic/index.js");
7
7
  Object.defineProperty(exports, "ComponentLogic", { enumerable: true, get: function () { return logic_1.ComponentLogic; } });
8
- var instance_1 = require("../../classy/instance");
8
+ var instance_1 = require("../../classy/instance/index.js");
9
9
  Object.defineProperty(exports, "ComponentInstance", { enumerable: true, get: function () { return instance_1.ComponentInstance; } });
@@ -2,12 +2,12 @@
2
2
  * API Reference
3
3
  * @module API
4
4
  */
5
- export { useCleanState } from '../../base/state';
6
- export { useMethods } from '../../base/methods';
7
- export { useLogic } from '../../classy/logic';
8
- export { useInstance } from '../../classy/instance';
9
- export { ClassComponent } from '../../classy/class';
5
+ export { useCleanState } from '../../base/state/index.js';
6
+ export { useMethods } from '../../base/methods.js';
7
+ export { useLogic } from '../../classy/logic/index.js';
8
+ export { useInstance } from '../../classy/instance/index.js';
9
+ export { ClassComponent } from '../../classy/class/index.js';
10
10
  /** @namespace */
11
- export * as BaseClasses from './base-classes';
12
- export * as Helpers from '../../helpers';
13
- export * as References from './references';
11
+ export * as BaseClasses from './base-classes.js';
12
+ export * as Helpers from '../../helpers/index.js';
13
+ export * as References from './references.js';
@@ -28,17 +28,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.References = exports.Helpers = exports.BaseClasses = exports.ClassComponent = exports.useInstance = exports.useLogic = exports.useMethods = exports.useCleanState = void 0;
31
- var state_1 = require("../../base/state");
31
+ var state_1 = require("../../base/state/index.js");
32
32
  Object.defineProperty(exports, "useCleanState", { enumerable: true, get: function () { return state_1.useCleanState; } });
33
- var methods_1 = require("../../base/methods");
33
+ var methods_1 = require("../../base/methods.js");
34
34
  Object.defineProperty(exports, "useMethods", { enumerable: true, get: function () { return methods_1.useMethods; } });
35
- var logic_1 = require("../../classy/logic");
35
+ var logic_1 = require("../../classy/logic/index.js");
36
36
  Object.defineProperty(exports, "useLogic", { enumerable: true, get: function () { return logic_1.useLogic; } });
37
- var instance_1 = require("../../classy/instance");
37
+ var instance_1 = require("../../classy/instance/index.js");
38
38
  Object.defineProperty(exports, "useInstance", { enumerable: true, get: function () { return instance_1.useInstance; } });
39
- var class_1 = require("../../classy/class");
39
+ var class_1 = require("../../classy/class/index.js");
40
40
  Object.defineProperty(exports, "ClassComponent", { enumerable: true, get: function () { return class_1.ClassComponent; } });
41
41
  /** @namespace */
42
- exports.BaseClasses = __importStar(require("./base-classes"));
43
- exports.Helpers = __importStar(require("../../helpers"));
44
- exports.References = __importStar(require("./references"));
42
+ exports.BaseClasses = __importStar(require("./base-classes.js"));
43
+ exports.Helpers = __importStar(require("../../helpers/index.js"));
44
+ exports.References = __importStar(require("./references.js"));
@@ -1,5 +1,5 @@
1
- export * as $CleanState from '../../base/state';
2
- export * as $ComponentMethods from '../../base/methods';
3
- export * as ComponentLogic from '../../classy/logic';
4
- export * as ComponentInstance from '../../classy/instance';
5
- export * as ClassComponent from '../../classy/class';
1
+ export * as $CleanState from '../../base/state/index.js';
2
+ export * as $ComponentMethods from '../../base/methods.js';
3
+ export * as ComponentLogic from '../../classy/logic/index.js';
4
+ export * as ComponentInstance from '../../classy/instance/index.js';
5
+ export * as ClassComponent from '../../classy/class/index.js';
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.ClassComponent = exports.ComponentInstance = exports.ComponentLogic = exports.$ComponentMethods = exports.$CleanState = void 0;
27
- exports.$CleanState = __importStar(require("../../base/state"));
28
- exports.$ComponentMethods = __importStar(require("../../base/methods"));
29
- exports.ComponentLogic = __importStar(require("../../classy/logic"));
30
- exports.ComponentInstance = __importStar(require("../../classy/instance"));
31
- exports.ClassComponent = __importStar(require("../../classy/class"));
27
+ exports.$CleanState = __importStar(require("../../base/state/index.js"));
28
+ exports.$ComponentMethods = __importStar(require("../../base/methods.js"));
29
+ exports.ComponentLogic = __importStar(require("../../classy/logic/index.js"));
30
+ exports.ComponentInstance = __importStar(require("../../classy/instance/index.js"));
31
+ exports.ClassComponent = __importStar(require("../../classy/class/index.js"));
@@ -2,10 +2,10 @@
2
2
  * <!-- @ mergeModuleWith API -->
3
3
  * @module Helpers
4
4
  */
5
- export * from './mount-state';
6
- export * from './rerender';
7
- export * from './use-component';
8
- export * from './type-guards';
5
+ export * from './mount-state.js';
6
+ export * from './rerender.js';
7
+ export * from './use-component/index.js';
8
+ export * from './type-guards.js';
9
9
  /**
10
10
  * An empty function.
11
11
  * It returns (void) without performing any operations.
@@ -19,10 +19,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.noOp = void 0;
22
- __exportStar(require("./mount-state"), exports);
23
- __exportStar(require("./rerender"), exports);
24
- __exportStar(require("./use-component"), exports);
25
- __exportStar(require("./type-guards"), exports);
22
+ __exportStar(require("./mount-state.js"), exports);
23
+ __exportStar(require("./rerender.js"), exports);
24
+ __exportStar(require("./use-component/index.js"), exports);
25
+ __exportStar(require("./type-guards.js"), exports);
26
26
  /**
27
27
  * An empty function.
28
28
  * It returns (void) without performing any operations.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useRerender = void 0;
4
4
  const react_1 = require("react");
5
- const mount_state_1 = require("../helpers/mount-state");
5
+ const mount_state_1 = require("../helpers/mount-state.js");
6
6
  ;
7
7
  /**
8
8
  * Returns a function that can be called to manually trigger
@@ -1,4 +1,4 @@
1
- import type { ClassComponentHookWrapper } from './types';
1
+ import type { ClassComponentHookWrapper } from './types.js';
2
2
  /**
3
3
  * A component you can use to consume React hooks
4
4
  * in a {@link Component | React.Component} class.
@@ -1,3 +1,3 @@
1
- export * from './classy';
2
- export * from './base';
3
- export * from './helpers';
1
+ export * from './classy/index.js';
2
+ export * from './base/index.js';
3
+ export * from './helpers/index.js';
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./classy"), exports);
18
- __exportStar(require("./base"), exports);
19
- __exportStar(require("./helpers"), exports);
17
+ __exportStar(require("./classy/index.js"), exports);
18
+ __exportStar(require("./base/index.js"), exports);
19
+ __exportStar(require("./helpers/index.js"), exports);
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement, ReactNode, ReactPortal } from 'react';
2
- import type { IUseSlots, PotentialSlotComponent } from './types';
2
+ import type { IUseSlots, PotentialSlotComponent } from './types.js';
3
3
  export declare const isElementChild: (child: ReactNode) => child is ReactElement<any, any>;
4
4
  interface IGetSlotName {
5
5
  (TargetComponent: PotentialSlotComponent, child?: ReactElement): string | undefined;
@@ -17,4 +17,4 @@ export declare const isPortalChild: (child: ReactNode) => child is ReactPortal;
17
17
  * @see {@link SlotComponent} for more on how to use the returned slot nodes.
18
18
  */
19
19
  export declare const useSlots: IUseSlots;
20
- export type { SlottedComponent, TSlotsRecord, SlotComponent, PotentialSlotComponent, } from './types';
20
+ export type { SlottedComponent, TSlotsRecord, SlotComponent, PotentialSlotComponent, } from './types.js';
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.useSlots = exports.isPortalChild = exports.getComponentSlotName = exports.isElementChild = void 0;
27
- const errors_1 = require("../helpers/errors");
27
+ const errors_1 = require("../helpers/errors.js");
28
28
  const react_1 = __importStar(require("react"));
29
29
  const isElementChild = (child) => {
30
30
  if (child && typeof child === 'object' && 'type' in child) {
@@ -1 +1 @@
1
- export * from './hook';
1
+ export * from './hook.js';
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./hook"), exports);
17
+ __exportStar(require("./hook.js"), exports);
@@ -1,3 +1,3 @@
1
- export * from './state';
2
- export * from './methods';
3
- export * from './merged-state';
1
+ export * from './state/index.js';
2
+ export * from './methods.js';
3
+ export * from './merged-state.js';
@@ -1,3 +1,3 @@
1
- export * from './state';
2
- export * from './methods';
3
- export * from './merged-state';
1
+ export * from './state/index.js';
2
+ export * from './methods.js';
3
+ export * from './merged-state.js';
@@ -28,9 +28,9 @@ export declare class ComponentMethods<TProps extends object = {}, TState extends
28
28
  _onHmrUpdate?: <TInstance extends this>(oldInstance: TInstance) => void;
29
29
  }
30
30
  type UseMethods = {
31
- <Class extends typeof ComponentMethods<object, object>>(Methods: Class & Constructor<InstanceType<Class>>, props: InstanceType<Class>['props'], state: InstanceType<Class>['state']): InstanceType<Class>;
32
- <Class extends typeof ComponentMethods<object, null>>(Methods: Class & Constructor<InstanceType<Class>>, props: InstanceType<Class>['props'], state?: null): InstanceType<Class>;
33
- <Class extends typeof ComponentMethods<NeverObject, null>>(Methods: Class & Constructor<InstanceType<Class>>): InstanceType<Class>;
31
+ <Class extends typeof ComponentMethods<object, object>>(Methods: Class, props: InstanceType<Class>['props'], state: InstanceType<Class>['state']): InstanceType<Class>;
32
+ <Class extends typeof ComponentMethods<object, null>>(Methods: Class, props: InstanceType<Class>['props'], state?: null): InstanceType<Class>;
33
+ <Class extends typeof ComponentMethods<NeverObject, null>>(Methods: Class): InstanceType<Class>;
34
34
  };
35
35
  /**
36
36
  * Returns an instance of the provided class,
@@ -1,5 +1,5 @@
1
- import { CleanStateBase } from './class';
2
- import { TCleanState, TStateData } from './hook-types';
1
+ import { CleanStateBase } from './class.js';
2
+ import { TCleanState, TStateData } from './hook-types.js';
3
3
  export type TCleanStateBase = typeof CleanStateBase;
4
4
  export type TCleanStateBaseKeys = keyof TCleanStateBase;
5
5
  export type PutState<TState extends TStateData> = {
@@ -1,4 +1,4 @@
1
- import type { ICleanStateClass, ICleanStateConstructor, PutManyPayload, PutState } from './class-types';
1
+ import type { ICleanStateClass, ICleanStateConstructor, PutManyPayload, PutState } from './class-types.js';
2
2
  /** @internal */
3
3
  export declare class CleanStateBase<TState extends Record<string, any>> {
4
4
  readonly reservedKeys: string[];
@@ -1,4 +1,4 @@
1
- import { CleanStateBase } from './class';
1
+ import { CleanStateBase } from './class.js';
2
2
  /**
3
3
  * Base type for an `initialState` object.
4
4
  * It is a regular object type, with some reserved keys excluded.
@@ -1,4 +1,4 @@
1
- import { TUseCleanState } from './hook-types';
1
+ import { TUseCleanState } from './hook-types.js';
2
2
  /**
3
3
  * Creates a state object, which includes the provided values,
4
4
  * as well as helper methods for updating those values and automatically
@@ -1,5 +1,5 @@
1
1
  import { useMemo, useRef } from 'react';
2
- import { CleanState } from './class';
2
+ import { CleanState } from './class.js';
3
3
  /**
4
4
  * Creates a state object, which includes the provided values,
5
5
  * as well as helper methods for updating those values and automatically
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @module CleanState
3
3
  */
4
- export { CleanState } from './class';
5
- export { useCleanState } from './hooks';
6
- export type { TCleanState, TStateData, ExtractCleanStateData } from './hook-types';
7
- export type { SF, StateFragment } from './class-types';
8
- export * as MergedState from '../../base/merged-state';
4
+ export { CleanState } from './class.js';
5
+ export { useCleanState } from './hooks.js';
6
+ export type { TCleanState, TStateData, ExtractCleanStateData } from './hook-types.js';
7
+ export type { SF, StateFragment } from './class-types.js';
8
+ export * as MergedState from '../../base/merged-state.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module CleanState
3
3
  */
4
- export { CleanState } from './class';
5
- export { useCleanState } from './hooks';
6
- export * as MergedState from '../../base/merged-state';
4
+ export { CleanState } from './class.js';
5
+ export { useCleanState } from './hooks.js';
6
+ export * as MergedState from '../../base/merged-state.js';
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
- import type { TPropsBase } from '../logic';
3
- import type { Extractor } from './types/extractor';
4
- import { ComponentInstance } from '../instance';
2
+ import type { TPropsBase } from '../logic/index.js';
3
+ import type { Extractor } from './types/extractor.js';
4
+ import { ComponentInstance } from '../instance/index.js';
5
5
  /**
6
6
  * @summary
7
7
  * A modern class component for React that is fully compatible with
@@ -1,8 +1,8 @@
1
1
  var _a;
2
2
  import { useMemo } from 'react';
3
- import { ComponentInstance, useInstance } from '../instance';
4
- import { setFunctionName } from './utils/function-name';
5
- import { useRerender } from '../../helpers/rerender';
3
+ import { ComponentInstance, useInstance } from '../instance/index.js';
4
+ import { setFunctionName } from './utils/function-name.js';
5
+ import { useRerender } from '../../helpers/rerender.js';
6
6
  /**
7
7
  * @summary
8
8
  * A modern class component for React that is fully compatible with
@@ -1,5 +1,5 @@
1
1
  import type { VoidFunctionComponent } from 'react';
2
- import type { ClassComponent } from '..';
2
+ import type { ClassComponent } from '../index.js';
3
3
  type BaseCCConstructor = typeof ClassComponent<object>;
4
4
  export type Extractor = <TComponentClass extends BaseCCConstructor, TProperties extends {} = {}>(this: TComponentClass, Component?: TComponentClass | null, properties?: TProperties) => NonNullable<TProperties> & VoidFunctionComponent<InstanceType<TComponentClass>['props']>;
5
5
  export {};
@@ -1,3 +1,3 @@
1
- export * from './logic';
2
- export * from './instance';
3
- export * from './class';
1
+ export * from './logic/index.js';
2
+ export * from './instance/index.js';
3
+ export * from './class/index.js';
@@ -1,3 +1,3 @@
1
- export * from './logic';
2
- export * from './instance';
3
- export * from './class';
1
+ export * from './logic/index.js';
2
+ export * from './instance/index.js';
3
+ export * from './class/index.js';
@@ -1,6 +1,6 @@
1
- import type { UseInstance } from './types/hook';
2
- import type { TPropsBase } from '../../classy/logic';
3
- import { ComponentLogic } from '../../classy/logic';
1
+ import type { UseInstance } from './types/hook.js';
2
+ import type { TPropsBase } from '../../classy/logic/index.js';
3
+ import { ComponentLogic } from '../../classy/logic/index.js';
4
4
  type AsyncAllowedEffectCallback = () => Awaitable<IVoidFunction | void>;
5
5
  /**
6
6
  * A superset of {@link ComponentLogic} that adds support for lifecycle methods.
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from 'react';
2
- import { ComponentLogic, useLogic } from '../../classy/logic';
3
- import { useMountCallbacks } from './mount-callbacks';
4
- import { noOp } from '../../helpers';
2
+ import { ComponentLogic, useLogic } from '../../classy/logic/index.js';
3
+ import { useMountCallbacks } from './mount-callbacks.js';
4
+ import { noOp } from '../../helpers/index.js';
5
5
  /**
6
6
  * A superset of {@link ComponentLogic} that adds support for lifecycle methods.
7
7
  * This provides a declarative API for working with your React function component's lifecycle,
@@ -1,4 +1,4 @@
1
- import { ComponentInstance } from '.';
1
+ import { ComponentInstance } from './index.js';
2
2
  type UseMountCallbacks = <TInstance extends ComponentInstance>(instance: TInstance) => void;
3
3
  /** @internal */
4
4
  export declare const useMountCallbacks: UseMountCallbacks;
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react';
2
- import { useMountState } from '../../helpers/mount-state';
2
+ import { useMountState } from '../../helpers/mount-state.js';
3
3
  /** @internal */
4
4
  export const useMountCallbacks = (instance) => {
5
5
  var _a;
@@ -1,4 +1,4 @@
1
- import { ComponentInstance } from '..';
1
+ import { ComponentInstance } from '../index.js';
2
2
  type UIClassParam = typeof ComponentInstance<NonNullable<any>>;
3
3
  type UIProplessClassParam = typeof ComponentInstance<null>;
4
4
  export type UseInstance = {
@@ -1,5 +1,5 @@
1
- import type { TCleanState } from '../../base/state';
2
- import type { UseLogic } from './types/hook';
1
+ import type { TCleanState } from '../../base/state/index.js';
2
+ import type { UseLogic } from './types/hook.js';
3
3
  /**
4
4
  * The base type for the `props` type argument.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { useMemo, useRef } from 'react';
2
- import { useCleanState } from '../../base/state';
2
+ import { useCleanState } from '../../base/state/index.js';
3
3
  /**
4
4
  * Base class for a class that holds methods to be used in a function component.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { ComponentLogic } from '..';
1
+ import type { ComponentLogic } from '../index.js';
2
2
  /*************************************
3
3
  * # Hooks *
4
4
  **************************************/
@@ -1,3 +1,3 @@
1
- export { ComponentMethods } from '../../base/methods';
2
- export { ComponentLogic } from '../../classy/logic';
3
- export { ComponentInstance } from '../../classy/instance';
1
+ export { ComponentMethods } from '../../base/methods.js';
2
+ export { ComponentLogic } from '../../classy/logic/index.js';
3
+ export { ComponentInstance } from '../../classy/instance/index.js';
@@ -1,3 +1,3 @@
1
- export { ComponentMethods } from '../../base/methods';
2
- export { ComponentLogic } from '../../classy/logic';
3
- export { ComponentInstance } from '../../classy/instance';
1
+ export { ComponentMethods } from '../../base/methods.js';
2
+ export { ComponentLogic } from '../../classy/logic/index.js';
3
+ export { ComponentInstance } from '../../classy/instance/index.js';
@@ -2,12 +2,12 @@
2
2
  * API Reference
3
3
  * @module API
4
4
  */
5
- export { useCleanState } from '../../base/state';
6
- export { useMethods } from '../../base/methods';
7
- export { useLogic } from '../../classy/logic';
8
- export { useInstance } from '../../classy/instance';
9
- export { ClassComponent } from '../../classy/class';
5
+ export { useCleanState } from '../../base/state/index.js';
6
+ export { useMethods } from '../../base/methods.js';
7
+ export { useLogic } from '../../classy/logic/index.js';
8
+ export { useInstance } from '../../classy/instance/index.js';
9
+ export { ClassComponent } from '../../classy/class/index.js';
10
10
  /** @namespace */
11
- export * as BaseClasses from './base-classes';
12
- export * as Helpers from '../../helpers';
13
- export * as References from './references';
11
+ export * as BaseClasses from './base-classes.js';
12
+ export * as Helpers from '../../helpers/index.js';
13
+ export * as References from './references.js';
@@ -2,12 +2,12 @@
2
2
  * API Reference
3
3
  * @module API
4
4
  */
5
- export { useCleanState } from '../../base/state';
6
- export { useMethods } from '../../base/methods';
7
- export { useLogic } from '../../classy/logic';
8
- export { useInstance } from '../../classy/instance';
9
- export { ClassComponent } from '../../classy/class';
5
+ export { useCleanState } from '../../base/state/index.js';
6
+ export { useMethods } from '../../base/methods.js';
7
+ export { useLogic } from '../../classy/logic/index.js';
8
+ export { useInstance } from '../../classy/instance/index.js';
9
+ export { ClassComponent } from '../../classy/class/index.js';
10
10
  /** @namespace */
11
- export * as BaseClasses from './base-classes';
12
- export * as Helpers from '../../helpers';
13
- export * as References from './references';
11
+ export * as BaseClasses from './base-classes.js';
12
+ export * as Helpers from '../../helpers/index.js';
13
+ export * as References from './references.js';
@@ -1,5 +1,5 @@
1
- export * as $CleanState from '../../base/state';
2
- export * as $ComponentMethods from '../../base/methods';
3
- export * as ComponentLogic from '../../classy/logic';
4
- export * as ComponentInstance from '../../classy/instance';
5
- export * as ClassComponent from '../../classy/class';
1
+ export * as $CleanState from '../../base/state/index.js';
2
+ export * as $ComponentMethods from '../../base/methods.js';
3
+ export * as ComponentLogic from '../../classy/logic/index.js';
4
+ export * as ComponentInstance from '../../classy/instance/index.js';
5
+ export * as ClassComponent from '../../classy/class/index.js';
@@ -1,5 +1,5 @@
1
- export * as $CleanState from '../../base/state';
2
- export * as $ComponentMethods from '../../base/methods';
3
- export * as ComponentLogic from '../../classy/logic';
4
- export * as ComponentInstance from '../../classy/instance';
5
- export * as ClassComponent from '../../classy/class';
1
+ export * as $CleanState from '../../base/state/index.js';
2
+ export * as $ComponentMethods from '../../base/methods.js';
3
+ export * as ComponentLogic from '../../classy/logic/index.js';
4
+ export * as ComponentInstance from '../../classy/instance/index.js';
5
+ export * as ClassComponent from '../../classy/class/index.js';
@@ -2,10 +2,10 @@
2
2
  * <!-- @ mergeModuleWith API -->
3
3
  * @module Helpers
4
4
  */
5
- export * from './mount-state';
6
- export * from './rerender';
7
- export * from './use-component';
8
- export * from './type-guards';
5
+ export * from './mount-state.js';
6
+ export * from './rerender.js';
7
+ export * from './use-component/index.js';
8
+ export * from './type-guards.js';
9
9
  /**
10
10
  * An empty function.
11
11
  * It returns (void) without performing any operations.
@@ -2,10 +2,10 @@
2
2
  * <!-- @ mergeModuleWith API -->
3
3
  * @module Helpers
4
4
  */
5
- export * from './mount-state';
6
- export * from './rerender';
7
- export * from './use-component';
8
- export * from './type-guards';
5
+ export * from './mount-state.js';
6
+ export * from './rerender.js';
7
+ export * from './use-component/index.js';
8
+ export * from './type-guards.js';
9
9
  /**
10
10
  * An empty function.
11
11
  * It returns (void) without performing any operations.
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useRef, useState } from 'react';
2
- import { useMountState } from '../helpers/mount-state';
2
+ import { useMountState } from '../helpers/mount-state.js';
3
3
  ;
4
4
  /**
5
5
  * Returns a function that can be called to manually trigger
@@ -1,4 +1,4 @@
1
- import type { ClassComponentHookWrapper } from './types';
1
+ import type { ClassComponentHookWrapper } from './types.js';
2
2
  /**
3
3
  * A component you can use to consume React hooks
4
4
  * in a {@link Component | React.Component} class.
package/build/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './classy';
2
- export * from './base';
3
- export * from './helpers';
1
+ export * from './classy/index.js';
2
+ export * from './base/index.js';
3
+ export * from './helpers/index.js';
package/build/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from './classy';
2
- export * from './base';
3
- export * from './helpers';
1
+ export * from './classy/index.js';
2
+ export * from './base/index.js';
3
+ export * from './helpers/index.js';
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement, ReactNode, ReactPortal } from 'react';
2
- import type { IUseSlots, PotentialSlotComponent } from './types';
2
+ import type { IUseSlots, PotentialSlotComponent } from './types.js';
3
3
  export declare const isElementChild: (child: ReactNode) => child is ReactElement<any, any>;
4
4
  interface IGetSlotName {
5
5
  (TargetComponent: PotentialSlotComponent, child?: ReactElement): string | undefined;
@@ -17,4 +17,4 @@ export declare const isPortalChild: (child: ReactNode) => child is ReactPortal;
17
17
  * @see {@link SlotComponent} for more on how to use the returned slot nodes.
18
18
  */
19
19
  export declare const useSlots: IUseSlots;
20
- export type { SlottedComponent, TSlotsRecord, SlotComponent, PotentialSlotComponent, } from './types';
20
+ export type { SlottedComponent, TSlotsRecord, SlotComponent, PotentialSlotComponent, } from './types.js';
@@ -1,4 +1,4 @@
1
- import { throwDevError } from '../helpers/errors';
1
+ import { throwDevError } from '../helpers/errors.js';
2
2
  import React, { useMemo } from 'react';
3
3
  export const isElementChild = (child) => {
4
4
  if (child && typeof child === 'object' && 'type' in child) {
@@ -1 +1 @@
1
- export * from './hook';
1
+ export * from './hook.js';
@@ -1 +1 @@
1
- export * from './hook';
1
+ export * from './hook.js';
@@ -35,6 +35,10 @@
35
35
  "strictBindCallApply": true,
36
36
  "exactOptionalPropertyTypes": true,
37
37
  },
38
+ "tsc-alias": {
39
+ "resolveFullPaths": true,
40
+ "resolveFullExtension": ".js"
41
+ },
38
42
  "include": [
39
43
  "./globals.d.ts",
40
44
  "**/*.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/oore",
3
- "version": "2.0.0-alpha.22",
3
+ "version": "2.0.0-alpha.24",
4
4
  "description": "A library of helpers for writing cleaner React function components with object-oriented patterns.",
5
5
  "engines": {
6
6
  "node": ">=22"