import { equals, hasProperty, isAny, isArray, isBoolean, isFalse, isFunction, isNever, isNull, isNumber, isObject, isPromise, isStrictObject, isString, isSubtype, isSupertype, isTrue, isTuple, isUndefined, isUnknown, Opaque, Xor } from '../modules'; import { forceExtract } from '../modules/internals'; import { FailMsgs } from './messages'; type RTT_PASS = { status: Opaque; }; type RTT_FAIL<_T extends string = 'No Message'> = { status: Opaque; msg: _T; }; type Awaited = Type extends Promise ? Awaited : Type; type Returned = Type extends (() => infer K) ? K : never; type Assertion = () => $if, { then: RTT_PASS; else: RTT_FAIL[keyToErrorsMsg]>; }>; interface Assertions { not: Assertions>; awaited: Assertions, I>; returned: Assertions, I>; /** asserting type should be the same type as the expected*/ equals: () => Xor> extends true ? RTT_PASS : RTT_FAIL['equal']>; /** expected type should be extended of asserting type*/ isSuperTypeOf: () => Xor> extends true ? RTT_PASS : RTT_FAIL['supertype']>; /** expected type should be extended of asserting type*/ isAssignableTo: () => Xor> extends true ? RTT_PASS : RTT_FAIL['subtype']>; /** asserting type should be extended of expected type */ isSubTypeOf: () => Xor> extends true ? RTT_PASS : RTT_FAIL['subtype']>; /** Type should be `true` */ toBeTrue: Assertion, I, 'truly'>; /** Type should be `false` */ toBeFalse: Assertion, I, 'falsy'>; /** Type should be "never" */ toBeNever: Assertion, I, 'never'>; /** Type should be "null" */ toBeNull: Assertion, I, 'null'>; /** Type should be "undefined" */ toBeUndefined: Assertion, I, 'undefined'>; /** Type should be "any" */ toBeAny: Assertion, I, 'any'>; /** Type should be "unknow" */ toBeUnknow: Assertion, I, 'unknow'>; /** Type should extends of Object, Array or Function */ toBeObject: Assertion, I, 'object'>; /** Type should extends only of Objects */ toBeStrictObject: Assertion, I, 'object'>; /** Type should extends of function */ toBeFunction: Assertion, I, 'function'>; /** Type should be a array */ toBeArray: Assertion, I, 'array'>; /** Type should be a tuple */ toBeTuple: Assertion, I, 'tuple'>; /** Type should be a tuple of passed length */ toBeTupleWithLength: () => Xor & equals>> extends true ? RTT_PASS : RTT_FAIL['tuple']>; /** Type should be a string */ toBeString: Assertion, I, 'string'>; /** Type should be a number */ toBeNumber: Assertion, I, 'number'>; /** Type should be true | false */ toBeBoolean: Assertion, I, 'boolean'>; /** Type should be a promise */ toBePromise: Assertion, I, 'promise'>; /** Type should has the property passed */ toHaveProperty: >(v?: U) => Xor> extends true ? RTT_PASS : RTT_FAIL['property']>; } declare global { function describeType(description: string, cb: () => void): void; function testType(description: string, tests: (() => void) | any[] | unknownObject): void; function assertType(): Assertions; } export {};