mnemonica 0.9.955 → 0.9.957

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.
package/build/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export type { IDEF } from './types';
3
3
  export declare const defaultTypes: any;
4
4
  type Proto<P, T> = Pick<P, Exclude<keyof P, keyof T>> & T;
5
5
  type RN = Record<string | symbol, unknown>;
6
- type SN = Record<string | symbol, new () => unknown>;
6
+ type SN = Record<string, new () => unknown>;
7
7
  interface IDefinitorInstance<N extends RN, S> {
8
8
  new (): {
9
9
  [key in keyof S]: S[key];
@@ -11,12 +11,12 @@ interface IDefinitorInstance<N extends RN, S> {
11
11
  define: IDefinitor<N, string>;
12
12
  }
13
13
  interface IDefinitor<P extends RN, SubTypeName extends string> {
14
- <PP extends RN, T extends RN, M extends Proto<P, Proto<PP, T>>, S extends SN & M>(this: unknown, TypeName: SubTypeName, constructHandler: IDEF<T>, proto?: PP, config?: object): IDefinitorInstance<M, S>;
14
+ <PP extends object, T extends RN, M extends Proto<P, Proto<PP, T>>, S extends SN & M>(this: unknown, TypeName: SubTypeName, constructHandler: IDEF<T>, proto?: PP, config?: object): IDefinitorInstance<M, S>;
15
15
  }
16
- export declare const define: <T extends RN, P extends RN, N extends Proto<P, T>, SubTypeName extends string, NC extends SN, S extends NC & N, R extends {
16
+ export declare const define: <T extends RN, P extends object, N extends Proto<P, T>, SubTypeName extends string, S extends SN & N, R extends {
17
17
  new (): { [key in keyof S]: S[key]; };
18
18
  define: IDefinitor<N, SubTypeName>;
19
- }>(this: unknown, TypeName: string, constructHandler: IDEF<T>, proto?: P | undefined, config?: {}) => R;
19
+ }>(this: unknown, TypeName?: string, constructHandler?: IDEF<T> | undefined, proto?: P | undefined, config?: {}) => R;
20
20
  export declare const lookup: TypeLookup;
21
21
  export declare const mnemonica: {
22
22
  [index: string]: unknown;
@@ -26,7 +26,7 @@ export declare const defaultCollection: any;
26
26
  export declare const errors: any;
27
27
  export { utils } from './utils';
28
28
  export { defineStackCleaner } from './utils';
29
- export declare function apply<E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, args: unknown[]): {
29
+ export declare function apply<E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, args?: unknown[]): {
30
30
  [key in keyof S]: S[key];
31
31
  };
32
32
  export declare function call<E extends RN, T extends RN, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, ...args: unknown[]): {
@@ -1,5 +1,4 @@
1
- type RN = Record<string | symbol, unknown>;
2
- export type IDEF<T extends RN> = {
1
+ export type IDEF<T> = {
3
2
  new (): T;
4
3
  } | {
5
4
  (this: T): void;
@@ -17,12 +16,11 @@ export type TypeClass = {
17
16
  registerHook: (type: 'preCreation' | 'postCreation' | 'creationError', hook: CallableFunction) => unknown;
18
17
  };
19
18
  export type TypeAbsorber = (this: unknown, TypeName: string, constructHandler: CallableFunction, proto?: object, config?: object) => TypeClass;
20
- export type ITypeAbsorber<T extends RN> = (this: unknown, TypeName: string, constructHandler: IDEF<T>, proto?: object, config?: object) => ITypeClass<T>;
21
- export interface ITypeClass<T extends RN> {
19
+ export type ITypeAbsorber<T> = (this: unknown, TypeName: string, constructHandler: IDEF<T>, proto?: object, config?: object) => ITypeClass<T>;
20
+ export interface ITypeClass<T> {
22
21
  new (...args: unknown[]): T;
23
22
  (this: T, ...args: unknown[]): T;
24
23
  define: ITypeAbsorber<T>;
25
24
  lookup: TypeLookup;
26
25
  registerHook: (type: 'preCreation' | 'postCreation' | 'creationError', hook: CallableFunction) => unknown;
27
26
  }
28
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnemonica",
3
- "version": "0.9.955",
3
+ "version": "0.9.957",
4
4
  "description": "abstract technique that aids information retention : instance inheritance system",
5
5
  "type": "commonjs",
6
6
  "main": "./build/index.js",
@@ -63,12 +63,12 @@
63
63
  },
64
64
  "homepage": "https://github.com/wentout/mnemonica#readme",
65
65
  "devDependencies": {
66
- "@types/jest": "^29.5.7",
67
- "@types/node": "^18.18.8",
66
+ "@types/jest": "^29.5.8",
67
+ "@types/node": "^18.18.9",
68
68
  "@typescript-eslint/eslint-plugin": "^5.62.0",
69
69
  "@typescript-eslint/parser": "^5.62.0",
70
70
  "chai": "^4.3.10",
71
- "eslint": "^8.52.0",
71
+ "eslint": "^8.53.0",
72
72
  "eslint-plugin-import": "^2.29.0",
73
73
  "eslint-plugin-mocha": "^10.2.0",
74
74
  "eslint-plugin-no-arrow-this": "^1.2.0",