import { NonNull, Optional } from './standard-types' import { Numeric } from './general-types' // ------------------------------------------------------------------------------------------------- /** * HandlerFunction * @desc Type representing handler function type in TypeScript */ export type HandlerFunction = (options: T, next: (options: T) => T) => T | Promise // ------------------------------------------------------------------------------------------------- /** * Callback * @desc Type representing callback function type in TypeScript * @example * type Callback = () => console.log("test") */ export type Callback = (...args: any[]) => void /** * GenericCallback * @desc Type representing generic callback function type in TypeScript * @example * type GenericCallback = () => console.log("test") */ export type GenericCallback = (...args: T[]) => void /** * GenericValueCallback * @desc Type representing generic value callback function type in TypeScript * @example * type GenericValueCallback = () => console.log("test") */ export type GenericValueCallback = (...args: T[]) => U /** * OptionalValueCallback * @desc Type representing optional value callback function type in TypeScript * @example * type OptionalValueCallback = () => console.log("test") */ export type OptionalValueCallback = (...args: T[]) => Optional /** * PartialValueCallback * @desc Type representing partial value callback function type in TypeScript * @example * type PartialValueCallback = () => console.log("test") */ export type PartialValueCallback = (...args: T[]) => Partial /** * RequiredValueCallback * @desc Type representing required value callback function type in TypeScript * @example * type RequiredValueCallback = () => console.log("test") */ export type RequiredValueCallback = (...args: T[]) => Required /** * NonNullValueCallback * @desc Type representing non-nullable value callback function type in TypeScript * @example * type NonNullValueCallback = () => console.log("test") */ export type NonNullValueCallback = (...args: T[]) => NonNull // ------------------------------------------------------------------------------------------------- /** * IteratorStep * @desc Type representing iterator step type in TypeScript * @example * type IteratorStep = { value: T, done: true } */ export type IteratorStep = { value: Optional; done: boolean } /** * Iterator * @desc Type representing iterator type in TypeScript * @example * type Iterator = { next: () => console.log("test") } */ export type Iterator = { next: Supplier> } /** * OptionalIterator * @desc Type representing optional iterator type in TypeScript * @example * type OptionalIterator = { next: () => console.log("test") } */ export type OptionalIterator = Iterator> /** * PartialIterator * @desc Type representing partial iterator type in TypeScript * @example * type PartialIterator = { next: () => console.log("test") } */ export type PartialIterator = Iterator> /** * RequiredIterator * @desc Type representing required iterator type in TypeScript * @example * type RequiredIterator = { next: () => console.log("test") } */ export type RequiredIterator = Iterator> /** * NonNullIterator` * @desc Type representing non-nullable iterator type in TypeScript * @example * type NonNullIterator = { next: () => console.log("test") } */ export type NonNullIterator = Iterator> /** * IteratorYieldResult * @desc Type representing iterator yield result */ export interface IteratorYieldResult { done?: false value: T } /** * IteratorReturnResult * @desc Type representing iterator return result */ interface IteratorReturnResult { done: true value: R } /** * IteratorResult * @desc Type representing iterator result */ type IteratorResult = IteratorYieldResult | IteratorReturnResult /** * ItemIterator * @desc Type representing item iterator */ export interface ItemIterator { next(...args: [] | [TNext]): IteratorResult return?(value?: TReturn): IteratorResult throw?(e?: any): IteratorResult } /** * Iterable * @desc Type representing iterable */ export interface Iterable { [Symbol.iterator](): ItemIterator } /** * Iterable * @desc Type representing iterable iterator */ export interface IterableIterator extends ItemIterator { [Symbol.iterator](): IterableIterator } // ------------------------------------------------------------------------------------------------- /** * Executor * @desc Type representing executor function type in TypeScript * @example * type Executor = () => console.log("test") */ export type Executor = () => void // ------------------------------------------------------------------------------------------------- /** * Predicate * @desc Type representing predicate function type in TypeScript * @example * type Predicate = (v) => return 1 === v */ export type Predicate = (v: T) => boolean /** * OptionalPredicate * @desc Type representing optional predicate function type in TypeScript * @example * type OptionalPredicate = (v) => return 1 === v */ export type OptionalPredicate = Predicate> /** * PartialPredicate * @desc Type representing partial predicate function type in TypeScript * @example * type PartialPredicate = (v) => return 1 === v */ export type PartialPredicate = Predicate> /** * RequiredPredicate * @desc Type representing required predicate function type in TypeScript * @example * type RequiredPredicate = (v) => return 1 === v */ export type RequiredPredicate = Predicate> /** * NonNullPredicate * @desc Type representing non-nullable predicate function type in TypeScript * @example * type NonNullPredicate = (v) => return 1 === v */ export type NonNullPredicate = Predicate> /** * NumberPredicate * @desc Type representing number predicate function type in TypeScript * @example * type NumberPredicate = (v) => return 1 === v */ export type NumberPredicate = Predicate /** * StringPredicate * @desc Type representing string predicate function type in TypeScript * @example * type StringPredicate = (v) => return "1" === v */ export type StringPredicate = Predicate /** * PropertyKeyPredicate * @desc Type representing property key predicate function type in TypeScript * @example * type PropertyKeyPredicate = (v) => return "1" === v */ export type PropertyKeyPredicate = Predicate /** * BooleanPredicate * @desc Type representing boolean predicate function type in TypeScript * @example * type BooleanPredicate = (v) => return true === v */ export type BooleanPredicate = Predicate // ------------------------------------------------------------------------------------------------- /** * BiPredicate * @desc Type representing binary predicate function type in TypeScript * @example * type BiPredicate = (v1, v2) => return v1 === v2 */ export type BiPredicate = (v1: T, v2: V) => boolean /** * OptionalBiPredicate * @desc Type representing optional binary predicate function type in TypeScript * @example * type OptionalBiPredicate = (v1, v2) => return v1 === v2 */ export type OptionalBiPredicate = BiPredicate, Optional> /** * PartialBiPredicate * @desc Type representing partial binary predicate function type in TypeScript * @example * type PartialBiPredicate = (v1, v2) => return v1 === v2 */ export type PartialBiPredicate = BiPredicate, Partial> /** * RequiredBiPredicate * @desc Type representing required binary predicate function type in TypeScript * @example * type RequiredBiPredicate = (v1, v2) => return v1 === v2 */ export type RequiredBiPredicate = BiPredicate, Required> /** * NonNullBiPredicate * @desc Type representing non-nullable binary predicate function type in TypeScript * @example * type NonNullBiPredicate = (v1, v2) => return v1 === v2 */ export type NonNullBiPredicate = BiPredicate, NonNull> /** * NumberBiPredicate * @desc Type representing number binary predicate function type in TypeScript * @example * type NumberBiPredicate = (v1, v2) => return v1 === v2 */ export type NumberBiPredicate = BiPredicate /** * StringBiPredicate * @desc Type representing string binary predicate function type in TypeScript * @example * type StringBiPredicate = (v1, v2) => return v1 === v2 */ export type StringBiPredicate = BiPredicate /** * PropertyKeyBiPredicate * @desc Type representing property key binary predicate function type in TypeScript * @example * type PropertyKeyBiPredicate = (v1, v2) => return v1 === v2 */ export type PropertyKeyBiPredicate = BiPredicate /** * BooleanBiPredicate * @desc Type representing boolean binary predicate function type in TypeScript * @example * type BooleanBiPredicate = (v1, v2) => return v1 === v2 */ export type BooleanBiPredicate = BiPredicate // ------------------------------------------------------------------------------------------------- /** * TriPredicate * @desc Type representing ternary predicate function type in TypeScript * @example * type TriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type TriPredicate = (v1: T, v2: V, v3: S) => boolean /** * OptionalTriPredicate * @desc Type representing optional ternary predicate function type in TypeScript * @example * type OptionalTriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type OptionalTriPredicate = TriPredicate, Optional, Optional> /** * PartialTriPredicate * @desc Type representing partial ternary predicate function type in TypeScript * @example * type PartialTriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type PartialTriPredicate = TriPredicate, Partial, Partial> /** * RequiredTriPredicate * @desc Type representing required ternary predicate function type in TypeScript * @example * type RequiredTriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type RequiredTriPredicate = TriPredicate, Required, Required> /** * NonNullTriPredicate * @desc Type representing non-nullable ternary predicate function type in TypeScript * @example * type NonNullTriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type NonNullTriPredicate = TriPredicate, NonNull, NonNull> /** * NumberTriPredicate * @desc Type representing number ternary predicate function type in TypeScript * @example * type NumberTriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type NumberTriPredicate = TriPredicate /** * StringTriPredicate * @desc Type representing string ternary predicate function type in TypeScript * @example * type StringTriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type StringTriPredicate = TriPredicate /** * PropertyKeyTriPredicate * @desc Type representing property key ternary predicate function type in TypeScript * @example * type PropertyKeyTriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type PropertyKeyTriPredicate = TriPredicate /** * BooleanTriPredicate * @desc Type representing boolean ternary predicate function type in TypeScript * @example * type BooleanTriPredicate = (v1, v2, v3) => return v1 === v2 === v3 */ export type BooleanTriPredicate = TriPredicate // ------------------------------------------------------------------------------------------------- /** * Supplier * @desc Type representing supplier function type in TypeScript * @example * type Supplier = () => return 1 */ export type Supplier = () => T /** * OptionalSupplier * @desc Type representing optional supplier function type in TypeScript * @example * type OptionalSupplier = () => return 1 */ export type OptionalSupplier = Supplier> /** * PartialSupplier * @desc Type representing partial supplier function type in TypeScript * @example * type PartialSupplier = () => return 1 */ export type PartialSupplier = Supplier> /** * RequiredSupplier * @desc Type representing required supplier function type in TypeScript * @example * type RequiredSupplier = () => return 1 */ export type RequiredSupplier = Supplier> /** * NonNullSupplier * @desc Type representing non-nullable supplier function type in TypeScript * @example * type NonNullSupplier = () => return 1 */ export type NonNullSupplier = Supplier> /** * NumberSupplier * @desc Type representing number supplier function type in TypeScript * @example * type NumberSupplier = () => return 1 */ export type NumberSupplier = Supplier /** * BooleanSupplier * @desc Type representing boolean supplier function type in TypeScript * @example * type BooleanSupplier = () => return true */ export type BooleanSupplier = Supplier /** * StringSupplier * @desc Type representing string supplier function type in TypeScript * @example * type StringSupplier = () => return "1" */ export type StringSupplier = Supplier /** * PropertyKeySupplier * @desc Type representing property key supplier function type in TypeScript * @example * type PropertyKeySupplier = () => return "1" */ export type PropertyKeySupplier = Supplier // ------------------------------------------------------------------------------------------------- /** * BiSupplier * @desc Type representing binary supplier function type in TypeScript * @example * type BiSupplier = () => return {"v1": "first", "v2": "second"} */ export type BiSupplier = () => { v1: T; v2: V } /** * OptionalBiSupplier * @desc Type representing optional binary supplier function type in TypeScript * @example * type OptionalBiSupplier = () => return {"v1": "first", "v2": "second"} */ export type OptionalBiSupplier = BiSupplier, Optional> /** * PartialBiSupplier * @desc Type representing partial binary supplier function type in TypeScript * @example * type PartialBiSupplier = () => return {"v1": "first", "v2": "second"} */ export type PartialBiSupplier = BiSupplier, Partial> /** * RequiredBiSupplier * @desc Type representing required binary supplier function type in TypeScript * @example * type RequiredBiSupplier = () => return {"v1": "first", "v2": "second"} */ export type RequiredBiSupplier = BiSupplier, Required> /** * NonNullBiSupplier * @desc Type representing non-nullable binary supplier function type in TypeScript * @example * type NonNullBiSupplier = () => return {"v1": "first", "v2": "second"} */ export type NonNullBiSupplier = BiSupplier, NonNull> /** * NumberBiSupplier * @desc Type representing number binary supplier function type in TypeScript * @example * type NumberBiSupplier = () => return {"v1": "first", "v2": "second"} */ export type NumberBiSupplier = BiSupplier /** * StringBiSupplier * @desc Type representing string binary supplier function type in TypeScript * @example * type StringBiSupplier = () => return {"v1": "first", "v2": "second"} */ export type StringBiSupplier = BiSupplier /** * PropertyKeyBiSupplier * @desc Type representing property key binary supplier function type in TypeScript * @example * type PropertyKeyBiSupplier = () => return {"v1": "first", "v2": "second"} */ export type PropertyKeyBiSupplier = BiSupplier /** * BooleanBiSupplier * @desc Type representing boolean binary supplier function type in TypeScript * @example * type BooleanBiSupplier = () => return {"v1": true, "v2": false} */ export type BooleanBiSupplier = BiSupplier // ------------------------------------------------------------------------------------------------- /** * TriSupplier * @desc Type representing ternary supplier function type in TypeScript * @example * type TriSupplier = () => return {"v1": "first", "v2": "second", "v3": "third"} */ export type TriSupplier = () => { v1: T; v2: V; v3: S } /** * OptionalTriSupplier * @desc Type representing optional ternary supplier function type in TypeScript * @example * type OptionalTriSupplier = () => return {"v1": "first", "v2": "second", "v3": "third"} */ export type OptionalTriSupplier = TriSupplier, Optional, Optional> /** * PartialTriSupplier * @desc Type representing partial ternary supplier function type in TypeScript * @example * type PartialTriSupplier = () => return {"v1": "first", "v2": "second", "v3": "third"} */ export type PartialTriSupplier = TriSupplier, Partial, Partial> /** * RequiredTriSupplier * @desc Type representing required ternary supplier function type in TypeScript * @example * type RequiredTriSupplier = () => return {"v1": "first", "v2": "second", "v3": "third"} */ export type RequiredTriSupplier = TriSupplier, Required, Required> /** * NonNullTriSupplier * @desc Type representing non-nullable ternary supplier function type in TypeScript * @example * type NonNullTriSupplier = () => return {"v1": "first", "v2": "second", "v3": "third"} */ export type NonNullTriSupplier = TriSupplier, NonNull, NonNull> /** * NumberTriSupplier * @desc Type representing number ternary supplier function type in TypeScript * @example * type NumberTriSupplier = () => return {"v1": "first", "v2": "second", "v3": "third"} */ export type NumberTriSupplier = TriSupplier /** * StringTriSupplier * @desc Type representing string ternary supplier function type in TypeScript * @example * type StringTriSupplier = () => return {"v1": "first", "v2": "second", "v3": "third"} */ export type StringTriSupplier = TriSupplier /** * PropertyKeyTriSupplier * @desc Type representing property key ternary supplier function type in TypeScript * @example * type PropertyKeyTriSupplier = () => return {"v1": "first", "v2": "second", "v3": "third"} */ export type PropertyKeyTriSupplier = TriSupplier /** * BooleanTriSupplier * @desc Type representing boolean ternary supplier function type in TypeScript * @example * type BooleanTriSupplier = () => return {"v1": true, "v2": false, "v3": true} */ export type BooleanTriSupplier = TriSupplier // ------------------------------------------------------------------------------------------------- /** * Consumer * @desc Type representing consumer function type in TypeScript * @example * type Consumer = (v) => console.log(v) */ export type Consumer = (v: T) => void /** * OptionalConsumer * @desc Type representing optional consumer function type in TypeScript * @example * type OptionalConsumer = (v) => console.log(v) */ export type OptionalConsumer = Consumer> /** * PartialConsumer * @desc Type representing partial consumer function type in TypeScript * @example * type PartialConsumer = (v) => console.log(v) */ export type PartialConsumer = Consumer> /** * RequiredConsumer * @desc Type representing required consumer function type in TypeScript * @example * type RequiredConsumer = (v) => console.log(v) */ export type RequiredConsumer = Consumer> /** * NonNullConsumer * @desc Type representing non-nullable consumer function type in TypeScript * @example * type NonNullConsumer = (v) => console.log(v) */ export type NonNullConsumer = Consumer> /** * NumberConsumer * @desc Type representing number consumer function type in TypeScript * @example * type NumberConsumer = (v) => console.log(v) */ export type NumberConsumer = Consumer /** * StringConsumer * @desc Type representing string consumer function type in TypeScript * @example * type StringConsumer = (v) => console.log(v) */ export type StringConsumer = Consumer /** * PropertyKeyConsumer * @desc Type representing property key consumer function type in TypeScript * @example * type PropertyKeyConsumer = (v) => console.log(v) */ export type PropertyKeyConsumer = Consumer /** * BooleanConsumer * @desc Type representing boolean consumer function type in TypeScript * @example * type BooleanConsumer = (v) => console.log(v) */ export type BooleanConsumer = Consumer // ------------------------------------------------------------------------------------------------- /** * BiConsumer * @desc Type representing binary consumer function type in TypeScript * @example * type BiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type BiConsumer = (v1: T, v2: V) => void /** * OptionalBiConsumer * @desc Type representing optional binary consumer function type in TypeScript * @example * type OptionalBiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type OptionalBiConsumer = BiConsumer, Optional> /** * PartialBiConsumer * @desc Type representing partial binary consumer function type in TypeScript * @example * type PartialBiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type PartialBiConsumer = BiConsumer, Partial> /** * RequiredBiConsumer * @desc Type representing required binary consumer function type in TypeScript * @example * type RequiredBiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type RequiredBiConsumer = BiConsumer, Required> /** * NonNullBiConsumer * @desc Type representing non-nullable binary consumer function type in TypeScript * @example * type NonNullBiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type NonNullBiConsumer = BiConsumer, NonNull> /** * NumberBiConsumer * @desc Type representing number binary consumer function type in TypeScript * @example * type NumberBiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type NumberBiConsumer = BiConsumer /** * StringBiConsumer * @desc Type representing string binary consumer function type in TypeScript * @example * type StringBiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type StringBiConsumer = BiConsumer /** * PropertyKeyBiConsumer * @desc Type representing property key binary consumer function type in TypeScript * @example * type PropertyKeyBiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type PropertyKeyBiConsumer = BiConsumer /** * BooleanBiConsumer * @desc Type representing boolean binary consumer function type in TypeScript * @example * type BooleanBiConsumer = (v1, v2) => console.log(v1 + ":" + v2) */ export type BooleanBiConsumer = BiConsumer // ------------------------------------------------------------------------------------------------- /** * TriConsumer * @desc Type representing ternary consumer function type in TypeScript * @example * type TriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type TriConsumer = (v1: T, v2: V, v3: S) => void /** * OptionalTriConsumer * @desc Type representing optional ternary consumer function type in TypeScript * @example * type OptionalTriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type OptionalTriConsumer = TriConsumer, Optional, Optional> /** * PartialTriConsumer * @desc Type representing partial ternary consumer function type in TypeScript * @example * type PartialTriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type PartialTriConsumer = TriConsumer, Partial, Partial> /** * RequiredTriConsumer * @desc Type representing required ternary consumer function type in TypeScript * @example * type RequiredTriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type RequiredTriConsumer = TriConsumer, Required, Required> /** * NonNullTriConsumer * @desc Type representing optional ternary consumer function type in TypeScript * @example * type NonNullTriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type NonNullTriConsumer = TriConsumer, NonNull, NonNull> /** * NumberTriConsumer * @desc Type representing number ternary consumer function type in TypeScript * @example * type NumberTriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type NumberTriConsumer = TriConsumer /** * StringTriConsumer * @desc Type representing string ternary consumer function type in TypeScript * @example * type StringTriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type StringTriConsumer = TriConsumer /** * PropertyKeyTriConsumer * @desc Type representing property key ternary consumer function type in TypeScript * @example * type PropertyKeyTriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type PropertyKeyTriConsumer = TriConsumer /** * BooleanTriConsumer * @desc Type representing boolean ternary consumer function type in TypeScript * @example * type BooleanTriConsumer = (v1, v2, v3) => console.log(v1 + ":" + v2 + ":" + v3) */ export type BooleanTriConsumer = TriConsumer // ------------------------------------------------------------------------------------------------- /** * Processor * @desc Type representing processor function type in TypeScript * @example * type Processor = (v) => return new String(v) */ export type Processor = (v: T) => V /** * ReverseProcessor * @desc Type representing reversed processor function type in TypeScript * @example * type ReverseProcessor = (v) => return new String(v) */ export type ReverseProcessor = Processor /** * OptionalProcessor * @desc Type representing optional processor function type in TypeScript * @example * type OptionalProcessor = (v) => return new String(v) */ export type OptionalProcessor = Processor, R> /** * PartialProcessor * @desc Type representing partial processor function type in TypeScript * @example * type PartialProcessor = (v) => return new String(v) */ export type PartialProcessor = Processor, R> /** * RequiredProcessor * @desc Type representing required processor function type in TypeScript * @example * type RequiredProcessor = (v) => return new String(v) */ export type RequiredProcessor = Processor, R> /** * NonNullProcessor * @desc Type representing non-nullable processor function type in TypeScript * @example * type NonNullProcessor = (v) => return new String(v) */ export type NonNullProcessor = Processor, R> /** * NumberProcessor * @desc Type representing number processor function type in TypeScript * @example * type NumberProcessor = (v) => return new String(v) */ export type NumberProcessor = Processor /** * StringProcessor * @desc Type representing string processor function type in TypeScript * @example * type StringProcessor = (v) => return new String(v) */ export type StringProcessor = Processor /** * PropertyKeyProcessor * @desc Type representing property key processor function type in TypeScript * @example * type PropertyKeyProcessor = (v) => return new String(v) */ export type PropertyKeyProcessor = Processor /** * BooleanProcessor * @desc Type representing boolean processor function type in TypeScript * @example * type BooleanProcessor = (v) => return v ? "1" : "2" */ export type BooleanProcessor = Processor /** * NumberToStringProcessor * @desc Type representing number to string processor function type in TypeScript * @example * type NumberToStringProcessor = (v) => return new String(v) */ export type NumberToStringProcessor = Processor /** * StringToNumberProcessor * @desc Type representing string to number processor function type in TypeScript * @example * type StringToNumberProcessor = (v) => return parseInt(v) */ export type StringToNumberProcessor = Processor /** * PropertyKeyToNumberProcessor * @desc Type representing property key to number processor function type in TypeScript * @example * type PropertyKeyToNumberProcessor = (v) => return parseInt(v) */ export type PropertyKeyToNumberProcessor = Processor /** * BooleanToStringProcessor * @desc Type representing boolean to string processor function type in TypeScript * @example * type BooleanToStringProcessor = (v) => return new String(v) */ export type BooleanToStringProcessor = Processor /** * StringToBooleanProcessor * @desc Type representing string to boolean processor function type in TypeScript * @example * type StringToBooleanProcessor = (v) => return v == true */ export type StringToBooleanProcessor = Processor /** * PropertyKeyToBooleanProcessor * @desc Type representing string to boolean processor function type in TypeScript * @example * type PropertyKeyToBooleanProcessor = (v) => return v == true */ export type PropertyKeyToBooleanProcessor = Processor // ------------------------------------------------------------------------------------------------- /** * ToOptionalProcessor * @desc Type representing processor function type with optional result in TypeScript * @example * type ToOptionalProcessor = (v) => return v.length */ export type ToOptionalProcessor = Processor> /** * ToPartialProcessor * @desc Type representing processor function type with partial result in TypeScript * @example * type ToPartialProcessor = (v) => return v.length */ export type ToPartialProcessor = Processor> /** * ToRequiredProcessor * @desc Type representing processor function type with required result in TypeScript * @example * type ToRequiredProcessor = (v) => return v.length */ export type ToRequiredProcessor = Processor> /** * ToNonNullProcessor * @desc Type representing processor function type with non-nullable result in TypeScript * @example * type ToNonNullProcessor = (v) => return v.length */ export type ToNonNullProcessor = Processor> /** * ToNumberProcessor * @desc Type representing processor function type with number result in TypeScript * @example * type ToNumberProcessor = (v) => return v.length */ export type ToNumberProcessor = Processor /** * ToStringProcessor * @desc Type representing processor function type with string result in TypeScript * @example * type ToStringProcessor = (v) => return new String(v) */ export type ToStringProcessor = Processor /** * ToPropertyKeyProcessor * @desc Type representing processor function type with string result in TypeScript * @example * type ToPropertyKeyProcessor = (v) => return new String(v) */ export type ToPropertyKeyProcessor = Processor /** * ToBooleanProcessor * @desc Type representing processor function type with boolean result in TypeScript * @example * type ToBooleanProcessor = (v) => return v1 === true */ export type ToBooleanProcessor = Processor // ------------------------------------------------------------------------------------------------- /** * BiProcessor * @desc Type representing binary processor function type in TypeScript * @example * type Processor = (v1, v2) => return new String(v1 + v2) */ export type BiProcessor = (v1: T, v2: V) => R /** * OptionalBiProcessor * @desc Type representing optional binary processor function type in TypeScript * @example * type OptionalBiProcessor = (v1, v2) => return v1 + v2 */ export type OptionalBiProcessor = BiProcessor, Optional, R> /** * PartialBiProcessor * @desc Type representing partial binary processor function type in TypeScript * @example * type PartialBiProcessor = (v1, v2) => return v1 + v2 */ export type PartialBiProcessor = BiProcessor, Partial, R> /** * RequiredBiProcessor * @desc Type representing required binary processor function type in TypeScript * @example * type RequiredBiProcessor = (v1, v2) => return v1 + v2 */ export type RequiredBiProcessor = BiProcessor, Required, R> /** * NonNullBiProcessor * @desc Type representing non-nullable binary processor function type in TypeScript * @example * type NonNullBiProcessor = (v1, v2) => return v1 + v2 */ export type NonNullBiProcessor = BiProcessor, NonNull, R> /** * NumberBiProcessor * @desc Type representing number binary processor function type in TypeScript * @example * type NumberBiProcessor = (v1, v2) => return v1 + v2 */ export type NumberBiProcessor = BiProcessor /** * StringBiProcessor * @desc Type representing string binary processor function type in TypeScript * @example * type StringBiProcessor = (v1, v2) => return v1 + v2 */ export type StringBiProcessor = BiProcessor /** * PropertyKeyBiProcessor * @desc Type representing property key binary processor function type in TypeScript * @example * type PropertyKeyBiProcessor = (v1, v2) => return v1 + v2 */ export type PropertyKeyBiProcessor = BiProcessor /** * BooleanBiProcessor * @desc Type representing boolean binary processor function type in TypeScript * @example * type BooleanBiProcessor = (v1, v2) => return v1 + v2 */ export type BooleanBiProcessor = BiProcessor // ------------------------------------------------------------------------------------------------- /** * ToOptionalBiProcessor * @desc Type representing binary processor function type with optional result in TypeScript * @example * type ToOptionalBiProcessor = (v1, v2) => return v1.length + v2.length */ export type ToOptionalBiProcessor = BiProcessor> /** * ToPartialBiProcessor * @desc Type representing binary processor function type with partial result in TypeScript * @example * type ToPartialBiProcessor = (v1, v2) => return v1.length + v2.length */ export type ToPartialBiProcessor = BiProcessor> /** * ToRequiredBiProcessor * @desc Type representing binary processor function type with required result in TypeScript * @example * type ToRequiredBiProcessor = (v1, v2) => return v1.length + v2.length */ export type ToRequiredBiProcessor = BiProcessor> /** * ToNonNullBiProcessor * @desc Type representing binary processor function type with non-nullable result in TypeScript * @example * type ToNonNullBiProcessor = (v1, v2) => return v1.length + v2.length */ export type ToNonNullBiProcessor = BiProcessor> /** * ToNumberBiProcessor * @desc Type representing binary processor function type with number result in TypeScript * @example * type ToNumberBiProcessor = (v1, v2) => return v1.length + v2.length */ export type ToNumberBiProcessor = BiProcessor /** * ToStringBiProcessor * @desc Type representing binary processor function type with string result in TypeScript * @example * type ToStringBiProcessor = (v1, v2) => return new String(v1 + v2) */ export type ToStringBiProcessor = BiProcessor /** * ToPropertyKeyBiProcessor * @desc Type representing binary processor function type with property key result in TypeScript * @example * type ToPropertyKeyBiProcessor = (v1, v2) => return new String(v1 + v2) */ export type ToPropertyKeyBiProcessor = BiProcessor /** * ToBooleanBiProcessor * @desc Type representing binary processor function type with boolean result in TypeScript * @example * type ToBooleanBiProcessor = (v1, v2) => return v1 === v2 */ export type ToBooleanBiProcessor = BiProcessor // ------------------------------------------------------------------------------------------------- /** * TriProcessor * @desc Type representing ternary processor function type in TypeScript * @example * type TriProcessor = (v1, v2, v3) => return new String(v1 + v2 + v3) */ export type TriProcessor = (v1: T, v2: V, v3: S) => R /** * OptionalTriProcessor * @desc Type representing optional ternary processor function type in TypeScript * @example * type OptionalTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type OptionalTriProcessor = TriProcessor, Optional, Optional, R> /** * PartialTriProcessor * @desc Type representing partial ternary processor function type in TypeScript * @example * type PartialTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type PartialTriProcessor = TriProcessor, Partial, Partial, R> /** * RequiredTriProcessor * @desc Type representing required ternary processor function type in TypeScript * @example * type RequiredTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type RequiredTriProcessor = TriProcessor, Required, Required, R> /** * NonNullTriProcessor * @desc Type representing non-nullable ternary processor function type in TypeScript * @example * type NonNullTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type NonNullTriProcessor = TriProcessor, NonNull, NonNull, R> /** * NumberTriProcessor * @desc Type representing number ternary processor function type in TypeScript * @example * type NumberTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type NumberTriProcessor = TriProcessor /** * StringTriProcessor * @desc Type representing string ternary processor function type in TypeScript * @example * type StringTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type StringTriProcessor = TriProcessor /** * PropertyKeyTriProcessor * @desc Type representing property key ternary processor function type in TypeScript * @example * type PropertyKeyTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type PropertyKeyTriProcessor = TriProcessor /** * BooleanTriProcessor * @desc Type representing boolean ternary processor function type in TypeScript * @example * type BooleanTriProcessor = (v1, v2, v3) => return v1 & v2 & v3 */ export type BooleanTriProcessor = TriProcessor /** * ToOptionalTriProcessor * @desc Type representing ternary processor function type with optional result in TypeScript * @example * type ToOptionalTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type ToOptionalTriProcessor = (v1: T, v2: V, v3: S) => Optional /** * ToPartialTriProcessor * @desc Type representing ternary processor function type with partial result in TypeScript * @example * type ToPartialTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type ToPartialTriProcessor = (v1: T, v2: V, v3: S) => Partial /** * ToRequiredTriProcessor * @desc Type representing ternary processor function type with required result in TypeScript * @example * type ToRequiredTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type ToRequiredTriProcessor = (v1: T, v2: V, v3: S) => Required /** * ToNonNullTriProcessor * @desc Type representing ternary processor function type with non-nullable result in TypeScript * @example * type ToNonNullTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type ToNonNullTriProcessor = (v1: T, v2: V, v3: S) => NonNull /** * ToNumberTriProcessor * @desc Type representing ternary processor function type with number result in TypeScript * @example * type ToNumberTriProcessor = (v1, v2, v3) => return v1 + v2 + v3 */ export type ToNumberTriProcessor = (v1: T, v2: V, v3: S) => number /** * ToStringTriProcessor * @desc Type representing string ternary processor function type with string result in TypeScript * @example * type ToStringTriProcessor = (v1, v2, v3) => return new String(v1 + v2 + v3) */ export type ToStringTriProcessor = (v1: T, v2: V, v3: S) => string /** * ToPropertyKeyTriProcessor * @desc Type representing property key ternary processor function type with property key result in TypeScript * @example * type ToPropertyKeyTriProcessor = (v1, v2, v3) => return new String(v1 + v2 + v3) */ export type ToPropertyKeyTriProcessor = (v1: T, v2: V, v3: S) => PropertyKey /** * ToBooleanTriProcessor * @desc Type representing ternary processor function type with boolean result in TypeScript * @example * type ToBooleanTriProcessor = (v1, v2, v3) => return v1 === v2 === v3 */ export type ToBooleanTriProcessor = (v1: T, v2: V, v3: S) => boolean // ------------------------------------------------------------------------------------------------- /** * UnaryOperator * @desc Type representing unary operator type in TypeScript * @example * type UnaryOperator = (v) => return v */ export type UnaryOperator = (v: T) => T /** * OptionalUnaryOperator * @desc Type representing optional unary operator type in TypeScript * @example * type OptionalUnaryOperator = (v) => return v */ export type OptionalUnaryOperator = UnaryOperator> /** * PartialUnaryOperator * @desc Type representing partial unary operator type in TypeScript * @example * type PartialUnaryOperator = (v) => return v */ export type PartialUnaryOperator = UnaryOperator> /** * RequiredUnaryOperator * @desc Type representing required unary operator type in TypeScript * @example * type RequiredUnaryOperator = (v) => return v */ export type RequiredUnaryOperator = UnaryOperator> /** * NonNullUnaryOperator * @desc Type representing non-nullable unary operator type in TypeScript * @example * type NonNullUnaryOperator = (v) => return v */ export type NonNullUnaryOperator = UnaryOperator> /** * NumberUnaryOperator * @desc Type representing number unary operator type in TypeScript * @example * type NumberUnaryOperator = (v) => return v */ export type NumberUnaryOperator = UnaryOperator /** * StringUnaryOperator * @desc Type representing string unary operator type in TypeScript * @example * type StringUnaryOperator = (v) => return v */ export type StringUnaryOperator = UnaryOperator /** * PropertyKeyUnaryOperator * @desc Type representing property key unary operator type in TypeScript * @example * type PropertyKeyUnaryOperator = (v) => return v */ export type PropertyKeyUnaryOperator = UnaryOperator /** * BooleanUnaryOperator * @desc Type representing boolean unary operator type in TypeScript * @example * type BooleanUnaryOperator = (v) => return v */ export type BooleanUnaryOperator = UnaryOperator // ------------------------------------------------------------------------------------------------- /** * BinaryOperator * @desc Type representing binary operator type in TypeScript * @example * type BinaryOperator = (v1, v2) => return v1 + v2 */ export type BinaryOperator = (v1: T, v2: T) => T /** * OptionalBinaryOperator * @desc Type representing optional binary operator type in TypeScript * @example * type OptionalBinaryOperator = (v1, v2) => return v1 + v2 */ export type OptionalBinaryOperator = BinaryOperator> /** * PartialBinaryOperator * @desc Type representing partial binary operator type in TypeScript * @example * type PartialBinaryOperator = (v1, v2) => return v1 + v2 */ export type PartialBinaryOperator = BinaryOperator> /** * RequiredBinaryOperator * @desc Type representing required binary operator type in TypeScript * @example * type RequiredBinaryOperator = (v1, v2) => return v1 + v2 */ export type RequiredBinaryOperator = BinaryOperator> /** * NonNullBinaryOperator * @desc Type representing non-nullable binary operator type in TypeScript * @example * type NonNullBinaryOperator = (v1, v2) => return v1 + v2 */ export type NonNullBinaryOperator = BinaryOperator> /** * NumberBinaryOperator * @desc Type representing number binary operator type in TypeScript * @example * type NumberBinaryOperator = (v1, v2) => return v1 + v2 */ export type NumberBinaryOperator = BinaryOperator /** * StringBinaryOperator * @desc Type representing string binary operator type in TypeScript * @example * type StringBinaryOperator = (v1, v2) => return v1 + v2 */ export type StringBinaryOperator = BinaryOperator /** * PropertyKeyBinaryOperator * @desc Type representing property key binary operator type in TypeScript * @example * type PropertyKeyBinaryOperator = (v1, v2) => return v1 + v2 */ export type PropertyKeyBinaryOperator = BinaryOperator /** * BooleanBinaryOperator * @desc Type representing boolean binary operator type in TypeScript * @example * type BooleanBinaryOperator = (v1, v2) => return v1 & v2 */ export type BooleanBinaryOperator = BinaryOperator // ------------------------------------------------------------------------------------------------- /** * TernaryOperator * @desc Type representing ternary operator type in TypeScript * @example * type TernaryOperator = (v1, v2, v3) => return v1 + v2 + v3 */ export type TernaryOperator = (v1: T, v2: T, v3: T) => T /** * OptionalTernaryOperator * @desc Type representing optional ternary operator type in TypeScript * @example * type OptionalTernaryOperator = (v1, v2, v3) => return v1 + v2 + v3 */ export type OptionalTernaryOperator = TernaryOperator> /** * PartialTernaryOperator * @desc Type representing partial ternary operator type in TypeScript * @example * type PartialTernaryOperator = (v1, v2, v3) => return v1 + v2 + v3 */ export type PartialTernaryOperator = TernaryOperator> /** * RequiredTernaryOperator * @desc Type representing required ternary operator type in TypeScript * @example * type RequiredTernaryOperator = (v1, v2, v3) => return v1 + v2 + v3 */ export type RequiredTernaryOperator = TernaryOperator> /** * NonNullTernaryOperator * @desc Type representing non-nullable ternary operator type in TypeScript * @example * type NonNullTernaryOperator = (v1, v2, v3) => return v1 + v2 + v3 */ export type NonNullTernaryOperator = TernaryOperator> /** * NumberTernaryOperator * @desc Type representing number ternary operator type in TypeScript * @example * type NumberTernaryOperator = (v1, v2, v3) => return v1 + v2 + v3 */ export type NumberTernaryOperator = TernaryOperator /** * StringTernaryOperator * @desc Type representing string ternary operator type in TypeScript * @example * type StringTernaryOperator = (v1, v2, v3) => return v1 + v2 + v3 */ export type StringTernaryOperator = TernaryOperator /** * PropertyKeyTernaryOperator * @desc Type representing property key ternary operator type in TypeScript * @example * type PropertyKeyTernaryOperator = (v1, v2, v3) => return v1 + v2 + v3 */ export type PropertyKeyTernaryOperator = TernaryOperator /** * BooleanTernaryOperator * @desc Type representing boolean ternary operator type in TypeScript * @example * type BooleanTernaryOperator = (v1, v2, v3) => return v1 & v2 & v3 */ export type BooleanTernaryOperator = TernaryOperator // ------------------------------------------------------------------------------------------------- /** * Filter * @desc Type representing filter function type in TypeScript * @example * type Filter = (v1 => true) => return [v1, v1] */ export type Filter = (filter: Predicate) => T[] /** * OptionalFilter * @desc Type representing optional filter function type in TypeScript * @example * type OptionalFilter = (v1 => true) => return [v1, v1] */ export type OptionalFilter = Filter> /** * PartialFilter * @desc Type representing partial filter function type in TypeScript * @example * type PartialFilter = (v1 => true) => return [v1, v1] */ export type PartialFilter = Filter> /** * RequiredFilter * @desc Type representing required filter function type in TypeScript * @example * type RequiredFilter = (v1 => true) => return [v1, v1] */ export type RequiredFilter = Filter> /** * NonNullFilter * @desc Type representing non-nullable filter function type in TypeScript * @example * type NonNullFilter = (v1 => true) => return [v1, v1] */ export type NonNullFilter = Filter> /** * NumberFilter * @desc Type representing number filter function type in TypeScript * @example * type NumberFilter = (v1 => true) => return [v1, v1] */ export type NumberFilter = Filter /** * StringFilter * @desc Type representing string filter function type in TypeScript * @example * type StringFilter = (v1 => true) => return [v1, v1] */ export type StringFilter = Filter /** * PropertyKeyFilter * @desc Type representing property key filter function type in TypeScript * @example * type PropertyKeyFilter = (v1 => true) => return [v1, v1] */ export type PropertyKeyFilter = Filter /** * BooleanFilter * @desc Type representing boolean filter function type in TypeScript * @example * type BooleanFilter = (v1 => true) => return [v1, v1] */ export type BooleanFilter = Filter // ------------------------------------------------------------------------------------------------- /** * ArrayGetter * @desc Type representing array getter function type in TypeScript * @example * type ArrayGetter = (v1) => v1[0] */ export type ArrayGetter = Processor /** * ArraySetter * @desc Type representing array setter function type in TypeScript * @example * type ArraySetter = (v1, v) => v1[0] = v */ export type ArraySetter = BiConsumer /** * NumberArrayGetter * @desc Type representing array getter function type in TypeScript * @example * type NumberArrayGetter = (num) => (v1) => return v1[num] */ export type NumberArrayGetter = Processor> /** * NumberArraySetter * @desc Type representing array setter function type in TypeScript * @example * type NumberArraySetter = (num) => (v1, v) => v1[num] = v */ export type NumberArraySetter = Processor> // ------------------------------------------------------------------------------------------------- /** * Comparator modes * @desc Type representing comparator supported modes */ export type ComparatorMode = 'asc' | 'desc' /** * Comparator * @desc Type representing comparator function type in TypeScript * @example * type Comparator = (v1, v2) => return 0 */ export type Comparator = BiProcessor /** * PropertyComparator * @desc Type representing property comparator function type in TypeScript * @example * type PropertyComparator = (v1, v2, 'propKey') => return 0 */ export type PropertyComparator = TriProcessor /** * OptionalComparator * @desc Type representing optional comparator function type in TypeScript * @example * type OptionalComparator = (v1, v2) => return 0 */ export type OptionalComparator = Comparator> /** * PartialComparator * @desc Type representing partial comparator function type in TypeScript * @example * type PartialComparator = (v1, v2) => return 0 */ export type PartialComparator = Comparator> /** * RequiredComparator * @desc Type representing required comparator function type in TypeScript * @example * type RequiredComparator = (v1, v2) => return 0 */ export type RequiredComparator = Comparator> /** * NonNullComparator * @desc Type representing non-nullable comparator function type in TypeScript * @example * type NonNullComparator = (v1, v2) => return 0 */ export type NonNullComparator = Comparator> /** * OptionalPropertyComparator * @desc Type representing optional property key comparator function type in TypeScript * @example * type OptionalPropertyComparator = (v1, v2, 'propKey') => return 0 */ export type OptionalPropertyComparator = PropertyComparator> /** * PartialPropertyComparator * @desc Type representing partial property key comparator function type in TypeScript * @example * type PartialPropertyComparator = (v1, v2, 'propKey') => return 0 */ export type PartialPropertyComparator = PropertyComparator> /** * RequiredPropertyComparator * @desc Type representing required property key comparator function type in TypeScript * @example * type RequiredPropertyComparator = (v1, v2, 'propKey') => return 0 */ export type RequiredPropertyComparator = PropertyComparator> /** * NonNullPropertyComparator * @desc Type representing non-nullable property key comparator function type in TypeScript * @example * type NonNullPropertyComparator = (v1, v2, 'propKey') => return 0 */ export type NonNullPropertyComparator = PropertyComparator> /** * NumberComparator * @desc Type representing number comparator function type in TypeScript * @example * type NumberComparator = (v1, v2) => return 0 */ export type NumberComparator = Comparator /** * StringComparator * @desc Type representing string comparator function type in TypeScript * @example * type StringComparator = (v1, v2) => return 0 */ export type StringComparator = Comparator /** * PropertyKeyComparator * @desc Type representing property key comparator function type in TypeScript * @example * type PropertyKeyComparator = (v1, v2) => return 0 */ export type PropertyKeyComparator = Comparator /** * BooleanComparator * @desc Type representing boolean comparator function type in TypeScript * @example * type BooleanComparator = (v1, v2) => return 0 */ export type BooleanComparator = Comparator // ------------------------------------------------------------------------------------------------- /** * Wrapper * @desc Type representing wrapper function type in TypeScript * @example * type Wrapper = (v1, v2) => return 0 */ export type Wrapper = Supplier> /** * OptionalWrapper * @desc Type representing optional wrapper function type in TypeScript * @example * type OptionalWrapper = (v1, v2) => return 0 */ export type OptionalWrapper = Wrapper> /** * PartialWrapper * @desc Type representing partial wrapper function type in TypeScript * @example * type PartialWrapper = (v1, v2) => return 0 */ export type PartialWrapper = Wrapper> /** * RequiredWrapper * @desc Type representing required wrapper function type in TypeScript * @example * type RequiredWrapper = (v1, v2) => return 0 */ export type RequiredWrapper = Wrapper> /** * NonNullWrapper * @desc Type representing non-nullable wrapper function type in TypeScript * @example * type NonNullWrapper = (v1, v2) => return 0 */ export type NonNullWrapper = Wrapper> // ------------------------------------------------------------------------------------------------- /** * Factory * @desc Type representing factory function type in TypeScript * @example * type Factory = (v1, v2) => return 0 */ export type Factory = Processor> /** * OptionalFactory * @desc Type representing optional factory function type in TypeScript * @example * type OptionalFactory = (v1, v2) => return 0 */ export type OptionalFactory = Factory> /** * PartialFactory * @desc Type representing partial factory function type in TypeScript * @example * type PartialFactory = (v1, v2) => return 0 */ export type PartialFactory = Factory> /** * RequiredFactory * @desc Type representing required factory function type in TypeScript * @example * type RequiredFactory = (v1, v2) => return 0 */ export type RequiredFactory = Factory> /** * NonNullFactory * @desc Type representing non-nullable factory function type in TypeScript * @example * type NonNullFactory = (v1, v2) => return 0 */ export type NonNullFactory = Factory> // ------------------------------------------------------------------------------------------------- /** * Formatter * @desc Type representing formatter function type in TypeScript * @example * type Formatter = (v1, v2) => return '0' */ export type StringFormatter = (value: number, fraction: number) => string // -------------------------------------------------------------------------------------------------