@jscrpt/common 2.1.0 → 2.2.0-beta.20211216105427

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/changelog.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 2.2.0 (2021-12-16)
4
+
5
+ ### Bug Fixes
6
+
7
+ - fixed `BindThis` now accepts any type of fuction, not only without parameters
8
+ - fixed `Action` now allows correctly to specify type of arguments
9
+ - fixed `Func` now allows correctly to specify type of arguments
10
+
11
+ ### Features
12
+
13
+ - added `AsAnyDictionary` represents type that extracts class as type Record with property keys as index and any property values
14
+ - added `FuncSignature` type that extracts function signature from function type
15
+
3
16
  ## Version 2.1.0 (2021-12-15)
4
17
 
5
18
  ### Features
@@ -1 +1 @@
1
- {"version":3,"file":"bindThis.decorator.mjs","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
1
+ {"version":3,"file":"bindThis.decorator.mjs","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any, any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dictionaries.mjs","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
1
+ {"version":3,"file":"dictionaries.mjs","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents type that extracts class as type Record with property keys as index and any property values\r\n */\r\nexport type AsAnyDictionary<TType extends Object> = TType extends {[P in keyof TType]: any} ? Record<keyof TType, any> : any;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"enums.mjs","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};"]}
1
+ {"version":3,"file":"enums.mjs","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"functions.mjs","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n */\nexport type Action = (...args: unknown[]) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n */\nexport type Func<TResult = unknown> = (...args: unknown[]) => TResult;"]}
1
+ {"version":3,"file":"functions.mjs","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that extracts function signature from function type\n */\nexport type FuncSignature<TResult extends (...args: any) => any> = TResult extends (...args: infer P) => infer R ? (...args: P) => R : never;\n\n/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n * @typeParam TArgs - Type parameters for function\n */\nexport type Action<TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n * @typeParam TArgs - Type parameters for function\n */\nexport type Func<TResult = unknown, TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => TResult;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
1
+ {"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any, any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
1
+ {"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents type that extracts class as type Record with property keys as index and any property values\r\n */\r\nexport type AsAnyDictionary<TType extends Object> = TType extends {[P in keyof TType]: any} ? Record<keyof TType, any> : any;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};"]}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n */\nexport type Action = (...args: unknown[]) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n */\nexport type Func<TResult = unknown> = (...args: unknown[]) => TResult;"]}
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that extracts function signature from function type\n */\nexport type FuncSignature<TResult extends (...args: any) => any> = TResult extends (...args: infer P) => infer R ? (...args: P) => R : never;\n\n/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n * @typeParam TArgs - Type parameters for function\n */\nexport type Action<TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n * @typeParam TArgs - Type parameters for function\n */\nexport type Func<TResult = unknown, TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => TResult;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;IAEhG,MAAM,aAAa,GAAS,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
1
+ {"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;IAEhG,MAAM,aAAa,GAAS,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any, any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
1
+ {"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents type that extracts class as type Record with property keys as index and any property values\r\n */\r\nexport type AsAnyDictionary<TType extends Object> = TType extends {[P in keyof TType]: any} ? Record<keyof TType, any> : any;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};"]}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n */\nexport type Action = (...args: unknown[]) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n */\nexport type Func<TResult = unknown> = (...args: unknown[]) => TResult;"]}
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that extracts function signature from function type\n */\nexport type FuncSignature<TResult extends (...args: any) => any> = TResult extends (...args: infer P) => infer R ? (...args: P) => R : never;\n\n/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n * @typeParam TArgs - Type parameters for function\n */\nexport type Action<TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n * @typeParam TArgs - Type parameters for function\n */\nexport type Func<TResult = unknown, TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => TResult;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,IAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,kDAA2C,WAAW,CAAC,QAAQ,EAAE,2BAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG,EAAH;YAEI,IAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
1
+ {"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,IAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,kDAA2C,WAAW,CAAC,QAAQ,EAAE,2BAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG,EAAH;YAEI,IAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any, any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
1
+ {"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents type that extracts class as type Record with property keys as index and any property values\r\n */\r\nexport type AsAnyDictionary<TType extends Object> = TType extends {[P in keyof TType]: any} ? Record<keyof TType, any> : any;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};"]}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n */\nexport type Action = (...args: unknown[]) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n */\nexport type Func<TResult = unknown> = (...args: unknown[]) => TResult;"]}
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that extracts function signature from function type\n */\nexport type FuncSignature<TResult extends (...args: any) => any> = TResult extends (...args: infer P) => infer R ? (...args: P) => R : never;\n\n/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n * @typeParam TArgs - Type parameters for function\n */\nexport type Action<TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n * @typeParam TArgs - Type parameters for function\n */\nexport type Func<TResult = unknown, TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => TResult;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bindThis.decorator.cjs","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":";;;AACA,wCAAyC;AAEzC;;GAEG;AACH,SAAgB,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,IAAA,iBAAU,EAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC;AA1BD,4BA0BC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
1
+ {"version":3,"file":"bindThis.decorator.cjs","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":";;;AACA,wCAAyC;AAEzC;;GAEG;AACH,SAAgB,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;;IAEhG,MAAM,aAAa,GAAS,MAAA,UAAU,CAAC,KAAK,mCAAI,MAAA,UAAU,CAAC,GAAG,+CAAd,UAAU,CAAQ,CAAC;IAEnE,IAAG,CAAC,IAAA,iBAAU,EAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC;AA1BD,4BA0BC","sourcesContent":["import {Func} from '../types/functions';\r\nimport {isFunction} from '../utils/lang';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any, any>>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dictionaries.cjs","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
1
+ {"version":3,"file":"dictionaries.cjs","sourceRoot":"","sources":["../../../src/types/dictionaries.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Represents type that extracts class as type Record with property keys as index and unknown property values\r\n */\r\nexport type AsDictionary<TType extends Object> = TType extends {[P in keyof TType]: unknown} ? Record<keyof TType, unknown> : unknown;\r\n\r\n/**\r\n * Represents type that extracts class as type Record with property keys as index and any property values\r\n */\r\nexport type AsAnyDictionary<TType extends Object> = TType extends {[P in keyof TType]: any} ? Record<keyof TType, any> : any;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is defined by typeparam\r\n * @typeparam TData - Type of property value\r\n */\r\nexport type Dictionary<TData = unknown> = Record<string, TData>;\r\n\r\n/**\r\n * Represents Record type where, key is string and value is string\r\n */\r\nexport type StringDictionary = Record<string, string>;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"enums.cjs","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};"]}
1
+ {"version":3,"file":"enums.cjs","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that represents enum type\n */\nexport type Enum<E = unknown> = Record<keyof E, number | string> & {[k: number]: string};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"functions.cjs","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n */\nexport type Action = (...args: unknown[]) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n */\nexport type Func<TResult = unknown> = (...args: unknown[]) => TResult;"]}
1
+ {"version":3,"file":"functions.cjs","sourceRoot":"","sources":["../../../src/types/functions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type that extracts function signature from function type\n */\nexport type FuncSignature<TResult extends (...args: any) => any> = TResult extends (...args: infer P) => infer R ? (...args: P) => R : never;\n\n/**\n * Function definition with no variables and no return type\n */\nexport type NoopAction = () => void;\n\n/**\n * Function definition with variable arguments and no return type\n * @typeParam TArgs - Type parameters for function\n */\nexport type Action<TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => void;\n\n/**\n * Function definition with variable arguments and return type\n * @typeParam TResult - Return type of function\n * @typeParam TArgs - Type parameters for function\n */\nexport type Func<TResult = unknown, TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => TResult;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jscrpt/common",
3
- "version": "2.1.0",
3
+ "version": "2.2.0-beta.20211216105427",
4
4
  "description": "Common javascript tools, utilities and other usefull stuff",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -65,9 +65,9 @@
65
65
  "devDependencies": {
66
66
  "rxjs": "^6.6.7",
67
67
  "@types/extend": "^3.0.1",
68
- "@microsoft/api-extractor": "7.18.19",
69
- "@microsoft/api-documenter": "7.13.67",
70
- "tslib": "^2.3.1",
68
+ "@microsoft/api-extractor": "7.19.2",
69
+ "@microsoft/api-documenter": "7.13.77",
70
+ "tslib": "2.3.1",
71
71
  "eslint": "7.32.0",
72
72
  "@typescript-eslint/eslint-plugin": "4.33.0",
73
73
  "@typescript-eslint/parser": "4.33.0",
package/rxjs/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "../module/rxjs/src/index.cjs",
5
5
  "module": "../module/rxjs/src/index.cjs",
6
6
  "browser": "../es2015/rxjs/src/index.js",
7
- "esm2015": "../es2015/rxjs/src/index.js",
7
+ "es2015": "../es2015/rxjs/src/index.js",
8
8
  "es2020": "../es2020/rxjs/src/index.js",
9
9
  "esm2020": "../es2020/rxjs/src/index.js",
10
10
  "typings": "./src/index.d.ts"
@@ -2,5 +2,5 @@ import { Func } from '../types/functions';
2
2
  /**
3
3
  * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first
4
4
  */
5
- export declare function BindThis(_target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any>>;
5
+ export declare function BindThis(_target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func<any, any>>;
6
6
  //# sourceMappingURL=bindThis.decorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bindThis.decorator.d.ts","sourceRoot":"","sources":["bindThis.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAGxC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAC,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CA0BxI"}
1
+ {"version":3,"file":"bindThis.decorator.d.ts","sourceRoot":"","sources":["bindThis.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAGxC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAC,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,uBAAuB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CA0B7I"}
@@ -4,6 +4,12 @@
4
4
  export declare type AsDictionary<TType extends Object> = TType extends {
5
5
  [P in keyof TType]: unknown;
6
6
  } ? Record<keyof TType, unknown> : unknown;
7
+ /**
8
+ * Represents type that extracts class as type Record with property keys as index and any property values
9
+ */
10
+ export declare type AsAnyDictionary<TType extends Object> = TType extends {
11
+ [P in keyof TType]: any;
12
+ } ? Record<keyof TType, any> : any;
7
13
  /**
8
14
  * Represents Record type where, key is string and value is defined by typeparam
9
15
  * @typeparam TData - Type of property value
@@ -1 +1 @@
1
- {"version":3,"file":"dictionaries.d.ts","sourceRoot":"","sources":["dictionaries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY,CAAC,KAAK,SAAS,MAAM,IAAI,KAAK,SAAS;KAAE,CAAC,IAAI,MAAM,KAAK,GAAG,OAAO;CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;AAEtI;;;GAGG;AACH,oBAAY,UAAU,CAAC,KAAK,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEhE;;GAEG;AACH,oBAAY,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"dictionaries.d.ts","sourceRoot":"","sources":["dictionaries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY,CAAC,KAAK,SAAS,MAAM,IAAI,KAAK,SAAS;KAAE,CAAC,IAAI,MAAM,KAAK,GAAG,OAAO;CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;AAEtI;;GAEG;AACH,oBAAY,eAAe,CAAC,KAAK,SAAS,MAAM,IAAI,KAAK,SAAS;KAAE,CAAC,IAAI,MAAM,KAAK,GAAG,GAAG;CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;AAE7H;;;GAGG;AACH,oBAAY,UAAU,CAAC,KAAK,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEhE;;GAEG;AACH,oBAAY,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -1,14 +1,20 @@
1
+ /**
2
+ * Type that extracts function signature from function type
3
+ */
4
+ export declare type FuncSignature<TResult extends (...args: any) => any> = TResult extends (...args: infer P) => infer R ? (...args: P) => R : never;
1
5
  /**
2
6
  * Function definition with no variables and no return type
3
7
  */
4
8
  export declare type NoopAction = () => void;
5
9
  /**
6
10
  * Function definition with variable arguments and no return type
11
+ * @typeParam TArgs - Type parameters for function
7
12
  */
8
- export declare type Action = (...args: unknown[]) => void;
13
+ export declare type Action<TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => void;
9
14
  /**
10
15
  * Function definition with variable arguments and return type
11
16
  * @typeParam TResult - Return type of function
17
+ * @typeParam TArgs - Type parameters for function
12
18
  */
13
- export declare type Func<TResult = unknown> = (...args: unknown[]) => TResult;
19
+ export declare type Func<TResult = unknown, TArgs extends Array<unknown> = unknown[]> = (...args: TArgs) => TResult;
14
20
  //# sourceMappingURL=functions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["functions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,UAAU,GAAG,MAAM,IAAI,CAAC;AAEpC;;GAEG;AACH,oBAAY,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAElD;;;GAGG;AACH,oBAAY,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC"}
1
+ {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["functions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa,CAAC,OAAO,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,OAAO,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AAE7I;;GAEG;AACH,oBAAY,UAAU,GAAG,MAAM,IAAI,CAAC;AAEpC;;;GAGG;AACH,oBAAY,MAAM,CAAC,KAAK,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;AAExF;;;;GAIG;AACH,oBAAY,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,KAAK,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC"}
package/version.bak CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.2.0-beta.20211216105427