@avstantso/concepts 1.1.0 → 1.2.2

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 (46) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/_global/async-tasks.d.ts +134 -0
  3. package/dist/_global/classic-enum.d.ts +29 -0
  4. package/dist/_global/compare/_register.d.ts +32 -0
  5. package/dist/_global/compare/combination.d.ts +41 -0
  6. package/dist/_global/compare/compare.d.ts +39 -0
  7. package/dist/_global/compare/index.d.ts +4 -0
  8. package/dist/_global/compare/structures.d.ts +10 -0
  9. package/dist/_global/conveyor.d.ts +18 -0
  10. package/dist/_global/equality/_register.d.ts +35 -0
  11. package/dist/_global/equality/equality.d.ts +32 -0
  12. package/dist/_global/equality/index.d.ts +2 -0
  13. package/dist/_global/extend/_register.d.ts +76 -0
  14. package/dist/_global/extend/index.d.ts +1 -0
  15. package/dist/_global/index.d.ts +15 -0
  16. package/dist/_global/mapping/_register.d.ts +59 -0
  17. package/dist/_global/mapping/index.d.ts +2 -0
  18. package/dist/_global/mapping/mapping.d.ts +138 -0
  19. package/dist/_global/mock.d.ts +11 -0
  20. package/dist/_global/override.d.ts +50 -0
  21. package/dist/_global/perform/_register.d.ts +107 -0
  22. package/dist/_global/perform/index.d.ts +1 -0
  23. package/dist/_global/provider/_register.d.ts +16 -0
  24. package/dist/_global/provider/combination.d.ts +96 -0
  25. package/dist/_global/provider/compare.d.ts +47 -0
  26. package/dist/_global/provider/extract.d.ts +36 -0
  27. package/dist/_global/provider/force.d.ts +35 -0
  28. package/dist/_global/provider/index.d.ts +10 -0
  29. package/dist/_global/provider/is.d.ts +38 -0
  30. package/dist/_global/provider/provider.d.ts +85 -0
  31. package/dist/_global/provider/strict.d.ts +29 -0
  32. package/dist/_global/provider/union.d.ts +29 -0
  33. package/dist/_global/provider/value.d.ts +26 -0
  34. package/dist/_global/stub.d.ts +40 -0
  35. package/dist/_global/switch/_register.d.ts +45 -0
  36. package/dist/_global/switch/index.d.ts +2 -0
  37. package/dist/_global/switch/switch.d.ts +13 -0
  38. package/dist/_global/transition.d.ts +62 -0
  39. package/dist/_global/value-wrap.d.ts +12 -0
  40. package/dist/_std-ext/abort-controller.d.ts +7 -0
  41. package/dist/_std-ext/index.d.ts +1 -0
  42. package/dist/export.d.ts +16 -0
  43. package/dist/index.d.ts +5 -0
  44. package/dist/index.js +699 -0
  45. package/dist/index.js.map +1 -0
  46. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+
4
+ ## [1.2.2] - 2026-01-31
5
+
6
+ ### Changed
7
+
8
+ - Updated `@avstantso/ts` dependency (Updated @avstantso/ts dependency (fix String, Filter))
9
+
10
+
11
+ ## [1.2.1] - 2026-01-18
12
+
13
+ ### Changed
14
+
15
+ - Fix publishing
16
+
3
17
  All notable changes to this project will be documented in this file.
4
18
 
5
19
  ## [1.1.0] - 2026-01-18
