@avstantso/ts 1.0.4 → 1.1.0

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 (56) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +3 -3
  3. package/dist/_global/_register.d.ts +0 -80
  4. package/dist/_global/array/_register.d.ts +0 -28
  5. package/dist/_global/array/arr-n.d.ts +0 -21
  6. package/dist/_global/array/create.d.ts +0 -59
  7. package/dist/_global/array/derivative.d.ts +0 -197
  8. package/dist/_global/array/find.d.ts +0 -89
  9. package/dist/_global/array/index.d.ts +0 -8
  10. package/dist/_global/array/low-level.d.ts +0 -84
  11. package/dist/_global/array/map-key-value.d.ts +0 -121
  12. package/dist/_global/array/min-max-sort.d.ts +0 -244
  13. package/dist/_global/ascii.d.ts +0 -76
  14. package/dist/_global/boolean.d.ts +0 -74
  15. package/dist/_global/comparisons.d.ts +0 -85
  16. package/dist/_global/func.d.ts +0 -17
  17. package/dist/_global/index.d.ts +0 -14
  18. package/dist/_global/literal.d.ts +0 -180
  19. package/dist/_global/numeric/domain/describes.d.ts +0 -62
  20. package/dist/_global/numeric/domain/generated.d.ts +0 -11240
  21. package/dist/_global/numeric/domain/inc-dec.d.ts +0 -52
  22. package/dist/_global/numeric/domain/independent.d.ts +0 -203
  23. package/dist/_global/numeric/domain/index.d.ts +0 -4
  24. package/dist/_global/numeric/inc-dec.d.ts +0 -50
  25. package/dist/_global/numeric/index.d.ts +0 -3
  26. package/dist/_global/numeric/math.d.ts +0 -257
  27. package/dist/_global/resolve.d.ts +0 -45
  28. package/dist/_global/string.d.ts +0 -306
  29. package/dist/_global/structure/_register.d.ts +0 -93
  30. package/dist/_global/structure/index.d.ts +0 -2
  31. package/dist/_global/structure/structure.d.ts +0 -289
  32. package/dist/_global/type/_register.d.ts +0 -64
  33. package/dist/_global/type/def.d.ts +0 -47
  34. package/dist/_global/type/index.d.ts +0 -7
  35. package/dist/_global/type/key-arr-def.d.ts +0 -14
  36. package/dist/_global/type/key-def.d.ts +0 -76
  37. package/dist/_global/type/key-literal-default-arr.d.ts +0 -45
  38. package/dist/_global/type/not.d.ts +0 -44
  39. package/dist/_global/type/union.d.ts +0 -33
  40. package/dist/_global/union.d.ts +0 -79
  41. package/dist/_global/utility/alt.d.ts +0 -58
  42. package/dist/_global/utility/flat.d.ts +0 -60
  43. package/dist/_global/utility/if-def.d.ts +0 -22
  44. package/dist/_global/utility/index.d.ts +0 -9
  45. package/dist/_global/utility/merge.d.ts +0 -29
  46. package/dist/_global/utility/opaque.d.ts +0 -17
  47. package/dist/_global/utility/options.d.ts +0 -34
  48. package/dist/_global/utility/override.d.ts +0 -100
  49. package/dist/_global/utility/replace-key.d.ts +0 -33
  50. package/dist/_global/utility/required-optional.d.ts +0 -24
  51. package/dist/_std-ext/index.d.ts +0 -1
  52. package/dist/_std-ext/object.d.ts +0 -23
  53. package/dist/export.d.ts +0 -2
  54. package/dist/index.d.ts +0 -4
  55. package/dist/index.js +0 -480
  56. package/dist/index.js.map +0 -1
