UNPKG

2.95 kBTypeScriptView Raw
1// Type definitions for chai-string 1.4.0
2// Project: https://github.com/onechiporenko/chai-string
3// Definitions by: Nick Malaguti <https://github.com/nmalaguti>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// TypeScript Version: 3.0
6
7///<reference types="chai" />
8
9declare global {
10 namespace Chai {
11 interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
12 startsWith(expected: string, message?: string): Assertion;
13 startWith(expected: string, message?: string): Assertion;
14 endsWith(expected: string, message?: string): Assertion;
15 endWith(expected: string, message?: string): Assertion;
16 equalIgnoreCase(expected: string, message?: string): Assertion;
17 equalIgnoreSpaces(expected: string, message?: string): Assertion;
18 containIgnoreCase(expected: string, msg?: string): Assertion;
19 containIgnoreSpaces(expected: string, msg?: string): Assertion;
20 singleLine(message?: string): Assertion;
21 reverseOf(message?: string): Assertion;
22 palindrome(message?: string): Assertion;
23 entriesCount(substr: string, expected: number, message?: string): Assertion;
24 indexOf(str: string, substr: string, index: number, msg?: string): Assertion;
25 }
26
27 interface Assert {
28 startsWith(val: string, exp: string, msg?: string): void;
29 notStartsWith(val: string, exp: string, msg?: string): void;
30 endsWith(val: string, exp: string, msg?: string): void;
31 notEndsWith(val: string, exp: string, msg?: string): void;
32 equalIgnoreCase(val: string, exp: string, msg?: string): void;
33 notEqualIgnoreCase(val: string, exp: string, msg?: string): void;
34 equalIgnoreSpaces(val: string, exp: string, msg?: string): void;
35 notEqualIgnoreSpaces(val: string, exp: string, msg?: string): void;
36 containIgnoreCase(val: string, exp: string, msg?: string): void;
37 notContainIgnoreCase(val: string, exp: string, msg?: string): void;
38 containIgnoreSpaces(val: string, exp: string, msg?: string): void;
39 notContainIgnoreSpaces(val: string, exp: string, msg?: string): void;
40 singleLine(val: string, msg?: string): void;
41 notSingleLine(val: string, msg?: string): void;
42 reverseOf(val: string, exp: string, msg?: string): void;
43 notReverseOf(val: string, exp: string, msg?: string): void;
44 palindrome(val: string, msg?: string): void;
45 notPalindrome(val: string, msg?: string): void;
46 entriesCount(str: string, substr: string, count: number, msg?: string): void;
47 indexOf(str: string, substr: string, index: number, msg?: string): void;
48 }
49 }
50}
51
52declare const chaiString: Chai.ChaiPlugin;
53declare namespace chaiString { }
54export = chaiString;