mnemonica 0.9.959 → 0.9.970

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 (2) hide show
  1. package/build/index.d.ts +11 -0
  2. package/package.json +1 -1
package/build/index.d.ts CHANGED
@@ -12,9 +12,20 @@ interface IDefinitorInstance<N extends object, S> {
12
12
  interface IDefinitor<P extends object, SubTypeName extends string> {
13
13
  <PP extends object, T, 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
14
  }
15
+ type hooksTypes = 'preCreation' | 'postCreation' | 'creationError';
16
+ type hooksOpts = {
17
+ TypeName: string;
18
+ args: unknown[];
19
+ existentInstance: object;
20
+ inheritedInstance: object;
21
+ };
22
+ type hook = {
23
+ (opts: hooksOpts): void;
24
+ };
15
25
  export declare const define: <T, P extends object, N extends Proto<P, T>, SubTypeName extends string, S extends SN & N, R extends {
16
26
  new (): { [key in keyof S]: S[key]; };
17
27
  define: IDefinitor<N, SubTypeName>;
28
+ registerHook: (hookType: hooksTypes, cb: hook) => void;
18
29
  }>(this: unknown, TypeName?: string, constructHandler?: IDEF<T> | undefined, proto?: P | undefined, config?: {}) => R;
19
30
  export declare const lookup: TypeLookup;
20
31
  export declare const apply: <E extends object, T extends object, S extends Proto<E, T>>(entity: E, Constructor: IDEF<T>, args?: unknown[]) => { [key in keyof S]: S[key]; };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnemonica",
3
- "version": "0.9.959",
3
+ "version": "0.9.970",
4
4
  "description": "abstract technique that aids information retention : instance inheritance system",
5
5
  "type": "commonjs",
6
6
  "main": "./build/index.js",