@@ -1,180 +0,0 @@
1
- declare namespace AVStantso {
2
- namespace TS {
3
- /**
4
- * @summary Literal for available types for value
5
- */
6
- type Literal = keyof Literal.Map;
7
- namespace Literal {
8
- /**
9
- * @summary Map for available builtin types for value
10
- */
11
- type Builtins = {
12
- string: string;
13
- number: number;
14
- bigint: bigint;
15
- boolean: boolean;
16
- symbol: symbol;
17
- undefined: undefined;
18
- object: object;
19
- function: Function;
20
- };
21
- /**
22
- * @summary Map for available types for value
23
- */
24
- interface Map extends AtomicObjects, Builtins {
25
- }
26
- /**
27
- * @summary Map for number-like types.
28
- *
29
- * ⚠ Key is significant, value ignored
30
- */
31
- interface NumberLike {
32
- number: 0;
33
- bigint: 0;
34
- Date: 0;
35
- }
36
- /**
37
- * @summary If `L` is number-like returns `IfTrue` else `IfFalse`
38
- * @template L Tested literal
39
- * @template IfTrue Result, if `L` is number-like
40
- * @template IfFalse Result, if `L` NOT is number-like
41
- * @returns `IfFalse` or `IfTrue` param
42
- * @example
43
- * type n = CheckType<IsNumberLike<never>, never>;
44
- * type u = CheckType<IsNumberLike<undefined>, undefined>;
45
- *
46
- * type t = CheckType<IsNumberLike<'number'>, true>;
47
- * type f = CheckType<IsNumberLike<'object'>, false>;
48
- */
49
- type IsNumberLike<L extends Literal, IfTrue = true, IfFalse = false> = L extends undefined ? undefined : [Extract<L, keyof NumberLike>] extends [never] ? IfFalse : IfTrue;
50
- /**
51
- * @summary Map for string-like types.
52
- *
53
- * ⚠ Key is significant, value ignored
54
- */
55
- interface StringLike {
56
- string: 0;
57
- Buffer: 0;
58
- }
59
- /**
60
- * @summary If `L` is string-like returns `IfTrue` else `IfFalse`
61
- * @template L Tested literal
62
- * @template IfTrue Result, if `L` is string-like
63
- * @template IfFalse Result, if `L` NOT is string-like
64
- * @returns `IfFalse` or `IfTrue` param
65
- * @example
66
- * type n = CheckType<IsStringLike<never>, never>;
67
- * type u = CheckType<IsStringLike<undefined>, undefined>;
68
- *
69
- * type t = CheckType<IsStringLike<'string'>, true>;
70
- * type f = CheckType<IsStringLike<'object'>, false>;
71
- */
72
- type IsStringLike<L extends Literal, IfTrue = true, IfFalse = false> = L extends undefined ? undefined : [Extract<L, keyof StringLike>] extends [never] ? IfFalse : IfTrue;
73
- /**
74
- * @summary Literals array for available types for value
75
- */
76
- type List = Union.ToTuple<Literal>;
77
- namespace List {
78
- /**
79
- * @summary Literals array for available builtin types for value
80
- */
81
- type Builtins = Union.ToTuple<keyof Literal.Builtins>;
82
- /**
83
- * @summary Literals array for available builtin object key types for value
84
- */
85
- type CanBeObjKey = ['string', 'number', 'symbol'];
86
- /**
87
- * @summary Literals array for available builtin structural types for value
88
- */
89
- type Structural = ['object', 'function'];
90
- }
91
- /**
92
- * @summary Literals key-to-key record
93
- */
94
- type Key2KeyRec = Array._ToKey2Key<List>;
95
- }
96
- }
97
- namespace Code {
98
- namespace TS {
99
- /**
100
- * @summary Literals key-to-key record + utils
101
- */
102
- interface Literal extends AVStantso.TS.Literal.Key2KeyRec {
103
- /**
104
- * @summary Literals array for available builtin types for value
105
- */
106
- Builtins: readonly [...AVStantso.TS.Literal.List.Builtins];
107
- /**
108
- * @summary Literals array for available builtin object key types for value
109
- */
110
- CanBeObjKey: readonly [...AVStantso.TS.Literal.List.CanBeObjKey];
111
- /**
112
- * @summary Literals array for available builtin structural types for value
113
- */
114
- Structural: readonly [...AVStantso.TS.Literal.List.Structural];
115
- /**
116
- * @summary Literals array for available types for value
117
- */
118
- List: AVStantso.TS.Literal.List;
119
- /**
120
- * @summary Empty value for `Literal`
121
- * @param type Type literal
122
- * @returns Resolved literal empty value
123
- */
124
- Empty: {
125
- /**
126
- * @summary Empty value for `Literal`
127
- * @param type Type literal
128
- * @returns Resolved literal empty value
129
- */
130
- <L extends AVStantso.TS.Literal>(type: L): AVStantso.TS.Resolve<L>;
131
- } & {
132
- [K in AVStantso.TS.Literal]: AVStantso.TS.Resolve<K>;
133
- };
134
- /**
135
- * @summary Is `value` a resolved `type` of `L`
136
- * @param type Type literal
137
- * @param value Tested value
138
- */
139
- IsValue: {
140
- /**
141
- * @summary Is `value` a resolved `type` of `L`
142
- * @param type Type literal
143
- * @param value Tested value
144
- */
145
- <L extends AVStantso.TS.Literal>(type: L, value: unknown): value is AVStantso.TS.Resolve<L>;
146
- } & {
147
- [K in AVStantso.TS.Literal]: (value: unknown) => value is AVStantso.TS.Resolve<K>;
148
- };
149
- /**
150
- * @summary Registrate extended literal
151
- * @template L Literal type
152
- * @param literal Literal value
153
- * @example
154
- * type XYZ = {x: string; y: number; z: boolean; };
155
- *
156
- * namespace AVStantso.TS.Literal {
157
- * export interface Map {
158
- * xyz: XYZ;
159
- * }
160
- * }
161
- *
162
- * avstantso.TS.Literal._Register('xyz');
163
- *
164
- * ///////////////
165
- *
166
- * type t = CheckType<AVStantso.TS.Resolve<'xyz'>, XYZ>;
167
- *
168
- * console.log(avstantso.TS.Literal.List.includes('xyz')); // prints true
169
- */
170
- _Register<L extends AVStantso.TS.Literal>(literal: L, empty?: AVStantso.TS.Resolve<L>): void;
171
- }
172
- }
173
- interface TS {
174
- /**
175
- * @summary Literals key-to-key record + utils
176
- */
177
- Literal: TS.Literal;
178
- }
179
- }
180
- }
@@ -1,62 +0,0 @@
1
- declare namespace AVStantso.TS {
2
- /**
3
- * @summary Numeric types and "functions"
4
- */
5
- namespace Numeric {
6
- /**
7
- * @summary Domain of a functions of `Numeric` type
8
- */
9
- namespace Domain {
10
- /**
11
- * @summary Numeric literals `1-max(Domain.Positive)`.
12
- *
13
- * Used in `Numeric` type "functions"
14
- *
15
- * For full ASCII need `255`
16
- *
17
- */
18
- namespace Positive { }
19
- /**
20
- * @summary Numeric literals `-1-(-max(Domain.Negative))`.
21
- *
22
- * Used in `Numeric` type "functions"
23
- *
24
- */
25
- namespace Negative { }
26
- /**
27
- * @summary Summs `0—9 x 0—9` by table.
28
- *
29
- * Used in `Numeric.Summ` type "functions"
30
- */
31
- namespace Summs {
32
- /**
33
- * @summary Calc summ `0—9 x 0—9` by table.
34
- *
35
- * Used in `Numeric.Summ` type "functions"
36
- * @return `[<Current digit>, <Next digit coef>]`
37
- */
38
- type Calc<X extends number, Y extends number> = Summs[X][Y];
39
- }
40
- /**
41
- * @summary Diffs `0—9 x -1—9` table.
42
- *
43
- * Used in `Numeric.Summ` type "functions"
44
- */
45
- namespace Diffs {
46
- /**
47
- * @summary Calc summ `0—9 x -9—9` by table.
48
- *
49
- * Used in `Numeric.Diff` type "functions"
50
- * @return `[<Current digit>, <Next digit coef>]`
51
- */
52
- type Calc<X extends number, Y extends number> = Diffs[X][Increment<Y>];
53
- }
54
- /**
55
- * @summary Power map.
56
- *
57
- * Used in `Numeric.Power` type "functions"
58
- */
59
- namespace Power { }
60
- }
61
- }
62
- }