//POLYFILLS: type NoInfer = T extends infer U ? U : never; type WeakKey = object; //#region src/add.d.ts /** * Adds two numbers. * * @param value - The number. * @param addend - The number to add to the value. * @signature * R.add(value, addend); * @example * R.add(10, 5) // => 15 * R.add(10, -5) // => 5 * @dataFirst * @category Number */ declare function add(value: bigint, addend: bigint): bigint; declare function add(value: number, addend: number): number; /** * Adds two numbers. * * @param addend - The number to add to the value. * @signature * R.add(addend)(value); * @example * R.add(5)(10) // => 15 * R.add(-5)(10) // => 5 * R.map([1, 2, 3, 4], R.add(1)) // => [2, 3, 4, 5] * @dataLast * @category Number */ declare function add(addend: bigint): (value: bigint) => bigint; declare function add(addend: number): (value: number) => number; //#endregion //#region node_modules/type-fest/source/primitive.d.ts /** Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). @category Type */ type Primitive = null | undefined | string | number | boolean | symbol | bigint; //#endregion //#region node_modules/type-fest/source/union-to-intersection.d.ts /** Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153). @example ``` import type {UnionToIntersection} from 'type-fest'; type Union = {the(): void} | {great(arg: string): void} | {escape: boolean}; type Intersection = UnionToIntersection; //=> {the(): void; great(arg: string): void; escape: boolean}; ``` @category Type */ type UnionToIntersection = ( // `extends unknown` is always going to be the case and is used to convert the // `Union` into a [distributive conditional // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). Union extends unknown // The union type is used as the only argument to a function since the union // of function arguments is an intersection. ? (distributedUnion: Union) => void // This won't happen. : never // Infer the `Intersection` type since TypeScript represents the positional // arguments of unions of functions as an intersection of the union. ) extends ((mergedIntersection: infer Intersection) => void) // The `& Union` is to ensure result of `UnionToIntersection` is always assignable to `A | B` ? Intersection & Union : never; //#endregion //#region node_modules/type-fest/source/keys-of-union.d.ts /** Create a union of all keys from a given type, even those exclusive to specific union members. Unlike the native `keyof` keyword, which returns keys present in **all** union members, this type returns keys from **any** member. @link https://stackoverflow.com/a/49402091 @example ``` import type {KeysOfUnion} from 'type-fest'; type A = { common: string; a: number; }; type B = { common: string; b: string; }; type C = { common: string; c: boolean; }; type Union = A | B | C; type CommonKeys = keyof Union; //=> 'common' type AllKeys = KeysOfUnion; //=> 'common' | 'a' | 'b' | 'c' ``` @category Object */ type KeysOfUnion = // Hack to fix https://github.com/sindresorhus/type-fest/issues/1008 keyof UnionToIntersection : never>; //#endregion //#region node_modules/type-fest/source/empty-object.d.ts declare const emptyObjectSymbol: unique symbol; /** Represents a strictly empty plain object, the `{}` value. When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)). @example ``` import type {EmptyObject} from 'type-fest'; // The following illustrates the problem with `{}`. const foo1: {} = {}; // Pass const foo2: {} = []; // Pass const foo3: {} = 42; // Pass const foo4: {} = {a: 1}; // Pass // With `EmptyObject` only the first case is valid. const bar1: EmptyObject = {}; // Pass // @ts-expect-error const bar2: EmptyObject = []; // Fail // @ts-expect-error const bar3: EmptyObject = 42; // Fail // @ts-expect-error const bar4: EmptyObject = {a: 1}; // Fail ``` Unfortunately, `Record`, `Record` and `Record` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}. @category Object */ type EmptyObject = { [emptyObjectSymbol]?: never; }; //#endregion //#region node_modules/type-fest/source/is-any.d.ts /** Returns a boolean for whether the given type is `any`. @link https://stackoverflow.com/a/49928360/1490091 Useful in type utilities, such as disallowing `any`s to be passed to a function. @example ``` import type {IsAny} from 'type-fest'; const typedObject = {a: 1, b: 2} as const; const anyObject: any = {a: 1, b: 2}; function get extends true ? {} : Record), K extends keyof O = keyof O>(object: O, key: K) { return object[key]; } const typedA = get(typedObject, 'a'); //=> 1 const anyA = get(anyObject, 'a'); //=> any ``` @category Type Guard @category Utilities */ type IsAny = 0 extends 1 & NoInfer ? true : false; //#endregion //#region node_modules/type-fest/source/is-optional-key-of.d.ts /** Returns a boolean for whether the given key is an optional key of type. This is useful when writing utility types or schema validators that need to differentiate `optional` keys. @example ``` import type {IsOptionalKeyOf} from 'type-fest'; type User = { name: string; surname: string; luckyNumber?: number; }; type Admin = { name: string; surname?: string; }; type T1 = IsOptionalKeyOf; //=> true type T2 = IsOptionalKeyOf; //=> false type T3 = IsOptionalKeyOf; //=> boolean type T4 = IsOptionalKeyOf; //=> false type T5 = IsOptionalKeyOf; //=> boolean ``` @category Type Guard @category Utilities */ type IsOptionalKeyOf = IsAny extends true ? never : Key$1 extends keyof Type$1 ? Type$1 extends Record ? false : true : false; //#endregion //#region node_modules/type-fest/source/optional-keys-of.d.ts /** Extract all optional keys from the given type. This is useful when you want to create a new type that contains different type values for the optional keys only. @example ``` import type {OptionalKeysOf, Except} from 'type-fest'; type User = { name: string; surname: string; luckyNumber?: number; }; const REMOVE_FIELD = Symbol('remove field symbol'); type UpdateOperation = Except, OptionalKeysOf> & { [Key in OptionalKeysOf]?: Entity[Key] | typeof REMOVE_FIELD; }; const update1: UpdateOperation = { name: 'Alice', }; const update2: UpdateOperation = { name: 'Bob', luckyNumber: REMOVE_FIELD, }; ``` @category Utilities */ type OptionalKeysOf = Type$1 extends unknown // For distributing `Type` ? (keyof { [Key in keyof Type$1 as IsOptionalKeyOf extends false ? never : Key]: never }) & keyof Type$1 // Intersect with `keyof Type` to ensure result of `OptionalKeysOf` is always assignable to `keyof Type` : never; //#endregion //#region node_modules/type-fest/source/required-keys-of.d.ts /** Extract all required keys from the given type. This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc... @example ``` import type {RequiredKeysOf} from 'type-fest'; declare function createValidation< Entity extends object, Key extends RequiredKeysOf = RequiredKeysOf, >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean; type User = { name: string; surname: string; luckyNumber?: number; }; const validator1 = createValidation('name', value => value.length < 25); const validator2 = createValidation('surname', value => value.length < 25); // @ts-expect-error const validator3 = createValidation('luckyNumber', value => value > 0); // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'. ``` @category Utilities */ type RequiredKeysOf = Type$1 extends unknown // For distributing `Type` ? Exclude> : never; //#endregion //#region node_modules/type-fest/source/has-required-keys.d.ts /** Creates a type that represents `true` or `false` depending on whether the given type has any required fields. This is useful when you want to create an API whose behavior depends on the presence or absence of required fields. @example ``` import type {HasRequiredKeys} from 'type-fest'; type GeneratorOptions