@@ -0,0 +1,134 @@
1
+ declare namespace AVStantso {
2
+ /**
3
+ * @summary Async tasks manager with gracefully finalization: for async tasks, intervals & timers
4
+ */
5
+ namespace AsyncTasksManager {
6
+ /**
7
+ * @summary Finalization options
8
+ */
9
+ type FinalOptions = {
10
+ /**
11
+ * @summary If not `quiet` send all errors to `console.error`
12
+ */
13
+ quiet?: boolean;
14
+ };
15
+ /**
16
+ * @summary Timeouts types
17
+ */
18
+ namespace Timeout {
19
+ /**
20
+ * @summary Timeout options
21
+ */
22
+ type Options = {
23
+ /**
24
+ * @summary Call interval/timeout callback on finalize
25
+ */
26
+ callOnFinal?: boolean;
27
+ };
28
+ /**
29
+ * @summary Timeout callback
30
+ */
31
+ type CallBack = (final?: boolean) => unknown;
32
+ /**
33
+ * @summary Timeout delay
34
+ */
35
+ type Delay = Parameters<typeof setInterval>[1];
36
+ /**
37
+ * @summary Timeout internal map value
38
+ */
39
+ type Value = [CallBack, Options];
40
+ /**
41
+ * @summary Timeout internal map
42
+ */
43
+ type Map = globalThis.Map<NodeJS.Timeout, Value>;
44
+ }
45
+ /**
46
+ * @summary AsyncTasksManager option for external usage
47
+ */
48
+ type Option = {
49
+ /**
50
+ * @summary Async manager for register tasks.\
51
+ * - if falsy — not used
52
+ * - if `AsyncTasksManager` instance — use it
53
+ * - if truthy — use global `AsyncTasksManager`
54
+ */
55
+ manager?: AsyncTasksManager | boolean;
56
+ };
57
+ }
58
+ interface AsyncTasksManager {
59
+ /**
60
+ * @summary Gracefully finalization for async tasks, intervals & timers
61
+ * @param options Finalization options
62
+ */
63
+ final(options?: AsyncTasksManager.FinalOptions): Promise<void>;
64
+ /**
65
+ * @summary All errors that was thrown inside `final`.\
66
+ * Accessible only after final is called
67
+ */
68
+ readonly errors?: unknown[];
69
+ /**
70
+ * @summary Wrap of standard `setInterval`
71
+ * @param callback Callback for interval
72
+ * @param delay Interval delay
73
+ * @param options Interval finalization options
74
+ * @returns Interval id
75
+ */
76
+ setInterval(callback: AsyncTasksManager.Timeout.CallBack, delay: AsyncTasksManager.Timeout.Delay, options: AsyncTasksManager.Timeout.Options): ReturnType<typeof setInterval>;
77
+ /**
78
+ * @summary Wrap of standard `clearInterval`
79
+ * @param timeout Timeout id
80
+ */
81
+ clearInterval: typeof clearInterval;
82
+ /**
83
+ * @summary Wrap of standard `setTimeout`
84
+ * @param callback Callback for timeout
85
+ * @param delay Timeout delay
86
+ * @param options Timeout finalization options
87
+ * @returns Timeout id
88
+ */
89
+ setTimeout(callback: AsyncTasksManager.Timeout.CallBack, delay: AsyncTasksManager.Timeout.Delay, options: AsyncTasksManager.Timeout.Options): ReturnType<typeof setTimeout>;
90
+ /**
91
+ * @summary Wrap of standard `clearTimeout`
92
+ * @param timeout Timeout id
93
+ */
94
+ clearTimeout: typeof clearTimeout;
95
+ /**
96
+ * @summary Register async task
97
+ * @template T Task result type
98
+ * @param task Async task
99
+ * @returns Async task (registered in manager)
100
+ */
101
+ regTask<T>(task: Promise<T>): Promise<T>;
102
+ }
103
+ namespace Code {
104
+ /**
105
+ * @summary Global Async tasks manager and utilities
106
+ */
107
+ namespace AsyncTasksManager {
108
+ type ExtenderCallback = (instance: AVStantso.AsyncTasksManager) => void;
109
+ type Utilities = {
110
+ /**
111
+ * @summary Register on create extender.\
112
+ * Unavailable after call `AVStantso.freeze` method
113
+ */
114
+ _RegOnCreate?(extenderCallback: AsyncTasksManager.ExtenderCallback): void;
115
+ /**
116
+ * @summary Create new instance of `AsyncTasksManager`
117
+ */
118
+ Factory(): AVStantso.AsyncTasksManager;
119
+ /**
120
+ * @summary Check `candidate` is `AsyncTasksManager`
121
+ */
122
+ is(candidate: unknown): candidate is AVStantso.AsyncTasksManager;
123
+ };
124
+ }
125
+ type AsyncTasksManager = AVStantso.AsyncTasksManager & AsyncTasksManager.Utilities;
126
+ }
127
+ interface Code {
128
+ /**
129
+ * @summary Global Async tasks manager and utilities
130
+ */
131
+ AsyncTasksManager: Code.AsyncTasksManager;
132
+ }
133
+ const AsyncTasksManager: Code.AsyncTasksManager;
134
+ }
@@ -0,0 +1,29 @@
1
+ declare namespace AVStantso {
2
+ /**
3
+ * @summary Classic TypeScript `enum` helpers
4
+ */
5
+ namespace ClassicEnum {
6
+ /**
7
+ * @summary `enum` `[key, value]` pairs
8
+ */
9
+ type Entry<T, K extends keyof T = Extract<keyof T, string>> = T extends object ? [K, T[K]] : never;
10
+ }
11
+ namespace Code {
12
+ /**
13
+ * @summary ClassicEnum utilities
14
+ */
15
+ interface ClassicEnum {
16
+ /**
17
+ * @summary Get enum entries without `[value, key]` pairs
18
+ */
19
+ entries<T>(enumType: T): AVStantso.ClassicEnum.Entry<T>[];
20
+ }
21
+ }
22
+ interface Code {
23
+ /**
24
+ * @summary ClassicEnum utilities
25
+ */
26
+ ClassicEnum: Code.ClassicEnum;
27
+ }
28
+ const ClassicEnum: Code.ClassicEnum;
29
+ }
@@ -0,0 +1,32 @@
1
+ declare namespace AVStantso {
2
+ namespace Code {
3
+ /**
4
+ * @summary Compare helpers utility
5
+ */
6
+ interface Compare {
7
+ /**
8
+ * @summary Low-lewel extend compare function. Add `Compare.Extended<TBase>`
9
+ * @param compareFunc Function to extend
10
+ */
11
+ Extend<TBase>(compareFunc: AVStantso.Compare.Func<TBase>): AVStantso.Compare<TBase>;
12
+ /**
13
+ * @summary Create low-lewel sort-part function for `undefined`, `null`, 'NaN'
14
+ * @param allowNaN Allow check 'NaN'
15
+ * @param nullsFirst If `true` — `undefined`, `null`, 'NaN' has higher priority
16
+ */
17
+ ToNulls(allowNaN?: boolean, nullsFirst?: boolean): (x: unknown) => number;
18
+ /**
19
+ * @summary Select first non-zero comparison
20
+ * @returns First non-zero comparison or `0` if its`s not found
21
+ */
22
+ Select(...comparisons: AVStantso.Perform<number>[]): number;
23
+ }
24
+ }
25
+ interface Code {
26
+ /**
27
+ * @summary Compare helpers utility
28
+ */
29
+ Compare: Code.Compare;
30
+ }
31
+ const Compare: Code.Compare;
32
+ }
@@ -0,0 +1,41 @@
1
+ declare namespace AVStantso {
2
+ namespace Compare {
3
+ type _Combination<TCompares extends readonly Union[], R = unknown> = TCompares extends readonly [infer C extends Union, ...infer Rest extends readonly Union[]] ? _Combination<Rest, R & Extract<Value<C>[__BASE_TYPE__], object>> : Compare<{
4
+ [K in keyof R]: R[K];
5
+ }>;
6
+ /**
7
+ * @summary Create combined structural `Compare` by array of structural compares
8
+ * @template TCompares Array of structural compares
9
+ * @returns Combined structural `Compare`
10
+ * @example
11
+ * type cmpId = AVStantso.Provider.Compare.Make<'id', string>;
12
+ * type cmpName = AVStantso.Provider.Compare.Make<'name', string>;
13
+ * type cmpVersion = AVStantso.Provider.Compare.Make<'version', number>;
14
+ *
15
+ * type c = Combination<[cmpId, cmpName, cmpVersion]>;
16
+ *
17
+ * type t = CheckType<c, Compare<{ id: string; name: string; version: number; }>>;
18
+ */
19
+ export type Combination<TCompares extends Union[]> = _Combination<TCompares>;
20
+ export {};
21
+ }
22
+ namespace Code {
23
+ interface Compare {
24
+ /**
25
+ * @summary Create combined structural `Compare` by array of structural compares
26
+ * @template R Result
27
+ * @template TCompares Array of structural compares
28
+ * @returns Combined structural `Compare` as `R`
29
+ * @example
30
+ * const cmpId = Provider.Compare('id', 'string');
31
+ * const cmpName = Provider.Compare('name', 'string');
32
+ * const cmpVersion = Provider.Compare('version', 'number');
33
+ *
34
+ * const c = Compare.Combine(cmpId, cmpName, cmpVersion);
35
+ *
36
+ * type t = CheckType<typeof c, Compare<{ id: string; name: string; version: number; }>>;
37
+ */
38
+ Combine<R extends AVStantso.Compare.Combination<TCompares>, TCompares extends AVStantso.Compare.Union[] = AVStantso.Compare.Union[]>(...compares: TCompares): R;
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,39 @@
1
+ declare namespace AVStantso {
2
+ /**
3
+ * @summary Compare two values function
4
+ */
5
+ type Compare<TBase = unknown> = Compare.Func<TBase> & Compare.Extended<TBase> & {
6
+ __BASE_TYPE__?: TBase;
7
+ };
8
+ namespace Compare {
9
+ /**
10
+ * @summary Compare two values atomic function
11
+ */
12
+ type Func<TBase = unknown> = <A extends TBase = TBase, B extends TBase = TBase>(a: A, b: B) => number;
13
+ /**
14
+ * @summary `Compare` extended properties & methods
15
+ */
16
+ type Extended<TBase = unknown> = {
17
+ /**
18
+ * @summary Cast `Compare` function basetype
19
+ */
20
+ as?<R extends TBase>(): Compare<R>;
21
+ /**
22
+ * @summary Create descending `Compare` function
23
+ */
24
+ desc?: Compare<TBase>;
25
+ };
26
+ /**
27
+ * @summary Compare provider
28
+ */
29
+ type Provider = AVStantso.Provider.Strict.KeyValue<'Compare', Compare>;
30
+ /**
31
+ * @summary Compare union
32
+ */
33
+ type Union = AVStantso.Provider.Union<Provider>;
34
+ /**
35
+ * @summary Compare value of `U`
36
+ */
37
+ type Value<U extends Union> = AVStantso.Provider.Value<U, Provider>;
38
+ }
39
+ }
@@ -0,0 +1,4 @@
1
+ import './_register';
2
+ import './compare';
3
+ import './combination';
4
+ import './structures';
@@ -0,0 +1,10 @@
1
+ declare namespace AVStantso {
2
+ namespace Code {
3
+ interface Compare {
4
+ /**
5
+ * @summary Structures objects compare
6
+ */
7
+ Structures: AVStantso.Compare<object>;
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,18 @@
1
+ declare namespace AVStantso {
2
+ /**
3
+ * @summary Conveyor of handling
4
+ */
5
+ namespace Conveyor {
6
+ /**
7
+ * @summary Conveyor transformer
8
+ */
9
+ type Transformer<T> = (from: T) => T;
10
+ }
11
+ interface Code {
12
+ /**
13
+ * @summary Conveyor of handling. Ignore empty stages
14
+ */
15
+ Conveyor<T>(original: T, ...transformers: Conveyor.Transformer<T>[]): T;
16
+ }
17
+ const Conveyor: Code['Conveyor'];
18
+ }
@@ -0,0 +1,35 @@
1
+ declare namespace AVStantso {
2
+ namespace Code {
3
+ namespace Equality {
4
+ /**
5
+ * @summary `AVStantso.Equality.Predicate` utility
6
+ */
7
+ interface Predicate {
8
+ /**
9
+ * @summary Factory function for `AVStantso.Equality.Predicate`
10
+ */
11
+ Factory<T = unknown>(equality: AVStantso.Equality<T>): AVStantso.Equality.Predicate.Factory<T>;
12
+ }
13
+ }
14
+ /**
15
+ * @summary `AVStantso.Equality` utility
16
+ */
17
+ interface Equality {
18
+ /**
19
+ * @summary `AVStantso.Equality.Predicate` utility
20
+ */
21
+ Predicate: Equality.Predicate;
22
+ /**
23
+ * @summary Create equality from compare
24
+ */
25
+ From<T = unknown>(compare: AVStantso.Compare<T>): AVStantso.Equality<T>;
26
+ }
27
+ }
28
+ interface Code {
29
+ /**
30
+ * @summary `AVStantso.Equality` utility
31
+ */
32
+ Equality: Code.Equality;
33
+ }
34
+ const Equality: Code.Equality;
35
+ }
@@ -0,0 +1,32 @@
1
+ declare namespace AVStantso {
2
+ /**
3
+ * @summary Equality function for two values
4
+ */
5
+ type Equality<TBase = unknown> = Equality.Func<TBase> & {
6
+ __BASE_TYPE__?: TBase;
7
+ /**
8
+ * @summary Cast `Equality` function basetype
9
+ */
10
+ as?<T extends TBase>(): Equality<T>;
11
+ };
12
+ namespace Equality {
13
+ /**
14
+ * @summary Equality atomic function for two values
15
+ */
16
+ type Func<TBase = unknown> = <A extends TBase = TBase, B extends TBase = TBase>(a: A, b: B) => boolean;
17
+ /**
18
+ * @summary Equality function from compare function
19
+ */
20
+ type From<C extends Compare> = Equality<C[__BASE_TYPE__]>;
21
+ /**
22
+ * @summary Predicate of equality function
23
+ */
24
+ type Predicate<T = unknown> = (b: T) => boolean;
25
+ namespace Predicate {
26
+ /**
27
+ * @summary Factory function for `AVStantso.Equality.Predicate`
28
+ */
29
+ type Factory<T = unknown> = (a: T, notEquals?: boolean) => Predicate<T>;
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,2 @@
1
+ import './_register';
2
+ import './equality';
@@ -0,0 +1,76 @@
1
+ declare namespace AVStantso {
2
+ namespace Extend {
3
+ namespace ByRecord {
4
+ type Original = object | Function;
5
+ type Extender<TOriginal extends Original, TExtensionKey extends TS.Key, TExtensionItem, TExtensionValue = TExtensionKey> = (value: TExtensionValue, original?: TOriginal, key?: TExtensionKey) => TExtensionItem;
6
+ type Func<TExtensionKey extends TS.Key, TExtensionValue, TCustomKey extends TS.Key = TExtensionKey> = <TOriginal extends Extend.ByRecord.Original, TExtensionItem, TExtension extends Record<TCustomKey, TExtensionItem>>(original: TOriginal, extender: Extend.ByRecord.Extender<TOriginal, TExtensionKey, TExtensionItem, TExtensionValue>) => TOriginal & TExtension;
7
+ type Methods<TExtensionKey extends TS.Key, TExtensionValue, TCustomKey extends TS.Key = TExtensionKey> = Func<TExtensionKey, TExtensionValue, TCustomKey> & {
8
+ static: Func<TExtensionKey, TExtensionValue, TCustomKey>;
9
+ };
10
+ }
11
+ /**
12
+ * @summary Add fields by record
13
+ * @param original Entity for extend
14
+ * @param extender Addition item by key
15
+ * @returns Extended entity
16
+ */
17
+ type ByRecord<TExtensionKey extends TS.Key, TExtensionValue> = Extend.ByRecord.Methods<TExtensionKey, TExtensionValue> & {
18
+ /**
19
+ * @summary Add fields by record with capitalized keys
20
+ * @param original Entity for extend
21
+ * @param extender Addition item by key
22
+ * @returns Extended entity
23
+ */
24
+ Capitalized: Extend.ByRecord.Methods<TExtensionKey, TExtensionValue, Capitalize<Extract<TExtensionKey, string>>>;
25
+ /**
26
+ * @summary Add fields by record with uncapitalized keys
27
+ * @param original Entity for extend
28
+ * @param extender Addition item by key
29
+ * @returns Extended entity
30
+ */
31
+ Uncapitalized: Extend.ByRecord.Methods<TExtensionKey, TExtensionValue, Uncapitalize<Extract<TExtensionKey, string>>>;
32
+ };
33
+ /**
34
+ * @summary Add arbitrary properties
35
+ * @param original Entity for extend
36
+ * @param extention properties
37
+ * @returns Extended entity
38
+ */
39
+ type Arbitrary = <TOriginal, TExtension extends object>(original: TOriginal, extention: TExtension | (() => TExtension)) => TOriginal & TExtension;
40
+ }
41
+ namespace Code {
42
+ /**
43
+ * @summary `AVStantso.Extend` utility
44
+ */
45
+ interface Extend {
46
+ /**
47
+ * @summary Add fields by record
48
+ * @param keys Keys for add
49
+ * @param getValue Value by key. If empty, "value"="key"
50
+ * @param original Entity for extend
51
+ * @param extender Addition item by key
52
+ * @returns (original, extender) => <Extended_Entity>
53
+ */
54
+ ByRecord<TExtensionKey extends AVStantso.TS.Key, TExtensionValue = TExtensionKey>(keys: TExtensionKey[] | (() => TExtensionKey[]), getValue?: (key: TExtensionKey) => TExtensionValue): Extend.ByRecord<TExtensionKey, TExtensionValue>;
55
+ /**
56
+ * @summary Add arbitrary properties
57
+ * @param original Entity for extend
58
+ * @param extention properties
59
+ * @returns Extended entity
60
+ */
61
+ Arbitrary: Extend.Arbitrary;
62
+ }
63
+ }
64
+ interface Code {
65
+ /**
66
+ * @summary `AVStantso.Extend` utility
67
+ */
68
+ Extend: Code.Extend;
69
+ }
70
+ /**
71
+ * @summary Cast object or function for add extended fields
72
+ * @param from as TFrom
73
+ * @returns from as TTo
74
+ */
75
+ const Extend: Code.Extend;
76
+ }
@@ -0,0 +1 @@
1
+ import './_register';
@@ -0,0 +1,15 @@
1
+ import './perform';
2
+ import './compare';
3
+ import './provider';
4
+ import './equality';
5
+ import './extend';
6
+ import './switch';
7
+ import './stub';
8
+ import './mock';
9
+ import './mapping';
10
+ import './conveyor';
11
+ import './override';
12
+ import './transition';
13
+ import './value-wrap';
14
+ import './async-tasks';
15
+ import './classic-enum';
@@ -0,0 +1,59 @@
1
+ declare namespace AVStantso {
2
+ namespace Code {
3
+ namespace Mapping {
4
+ /**
5
+ * @summary Mapping factoru function
6
+ */
7
+ interface Factory<TMap extends object, TProviderFiled extends AVStantso.Mapping.ProviderKey<TMap> = undefined> {
8
+ <TTemplate extends AVStantso.Mapping.Template<TMap>, TValueBase extends AVStantso.Mapping.ValueBase<TMap, TProviderFiled> = AVStantso.Mapping.ValueBase<TMap, TProviderFiled>, TValueUnionBase extends AVStantso.Mapping.ValueUnionBase<TMap, TProviderFiled, TValueBase> = AVStantso.Mapping.ValueUnionBase<TMap, TProviderFiled, TValueBase>>(template: TTemplate): AVStantso.Mapping<TMap, TTemplate, TProviderFiled, TValueBase, TValueUnionBase>;
9
+ }
10
+ }
11
+ /**
12
+ * @summary Mapping helpers utility
13
+ */
14
+ interface Mapping {
15
+ /**
16
+ * @summary Find in `TTemplate` of the specified type a property with a name corresponding to `TMap` type
17
+ * - by value of `TMap[keyof TMap] | TMap[keyof TMap][TProviderFiled]` (with `TProviderFiled`) *
18
+ * @template TMap Type of map for create `Mapping.Factory` function
19
+ * @template TProviderFiled Type of provider field
20
+ * @param field Provider field. If `undefined` — provider values not supports
21
+ * @param keyFromValue Get key from value function
22
+ * @param map Source of `TMap` type parameter. Not used in runtime
23
+ */
24
+ <TMap extends object, TProviderFiled extends AVStantso.Mapping.ProviderKey<TMap> = undefined>(field: TProviderFiled, keyFromValue: AVStantso.Mapping.KeyFromValue<TMap>, map?: TMap): Mapping.Factory<TMap, TProviderFiled>;
25
+ /**
26
+ * @summary Find in `TTemplate` of the specified type a property with a name corresponding to `TMap` type
27
+ * - by value of `TMap[keyof TMap]` (without `TProviderFiled`)
28
+ * @template TMap Type of map for create `Mapping.Factory` function
29
+ * @param keyFromValue Get key from value function
30
+ * @param map Source of `TMap` type parameter. Not used in runtime
31
+ */
32
+ <TMap extends object>(keyFromValue: AVStantso.Mapping.KeyFromValue<TMap>, map?: TMap): Mapping.Factory<TMap>;
33
+ /**
34
+ * @summary Find in `TTemplate` of the specified type a property with a name corresponding to `TMap` type
35
+ * - by value of `TMap[keyof TMap] | TMap[keyof TMap][TProviderFiled]` (with `TProviderFiled`) *
36
+ * @template TMap Type of map for create `Mapping.Factory` function
37
+ * @template TProviderFiled Type of provider field
38
+ * @param field Provider field. If `undefined` — provider values not supports
39
+ * @param map Source of `TMap` type parameter
40
+ */
41
+ <TMap extends object, TProviderFiled extends AVStantso.Mapping.ProviderKey<TMap>>(field: TProviderFiled, map: TMap): Mapping.Factory<TMap, TProviderFiled>;
42
+ /**
43
+ * @summary Find in `TTemplate` of the specified type a property with a name corresponding to `TMap` type
44
+ * - by value of `TMap[keyof TMap]` (without `TProviderFiled`)
45
+ * @template TMap Type of map for create `Mapping.Factory` function
46
+ * @param keyFromValue Get key from value function
47
+ * @param map Source of `TMap` type parameter
48
+ */
49
+ <TMap extends object>(map: TMap): Mapping.Factory<TMap>;
50
+ }
51
+ }
52
+ interface Code {
53
+ /**
54
+ * @summary Mapping helpers utility
55
+ */
56
+ Mapping: Code.Mapping;
57
+ }
58
+ const Mapping: Code.Mapping;
59
+ }
@@ -0,0 +1,2 @@
1
+ import './_register';
2
+ import './mapping';