functype 0.8.47 → 0.8.49

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 (140) hide show
  1. package/dist/index.d.ts +302 -8
  2. package/dist/index.mjs +2 -1
  3. package/dist/index.mjs.map +1 -0
  4. package/package.json +17 -16
  5. package/dist/chunk-2I2NKDFN.mjs +0 -1
  6. package/dist/chunk-2ML63TYF.mjs +0 -0
  7. package/dist/chunk-2U34DUZU.js +0 -1
  8. package/dist/chunk-377WQNCB.mjs +0 -1
  9. package/dist/chunk-3VJERXBP.js +0 -1
  10. package/dist/chunk-44WWBXBL.js +0 -1
  11. package/dist/chunk-4H62YQ42.mjs +0 -0
  12. package/dist/chunk-5GE5W3Y5.mjs +0 -1
  13. package/dist/chunk-5VTXJIR3.js +0 -1
  14. package/dist/chunk-AKJ5AKY4.js +0 -1
  15. package/dist/chunk-E6RS47F7.js +0 -1
  16. package/dist/chunk-HA5XD5KC.mjs +0 -1
  17. package/dist/chunk-HD6YYUHO.mjs +0 -1
  18. package/dist/chunk-K3EKBPQE.js +0 -1
  19. package/dist/chunk-OXLZ6UIZ.js +0 -1
  20. package/dist/chunk-UAFRIAJN.js +0 -1
  21. package/dist/chunk-V2J3R5IU.mjs +0 -0
  22. package/dist/chunk-VK5GL6NM.mjs +0 -1
  23. package/dist/chunk-WTWWDZY6.js +0 -1
  24. package/dist/chunk-XORABVON.js +0 -1
  25. package/dist/chunk-YXECCMSX.mjs +0 -1
  26. package/dist/chunk-Z6YAH4SC.mjs +0 -1
  27. package/dist/collections/index.d.mts +0 -8
  28. package/dist/collections/index.d.ts +0 -8
  29. package/dist/collections/index.js +0 -1
  30. package/dist/collections/index.mjs +0 -0
  31. package/dist/core/base/Base.d.mts +0 -12
  32. package/dist/core/base/Base.d.ts +0 -12
  33. package/dist/core/base/Base.js +0 -1
  34. package/dist/core/base/Base.mjs +0 -1
  35. package/dist/core/error/Throwable.d.mts +0 -12
  36. package/dist/core/error/Throwable.d.ts +0 -12
  37. package/dist/core/error/Throwable.js +0 -1
  38. package/dist/core/error/Throwable.mjs +0 -1
  39. package/dist/core/task/Task.d.mts +0 -8
  40. package/dist/core/task/Task.d.ts +0 -8
  41. package/dist/core/task/Task.js +0 -1
  42. package/dist/core/task/Task.mjs +0 -1
  43. package/dist/either/Either.d.mts +0 -8
  44. package/dist/either/Either.d.ts +0 -8
  45. package/dist/either/Either.js +0 -1
  46. package/dist/either/Either.mjs +0 -1
  47. package/dist/error/ParseError.d.mts +0 -8
  48. package/dist/error/ParseError.d.ts +0 -8
  49. package/dist/error/ParseError.js +0 -1
  50. package/dist/error/ParseError.mjs +0 -1
  51. package/dist/functor/index.d.mts +0 -20
  52. package/dist/functor/index.d.ts +0 -20
  53. package/dist/functor/index.js +0 -1
  54. package/dist/functor/index.mjs +0 -1
  55. package/dist/identity/Identity.d.mts +0 -6
  56. package/dist/identity/Identity.d.ts +0 -6
  57. package/dist/identity/Identity.js +0 -1
  58. package/dist/identity/Identity.mjs +0 -1
  59. package/dist/index-BSGv2rsm.d.mts +0 -240
  60. package/dist/index-Cb-cundW.d.ts +0 -240
  61. package/dist/index.d.mts +0 -8
  62. package/dist/index.js +0 -1
  63. package/dist/iterable/index.d.mts +0 -8
  64. package/dist/iterable/index.d.ts +0 -8
  65. package/dist/iterable/index.js +0 -1
  66. package/dist/iterable/index.mjs +0 -1
  67. package/dist/list/List.d.mts +0 -8
  68. package/dist/list/List.d.ts +0 -8
  69. package/dist/list/List.js +0 -1
  70. package/dist/list/List.mjs +0 -1
  71. package/dist/map/Map.d.mts +0 -8
  72. package/dist/map/Map.d.ts +0 -8
  73. package/dist/map/Map.js +0 -1
  74. package/dist/map/Map.mjs +0 -1
  75. package/dist/map/shim.d.mts +0 -4
  76. package/dist/map/shim.d.ts +0 -4
  77. package/dist/map/shim.js +0 -1
  78. package/dist/map/shim.mjs +0 -1
  79. package/dist/option/Option.d.mts +0 -8
  80. package/dist/option/Option.d.ts +0 -8
  81. package/dist/option/Option.js +0 -1
  82. package/dist/option/Option.mjs +0 -1
  83. package/dist/serializable/Serializable.d.mts +0 -16
  84. package/dist/serializable/Serializable.d.ts +0 -16
  85. package/dist/serializable/Serializable.js +0 -3
  86. package/dist/serializable/Serializable.mjs +0 -3
  87. package/dist/set/Set.d.mts +0 -8
  88. package/dist/set/Set.d.ts +0 -8
  89. package/dist/set/Set.js +0 -1
  90. package/dist/set/Set.mjs +0 -1
  91. package/dist/set/shim.d.mts +0 -4
  92. package/dist/set/shim.d.ts +0 -4
  93. package/dist/set/shim.js +0 -1
  94. package/dist/set/shim.mjs +0 -1
  95. package/dist/try/Try.d.mts +0 -8
  96. package/dist/try/Try.d.ts +0 -8
  97. package/dist/try/Try.js +0 -1
  98. package/dist/try/Try.mjs +0 -1
  99. package/dist/tuple/Tuple.d.mts +0 -12
  100. package/dist/tuple/Tuple.d.ts +0 -12
  101. package/dist/tuple/Tuple.js +0 -1
  102. package/dist/tuple/Tuple.mjs +0 -1
  103. package/dist/typeable/Typeable.d.mts +0 -8
  104. package/dist/typeable/Typeable.d.ts +0 -8
  105. package/dist/typeable/Typeable.js +0 -1
  106. package/dist/typeable/Typeable.mjs +0 -1
  107. package/dist/util/index.d.mts +0 -13
  108. package/dist/util/index.d.ts +0 -13
  109. package/dist/util/index.js +0 -1
  110. package/dist/util/index.mjs +0 -1
  111. package/dist/util/isIterable.d.mts +0 -3
  112. package/dist/util/isIterable.d.ts +0 -3
  113. package/dist/util/isIterable.js +0 -1
  114. package/dist/util/isIterable.mjs +0 -1
  115. package/dist/valuable/Valuable.d.mts +0 -6
  116. package/dist/valuable/Valuable.d.ts +0 -6
  117. package/dist/valuable/Valuable.js +0 -1
  118. package/dist/valuable/Valuable.mjs +0 -1
  119. package/lib/TaskPromise.d.ts +0 -3
  120. package/lib/collections/index.d.ts +0 -8
  121. package/lib/either/Either.d.ts +0 -52
  122. package/lib/either/EitherT.d.ts +0 -9
  123. package/lib/error/ParseError.d.ts +0 -6
  124. package/lib/functor/index.d.ts +0 -15
  125. package/lib/identity/Identity.d.ts +0 -4
  126. package/lib/index.d.ts +0 -21
  127. package/lib/iterable/Seq.d.ts +0 -31
  128. package/lib/iterable/index.d.ts +0 -22
  129. package/lib/list/List.d.ts +0 -26
  130. package/lib/map/Map.d.ts +0 -17
  131. package/lib/map/shim.d.ts +0 -2
  132. package/lib/option/Option.d.ts +0 -30
  133. package/lib/serializable/Serializable.d.ts +0 -15
  134. package/lib/set/Set.d.ts +0 -15
  135. package/lib/set/shim.d.ts +0 -2
  136. package/lib/try/Try.d.ts +0 -18
  137. package/lib/tuple/Tuple.d.ts +0 -9
  138. package/lib/typeable/Typeable.d.ts +0 -4
  139. package/lib/util/index.d.ts +0 -3
  140. package/lib/util/isIterable.d.ts +0 -1
