init component
This commit is contained in:
42
node_modules/fp-ts/lib/struct.d.ts
generated
vendored
Normal file
42
node_modules/fp-ts/lib/struct.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Semigroup } from './Semigroup'
|
||||
/**
|
||||
* Return a semigroup which works like `Object.assign`.
|
||||
*
|
||||
* @example
|
||||
* import { getAssignSemigroup } from 'fp-ts/struct'
|
||||
*
|
||||
* interface Person {
|
||||
* readonly name: string
|
||||
* readonly age: number
|
||||
* }
|
||||
*
|
||||
* const S = getAssignSemigroup<Person>()
|
||||
* assert.deepStrictEqual(S.concat({ name: 'name', age: 23 }, { name: 'name', age: 24 }), { name: 'name', age: 24 })
|
||||
*
|
||||
* @category instances
|
||||
* @since 2.10.0
|
||||
*/
|
||||
export declare const getAssignSemigroup: <A extends object = never>() => Semigroup<A>
|
||||
/**
|
||||
* Creates a new object by recursively evolving a shallow copy of `a`, according to the `transformation` functions.
|
||||
*
|
||||
* @example
|
||||
* import { pipe } from 'fp-ts/function'
|
||||
* import { evolve } from 'fp-ts/struct'
|
||||
*
|
||||
* assert.deepStrictEqual(
|
||||
* pipe(
|
||||
* { a: 'a', b: 1 },
|
||||
* evolve({
|
||||
* a: (a) => a.length,
|
||||
* b: (b) => b * 2
|
||||
* })
|
||||
* ),
|
||||
* { a: 1, b: 2 }
|
||||
* )
|
||||
*
|
||||
* @since 2.11.0
|
||||
*/
|
||||
export declare const evolve: <A, F extends { [K in keyof A]: (a: A[K]) => unknown }>(
|
||||
transformations: F
|
||||
) => (a: A) => { [K in keyof F]: ReturnType<F[K]> }
|
||||
Reference in New Issue
Block a user