Innovenergy_trunk/frontend/node_modules/fp-ts/es6/string.d.ts

227 lines
5.6 KiB
TypeScript

/**
* @since 2.10.0
*/
import * as E from './Eq'
import * as M from './Monoid'
import * as S from './Semigroup'
import * as O from './Ord'
import * as Sh from './Show'
import { Refinement } from './Refinement'
import { ReadonlyNonEmptyArray } from './ReadonlyNonEmptyArray'
/**
* @example
* import * as S from 'fp-ts/string'
*
* assert.deepStrictEqual(S.Eq.equals('a', 'a'), true)
* assert.deepStrictEqual(S.Eq.equals('a', 'b'), false)
*
* @category instances
* @since 2.10.0
*/
export declare const Eq: E.Eq<string>
/**
* `string` semigroup under concatenation.
*
* @example
* import * as S from 'fp-ts/string'
*
* assert.deepStrictEqual(S.Semigroup.concat('a', 'b'), 'ab')
*
* @category instances
* @since 2.10.0
*/
export declare const Semigroup: S.Semigroup<string>
/**
* An empty `string`.
*
* @since 2.10.0
*/
export declare const empty = ''
/**
* `string` monoid under concatenation.
*
* The `empty` value is `''`.
*
* @example
* import * as S from 'fp-ts/string'
*
* assert.deepStrictEqual(S.Monoid.concat('a', 'b'), 'ab')
* assert.deepStrictEqual(S.Monoid.concat('a', S.Monoid.empty), 'a')
*
* @category instances
* @since 2.10.0
*/
export declare const Monoid: M.Monoid<string>
/**
* @example
* import * as S from 'fp-ts/string'
*
* assert.deepStrictEqual(S.Ord.compare('a', 'a'), 0)
* assert.deepStrictEqual(S.Ord.compare('a', 'b'), -1)
* assert.deepStrictEqual(S.Ord.compare('b', 'a'), 1)
*
* @category instances
* @since 2.10.0
*/
export declare const Ord: O.Ord<string>
/**
* @example
* import * as S from 'fp-ts/string'
*
* assert.deepStrictEqual(S.Show.show('a'), '"a"')
*
* @category instances
* @since 2.10.0
*/
export declare const Show: Sh.Show<string>
/**
* @example
* import * as S from 'fp-ts/string'
*
* assert.deepStrictEqual(S.isString('a'), true)
* assert.deepStrictEqual(S.isString(1), false)
*
* @category refinements
* @since 2.11.0
*/
export declare const isString: Refinement<unknown, string>
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('a', S.toUpperCase), 'A')
*
* @since 2.11.0
*/
export declare const toUpperCase: (s: string) => string
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('A', S.toLowerCase), 'a')
*
* @since 2.11.0
*/
export declare const toLowerCase: (s: string) => string
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('abc', S.replace('b', 'd')), 'adc')
*
* @since 2.11.0
*/
export declare const replace: (searchValue: string | RegExp, replaceValue: string) => (s: string) => string
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe(' a ', S.trim), 'a')
*
* @since 2.11.0
*/
export declare const trim: (s: string) => string
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe(' a ', S.trimLeft), 'a ')
*
* @since 2.11.0
*/
export declare const trimLeft: (s: string) => string
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe(' a ', S.trimRight), ' a')
*
* @since 2.11.0
*/
export declare const trimRight: (s: string) => string
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('abcd', S.slice(1, 3)), 'bc')
*
* @since 2.11.0
*/
export declare const slice: (start: number, end: number) => (s: string) => string
/**
* Test whether a `string` is empty.
*
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('', S.isEmpty), true)
* assert.deepStrictEqual(pipe('a', S.isEmpty), false)
*
* @since 2.10.0
*/
export declare const isEmpty: (s: string) => boolean
/**
* Calculate the number of characters in a `string`.
*
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('abc', S.size), 3)
*
* @since 2.10.0
*/
export declare const size: (s: string) => number
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('abc', S.split('')), ['a', 'b', 'c'])
* assert.deepStrictEqual(pipe('', S.split('')), [''])
*
* @since 2.11.0
*/
export declare const split: (separator: string | RegExp) => (s: string) => ReadonlyNonEmptyArray<string>
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('abc', S.includes('b')), true)
* assert.deepStrictEqual(pipe('abc', S.includes('d')), false)
*
* @since 2.11.0
*/
export declare const includes: (searchString: string, position?: number) => (s: string) => boolean
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('abc', S.startsWith('a')), true)
* assert.deepStrictEqual(pipe('bc', S.startsWith('a')), false)
*
* @since 2.11.0
*/
export declare const startsWith: (searchString: string, position?: number) => (s: string) => boolean
/**
* @example
* import * as S from 'fp-ts/string'
* import { pipe } from 'fp-ts/function'
*
* assert.deepStrictEqual(pipe('abc', S.endsWith('c')), true)
* assert.deepStrictEqual(pipe('ab', S.endsWith('c')), false)
*
* @since 2.11.0
*/
export declare const endsWith: (searchString: string, position?: number) => (s: string) => boolean