UNPKG

@shedevro/assert

Version:

Assertion typescript library for better, comfortable and safe coding. See readme!

54 lines (53 loc) 1.84 kB
declare namespace Match { namespace Asserts { type One = { match(value: unknown, regExp: RegExp, message?: string): asserts value is string; }; type OneNullable = { match(value: unknown, regExp: RegExp, message?: string): asserts value is string | null; }; type Array = { match(value: unknown, regExp: RegExp, message?: string): asserts value is string[]; }; type ArrayNullable = { match(value: unknown, regExp: RegExp, message?: string): asserts value is string[] | null; }; type Not = { match(value: unknown, regExp: RegExp, message?: string): void; }; } namespace ValueIs { type One = { match(value: unknown, regExp: RegExp): value is string; }; type OneNullable = { match(value: unknown, regExp: RegExp): value is string | null; }; type Array = { match(value: unknown, regExp: RegExp): value is string[]; }; type ArrayNullable = { match(value: unknown, regExp: RegExp): value is string[] | null; }; type Not = { match(value: unknown, regExp: RegExp): boolean; }; } } export declare namespace RegExpFunctions { namespace Asserts { type One = Match.Asserts.One; type OneNullable = Match.Asserts.OneNullable; type Array = Match.Asserts.Array; type ArrayNullable = Match.Asserts.ArrayNullable; type Not = Match.Asserts.Not; } namespace ValueIs { type One = Match.ValueIs.One; type OneNullable = Match.ValueIs.OneNullable; type Array = Match.ValueIs.Array; type ArrayNullable = Match.ValueIs.ArrayNullable; type Not = Match.ValueIs.Not; } } export {};