@@ -1,6 +0,0 @@
1
- declare function Valuable<T>(value: T): {
2
- value: T;
3
- };
4
- type Valuable<T> = ReturnType<typeof Valuable<T>>;
5
-
6
- export { Valuable };
@@ -1,6 +0,0 @@
1
- declare function Valuable<T>(value: T): {
2
- value: T;
3
- };
4
- type Valuable<T> = ReturnType<typeof Valuable<T>>;
5
-
6
- export { Valuable };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});function t(e){return{value:e}}exports.Valuable = t;
@@ -1 +0,0 @@
1
- function t(e){return{value:e}}export{t as Valuable};
@@ -1,3 +0,0 @@
1
- import { Type } from "../lib";
2
- import { Functor } from "./functor";
3
- export type TaskPromise<A extends Type> = Promise<A> & Functor<A>;
@@ -1,8 +0,0 @@
1
- import { List } from "../list/List";
2
- import { Set } from "../set/Set";
3
- export type Converters<A> = {
4
- toList(): List<A>;
5
- toSet(): Set<A>;
6
- toString(): string;
7
- };
8
- export type Collection<A> = Converters<A>;
@@ -1,52 +0,0 @@
1
- import { Functor, Type } from "../functor";
2
- import { List } from "../list/List";
3
- import { Option } from "../option/Option";
4
- import { Typeable } from "../typeable/Typeable";
5
- export type Either<L extends Type, R extends Type> = {
6
- readonly _tag: "Left" | "Right";
7
- value: L | R;
8
- isLeft: () => boolean;
9
- isRight: () => boolean;
10
- getOrElse: (defaultValue: R) => R;
11
- getOrThrow: () => R;
12
- map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
13
- merge: <L1 extends Type, R1 extends Type>(other: Either<L1, R1>) => Either<L | L1, [R, R1]>;
14
- mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
15
- flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
16
- flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
17
- toOption: () => Option<R>;
18
- toList: () => List<R>;
19
- toString: () => string;
20
- [Symbol.iterator]: () => Iterator<R>;
21
- yield: () => Generator<R, void, unknown>;
22
- traverse: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U[]>;
23
- lazyMap: <U extends Type>(f: (value: R) => U) => Generator<Either<L, U>, void, unknown>;
24
- tap: (f: (value: R) => void) => Either<L, R>;
25
- tapLeft: (f: (value: L) => void) => Either<L, R>;
26
- mapLeft: <L2 extends Type>(f: (value: L) => L2) => Either<L2, R>;
27
- bimap: <L2 extends Type, R2 extends Type>(fl: (value: L) => L2, fr: (value: R) => R2) => Either<L2, R2>;
28
- fold: <T extends Type>(onLeft: (value: L) => T, onRight: (value: R) => T) => T;
29
- swap: () => Either<R, L>;
30
- } & Typeable<"Left" | "Right"> & PromiseLike<R>;
31
- export type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R>;
32
- export declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
33
- export declare const Left: <L extends Type, R extends Type>(value: L) => Either<L, R>;
34
- export declare const isRight: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
35
- value: R;
36
- };
37
- export declare const isLeft: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
38
- value: L;
39
- };
40
- export declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
41
- export declare const TypeCheckRight: <L extends Type, R extends Type>(value: R) => TestEither<L, R>;
42
- export declare const TypeCheckLeft: <L extends Type, R extends Type>(value: L) => TestEither<L, R>;
43
- export declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
44
- export declare const tryCatchSync: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
45
- export declare const Either: {
46
- sequence: <L extends Type, R extends Type>(eithers: Either<L, R>[]) => Either<L, R[]>;
47
- traverse: <L extends Type, R extends Type, U extends Type>(arr: R[], f: (value: R) => Either<L, U>) => Either<L, U[]>;
48
- fromNullable: <L extends Type, R extends Type>(value: R | null | undefined, leftValue: L) => Either<L, R>;
49
- fromPredicate: <L extends Type, R extends Type>(value: R, predicate: (value: R) => boolean, leftValue: L) => Either<L, R>;
50
- ap: <L extends Type, R extends Type, U extends Type>(eitherF: Either<L, (value: R) => U>, eitherV: Either<L, R>) => Either<L, U>;
51
- fromPromise: <L, R>(promise: Promise<R>, onRejected: (reason: unknown) => L) => Promise<Either<L, R>>;
52
- };
@@ -1,9 +0,0 @@
1
- import { Either } from "./Either";
2
- export type EitherT<L, R> = {
3
- value: Promise<Either<L, R>>;
4
- map<U>(f: (value: R) => U): EitherT<L, U>;
5
- flatMap<U>(f: (value: R) => EitherT<L, U>): EitherT<L, U>;
6
- mapLeft<U>(f: (value: L) => U): EitherT<U, R>;
7
- fold<U>(onLeft: (error: L) => U, onRight: (value: R) => U): Promise<U>;
8
- };
9
- export declare function EitherT<L, R>(value: Promise<Either<L, R>>): EitherT<L, R>;
@@ -1,6 +0,0 @@
1
- export declare const ParseError: (message?: string) => Error & {
2
- name: "ParseError";
3
- };
4
- export type ParseError = Error & {
5
- name: "ParseError";
6
- };
@@ -1,15 +0,0 @@
1
- export type SingleType = unknown;
2
- export type ArrayType = SingleType[];
3
- export type Type = SingleType | ArrayType;
4
- export type AbstractFunctor<A extends Type> = {
5
- map(f: (value: A) => Type): AbstractFunctor<Type>;
6
- flatMap(f: (value: A) => AbstractFunctor<Type>): AbstractFunctor<Type>;
7
- };
8
- export type Functor<A extends Type> = AbstractFunctor<A> & {
9
- map<B extends Type>(f: (value: A) => B): Functor<B>;
10
- flatMap<B extends Type>(f: (value: A) => Functor<B>): Functor<B>;
11
- };
12
- export type ArrayFunctor<A extends ArrayType> = AbstractFunctor<A> & {
13
- map<U extends ArrayType>(f: (value: A) => U): ArrayFunctor<U>;
14
- flatMap<U extends ArrayType>(f: (value: A) => ArrayFunctor<U>): ArrayFunctor<U>;
15
- };
@@ -1,4 +0,0 @@
1
- export type Identity<T> = {
2
- id: T;
3
- isSame?: (other: Identity<T>) => boolean;
4
- };
package/lib/index.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import { Functor, Type } from "./functor";
2
- export type Traversable<A extends Type> = Functor<A> & {
3
- get size(): number;
4
- get isEmpty(): boolean;
5
- contains(value: A): boolean;
6
- reduce(f: (b: A, a: A) => A): A;
7
- reduceRight(f: (b: A, a: A) => A): A;
8
- foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
9
- foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
10
- };
11
- export * from "./either/Either";
12
- export * from "./functor";
13
- export * from "./identity/Identity";
14
- export * from "./iterable";
15
- export * from "./list/List";
16
- export * from "./map/Map";
17
- export * from "./option/Option";
18
- export * from "./set/Set";
19
- export * from "./try/Try";
20
- export * from "./tuple/Tuple";
21
- export * from "./typeable/Typeable";
@@ -1,31 +0,0 @@
1
- import { Option } from "../option/Option";
2
- import { Typeable } from "../typeable/Typeable";
3
- import { _Iterable_ } from "./index";
4
- export type Seq<A> = {
5
- readonly length: number;
6
- readonly [Symbol.iterator]: () => Iterator<A>;
7
- map: <B>(f: (a: A) => B) => Seq<B>;
8
- flatMap: <B>(f: (a: A) => _Iterable_<B>) => Seq<B>;
9
- forEach: (f: (a: A) => void) => void;
10
- count: (p: (x: A) => boolean) => number;
11
- exists: (p: (a: A) => boolean) => boolean;
12
- filter: (p: (a: A) => boolean) => Seq<A>;
13
- filterNot: (p: (a: A) => boolean) => Seq<A>;
14
- find: (p: (a: A) => boolean) => Option<A>;
15
- readonly head: A;
16
- readonly headOption: Option<A>;
17
- readonly isEmpty: boolean;
18
- readonly size: number;
19
- toArray: () => A[];
20
- reduce: (f: (prev: A, curr: A) => A) => A;
21
- reduceRight: (f: (prev: A, curr: A) => A) => A;
22
- foldLeft: <B>(z: B) => (op: (b: B, a: A) => B) => B;
23
- foldRight: <B>(z: B) => (op: (a: A, b: B) => B) => B;
24
- toString: () => string;
25
- toValue: () => {
26
- _tag: string;
27
- value: A[];
28
- };
29
- } & _Iterable_<A> & Typeable<"Seq">;
30
- export declare const createSeq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
31
- export declare const Seq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
@@ -1,22 +0,0 @@
1
- import { Functor, Type } from "../functor";
2
- import { Option } from "../option/Option";
3
- export type _Iterable_<A extends Type> = {
4
- count(p: (x: A) => boolean): number;
5
- find(p: (a: A) => boolean): Option<A>;
6
- forEach(f: (a: A) => void): void;
7
- exists(p: (a: A) => boolean): boolean;
8
- filter(p: (a: A) => boolean): _Iterable_<A>;
9
- filterNot(p: (a: A) => boolean): _Iterable_<A>;
10
- reduce(f: (b: A, a: A) => A): A;
11
- reduceRight(f: (b: A, a: A) => A): A;
12
- foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
13
- foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
14
- get head(): A;
15
- get headOption(): Option<A>;
16
- get isEmpty(): boolean;
17
- map<B extends Type>(f: (a: A) => B): _Iterable_<B>;
18
- flatMap<B extends Type>(f: (a: A) => _Iterable_<B> | Iterable<B>): _Iterable_<B>;
19
- get size(): number;
20
- toArray(): readonly A[];
21
- } & Functor<A>;
22
- export { Seq } from "./Seq";
@@ -1,26 +0,0 @@
1
- import { Collection } from "../collections";
2
- import { _Iterable_, Seq } from "../iterable";
3
- import { Option } from "../option/Option";
4
- import { Set } from "../set/Set";
5
- import { Typeable } from "../typeable/Typeable";
6
- export type List<A> = {
7
- add: (item: A) => List<A>;
8
- map: <B>(f: (a: A) => B) => List<B>;
9
- flatMap: <B>(f: (a: A) => _Iterable_<B>) => List<B>;
10
- remove: (value: A) => List<A>;
11
- contains: (value: A) => boolean;
12
- removeAt: (index: number) => List<A>;
13
- get: (index: number) => Option<A>;
14
- concat: (other: List<A>) => List<A>;
15
- toList: () => List<A>;
16
- toSet: () => Set<A>;
17
- toString: () => string;
18
- toValue: () => {
19
- _tag: string;
20
- value: A[];
21
- };
22
- } & Seq<A> & Typeable<"List">;
23
- type InternalList<A> = List<A> & ArrayLike<A> & _Iterable_<A> & Collection<A>;
24
- export declare const List: <A>(values?: Iterable<A> | _Iterable_<A>) => List<A>;
25
- export declare const TestList: <A>(values?: Iterable<A> | _Iterable_<A>) => InternalList<A>;
26
- export {};
package/lib/map/Map.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import { Collection } from "../collections";
2
- import { Traversable } from "../index";
3
- import { _Iterable_ } from "../iterable";
4
- import { Option } from "../option/Option";
5
- import { Tuple } from "../tuple/Tuple";
6
- type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
7
- export type Map<K, V> = {
8
- add(item: Tuple<[K, V]>): Map<K, V>;
9
- remove(value: K): Map<K, V>;
10
- map<U>(f: (value: V) => U): Map<K, U>;
11
- flatMap<K2, V2>(f: (entry: Tuple<[K, V]>) => _Iterable_<[K2, V2]>): Map<K2, V2>;
12
- get(key: K): Option<V>;
13
- getOrElse(key: K, defaultValue: V): V;
14
- orElse(key: K, alternative: Option<V>): Option<V>;
15
- } & SafeTraversable<K, V> & Collection<Tuple<[K, V]>>;
16
- export declare const Map: <K, V>(entries?: readonly (readonly [K, V])[] | IterableIterator<[K, V]> | null) => Map<K, V>;
17
- export {};
package/lib/map/shim.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export type IESMap<K, V> = Map<K, V>;
2
- export declare const ESMap: MapConstructor;
@@ -1,30 +0,0 @@
1
- import { Functor, Type } from "../functor";
2
- import { Either, List, Traversable } from "../index";
3
- import { Typeable } from "../typeable/Typeable";
4
- export type Option<T extends Type> = {
5
- readonly _tag: "Some" | "None";
6
- readonly value: T | undefined;
7
- isEmpty: boolean;
8
- get(): T;
9
- getOrElse(defaultValue: T): T;
10
- orElse(alternative: Option<T>): Option<T>;
11
- map<U extends Type>(f: (value: T) => U): Option<U>;
12
- filter(predicate: (value: T) => boolean): Option<T>;
13
- flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>;
14
- reduce<U>(f: (acc: U, value: T) => U): U;
15
- reduceRight<U>(f: (acc: U, value: T) => U): U;
16
- foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
17
- foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
18
- toList(): List<T>;
19
- contains(value: T): boolean;
20
- size: number;
21
- toEither<E>(left: E): Either<E, T>;
22
- toString(): string;
23
- toValue(): {
24
- _tag: "Some" | "None";
25
- value: T;
26
- };
27
- } & (Traversable<T> & Functor<T> & Typeable<"Some" | "None">);
28
- export declare const Some: <T extends Type>(value: T) => Option<T>;
29
- export declare const None: <T extends Type>() => Option<T>;
30
- export declare const Option: <T extends Type>(value: T | null | undefined) => Option<T>;
@@ -1,15 +0,0 @@
1
- export type SerializableTypes = "json" | "yaml";
2
- type SerializationMethods<T> = {
3
- json: {
4
- toJSON(): string;
5
- fromJSON(json: string): T;
6
- };
7
- yaml: {
8
- toYAML(): string;
9
- fromYAML(yaml: string): T;
10
- };
11
- };
12
- export type Serializable<STypes extends SerializableTypes[], T> = T & (STypes extends [] ? NonNullable<unknown> : STypes extends [infer First, ...infer Rest] ? First extends keyof SerializationMethods<T> ? SerializationMethods<T>[First] & Serializable<Rest extends SerializableTypes[] ? Rest : [], T> : never : never);
13
- export type SupportedSerializationTypes<T> = T extends Serializable<infer Types, never> ? Types : never;
14
- export declare function createSerializable<STypes extends SerializableTypes[], T>(obj: T, serializationMethods: Pick<SerializationMethods<T>, STypes[number]>): Serializable<STypes, T>;
15
- export {};
package/lib/set/Set.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { Collection } from "../collections";
2
- import { _Iterable_ } from "../iterable";
3
- import { List } from "../list/List";
4
- export type Set<A> = {
5
- add: (value: A) => Set<A>;
6
- remove: (value: A) => Set<A>;
7
- contains: (value: A) => boolean;
8
- has: (value: A) => boolean;
9
- map: <B>(f: (a: A) => B) => Set<B>;
10
- flatMap: <B>(f: (a: A) => _Iterable_<B>) => Set<B>;
11
- toList: () => List<A>;
12
- toSet: () => Set<A>;
13
- toString: () => string;
14
- } & _Iterable_<A> & Collection<A>;
15
- export declare const Set: <A>(iterable?: Iterable<A> | _Iterable_<A>) => Set<A>;
package/lib/set/shim.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export type IESSet<T> = Set<T>;
2
- export declare const ESSet: SetConstructor;
package/lib/try/Try.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { Either } from "../either/Either";
2
- import { Typeable } from "../typeable/Typeable";
3
- export type Try<T> = {
4
- readonly _tag: "Success" | "Failure";
5
- readonly value: T | undefined;
6
- readonly error: Error | undefined;
7
- isSuccess: () => boolean;
8
- isFailure: () => boolean;
9
- get: () => T;
10
- getOrElse: (defaultValue: T) => T;
11
- orElse: (alternative: Try<T>) => Try<T>;
12
- orThrow: (error: Error) => T;
13
- toEither: () => Either<Error, T>;
14
- map: <U>(f: (value: T) => U) => Try<U>;
15
- flatMap: <U>(f: (value: T) => Try<U>) => Try<U>;
16
- toString: () => string;
17
- } & Typeable<"Success" | "Failure">;
18
- export declare const Try: <T>(f: () => T) => Try<T>;
@@ -1,9 +0,0 @@
1
- import { ArrayFunctor, ArrayType } from "../functor";
2
- export type Tuple<T extends ArrayType> = {
3
- get<K extends number>(index: K): T[K];
4
- map<U extends ArrayType>(f: (value: T) => U): Tuple<U>;
5
- flatMap<U extends ArrayType>(f: (value: T) => Tuple<U>): Tuple<U>;
6
- toArray(): T;
7
- [Symbol.iterator](): Iterator<T[number]>;
8
- } & ArrayFunctor<T>;
9
- export declare const Tuple: <T extends ArrayType>(values: T) => Tuple<T>;
@@ -1,4 +0,0 @@
1
- export declare function Typeable(type: string): {
2
- readonly _tag: string;
3
- };
4
- export type Typeable<T extends string> = ReturnType<typeof Typeable>;
@@ -1,3 +0,0 @@
1
- import { Either } from "../either/Either";
2
- import { ParseError } from "../error/ParseError";
3
- export declare const parseNumber: (input: string) => Either<ParseError, number>;
@@ -1 +0,0 @@
1
- export declare const isIterable: <T>(value: unknown) => value is Iterable<T>;