declare let _$_: { new (): {}; } & typeof globalThis; declare class $ extends _$_ { } declare namespace $ { export type $ = typeof $$; export class $$ extends $ { static $: $; } namespace $$ { type $$ = $; } export {}; } declare namespace $ { /** * Return `unknown` when `A` and `B` are the same type. `never` otherwise. * * $mol_type_equals< unknown , any > & number // true * $mol_type_equals< never , never > & number // false */ type $mol_type_equals = (() => X extends A ? 1 : 2) extends (() => X extends B ? 1 : 2) ? true : false; } declare namespace $ { /** * Reqursive converts intersection of records to record of intersections * * // { a : { x : 1 , y : 2 } } * $mol_type_merge< { a : { x : 1 } }&{ a : { y : 2 } } > */ type $mol_type_merge = Intersection extends (...a: any[]) => any ? Intersection : Intersection extends new (...a: any[]) => any ? Intersection : Intersection extends object ? $mol_type_merge_object extends Intersection ? true extends $mol_type_equals<{ [Key in keyof Intersection]: Intersection[Key]; }, Intersection> ? Intersection : { [Key in keyof Intersection]: $mol_type_merge; } : Intersection : Intersection; /** * Flat converts intersection of records to record of intersections * * // { a: 1, b: 2 } * $mol_type_merge< { a: 1 } & { b: 2 } > */ type $mol_type_merge_object = { [Key in keyof Intersection]: Intersection[Key]; }; } declare namespace $ { /** * Converts union of types to intersection of same types * * $mol_type_intersect< number | string > // number & string */ type $mol_type_intersect = (Union extends any ? (_: Union) => void : never) extends ((_: infer Intersection) => void) ? Intersection : never; } declare namespace $ { /** Replaces properties of `Base` record by properties from `Over`. */ type $mol_type_override = Omit & Over; } declare namespace $ { function $mol_fail(error: any): never; } declare namespace $ { type $mol_unicode_category = [$mol_unicode_category_binary] | ['General_Category', $mol_char_category_general] | ['Script', $mol_unicode_category_script] | ['Script_Extensions', $mol_unicode_category_script]; type $mol_unicode_category_binary = 'ASCII' | 'ASCII_Hex_Digit' | 'Alphabetic' | 'Any' | 'Assigned' | 'Bidi_Control' | 'Bidi_Mirrored' | 'Case_Ignorable' | 'Cased' | 'Changes_When_Casefolded' | 'Changes_When_Casemapped' | 'Changes_When_Lowercased' | 'Changes_When_NFKC_Casefolded' | 'Changes_When_Titlecased' | 'Changes_When_Uppercased' | 'Dash' | 'Default_Ignorable_Code_Point' | 'Deprecated' | 'Diacritic' | 'Emoji' | 'Emoji_Component' | 'Emoji_Modifier' | 'Emoji_Modifier_Base' | 'Emoji_Presentation' | 'Extended_Pictographic' | 'Extender' | 'Grapheme_Base' | 'Grapheme_Extend' | 'Hex_Digit' | 'IDS_Binary_Operator' | 'IDS_Trinary_Operator' | 'ID_Continue' | 'ID_Start' | 'Ideographic' | 'Join_Control' | 'Logical_Order_Exception' | 'Lowercase' | 'Math' | 'Noncharacter_Code_Point' | 'Pattern_Syntax' | 'Pattern_White_Space' | 'Quotation_Mark' | 'Radical' | 'Regional_Indicator' | 'Sentence_Terminal' | 'Soft_Dotted' | 'Terminal_Punctuation' | 'Unified_Ideograph' | 'Uppercase' | 'Variation_Selector' | 'White_Space' | 'XID_Continue' | 'XID_Start'; type $mol_char_category_general = 'Cased_Letter' | 'Close_Punctuation' | 'Connector_Punctuation' | 'Control' | 'Currency_Symbol' | 'Dash_Punctuation' | 'Decimal_Number' | 'Enclosing_Mark' | 'Final_Punctuation' | 'Format' | 'Initial_Punctuation' | 'Letter' | 'Letter_Number' | 'Line_Separator' | 'Lowercase_Letter' | 'Mark' | 'Math_Symbol' | 'Modifier_Letter' | 'Modifier_Symbol' | 'Nonspacing_Mark' | 'Number' | 'Open_Punctuation' | 'Other' | 'Other_Letter' | 'Other_Number' | 'Other_Punctuation' | 'Other_Symbol' | 'Paragraph_Separator' | 'Private_Use' | 'Punctuation' | 'Separator' | 'Space_Separator' | 'Spacing_Mark' | 'Surrogate' | 'Symbol' | 'Titlecase_Letter' | 'Unassigned' | 'Uppercase_Letter'; type $mol_unicode_category_script = 'Adlam' | 'Ahom' | 'Anatolian_Hieroglyphs' | 'Arabic' | 'Armenian' | 'Avestan' | 'Balinese' | 'Bamum' | 'Bassa_Vah' | 'Batak' | 'Bengali' | 'Bhaiksuki' | 'Bopomofo' | 'Brahmi' | 'Braille' | 'Buginese' | 'Buhid' | 'Canadian_Aboriginal' | 'Carian' | 'Caucasian_Albanian' | 'Chakma' | 'Cham' | 'Chorasmian' | 'Cherokee' | 'Common' | 'Coptic' | 'Cuneiform' | 'Cypriot' | 'Cyrillic' | 'Deseret' | 'Devanagari' | 'Dives_Akuru' | 'Dogra' | 'Duployan' | 'Egyptian_Hieroglyphs' | 'Elbasan' | 'Elymaic' | 'Ethiopic' | 'Georgian' | 'Glagolitic' | 'Gothic' | 'Grantha' | 'Greek' | 'Gujarati' | 'Gunjala_Gondi' | 'Gurmukhi' | 'Han' | 'Hangul' | 'Hanifi_Rohingya' | 'Hanunoo' | 'Hatran' | 'Hebrew' | 'Hiragana' | 'Imperial_Aramaic' | 'Inherited' | 'Inscriptional_Pahlavi' | 'Inscriptional_Parthian' | 'Javanese' | 'Kaithi' | 'Kannada' | 'Katakana' | 'Kayah_Li' | 'Kharoshthi' | 'Khitan_Small_Script' | 'Khmer' | 'Khojki' | 'Khudawadi' | 'Lao' | 'Latin' | 'Lepcha' | 'Limbu' | 'Linear_A' | 'Linear_B' | 'Lisu' | 'Lycian' | 'Lydian' | 'Mahajani' | 'Makasar' | 'Malayalam' | 'Mandaic' | 'Manichaean' | 'Marchen' | 'Medefaidrin' | 'Masaram_Gondi' | 'Meetei_Mayek' | 'Mende_Kikakui' | 'Meroitic_Cursive' | 'Meroitic_Hieroglyphs' | 'Miao' | 'Modi' | 'Mongolian' | 'Mro' | 'Multani' | 'Myanmar' | 'Nabataean' | 'Nandinagari' | 'New_Tai_Lue' | 'Newa' | 'Nko' | 'Nushu' | 'Nyiakeng_Puachue_Hmong' | 'Ogham' | 'Ol_Chiki' | 'Old_Hungarian' | 'Old_Italic' | 'Old_North_Arabian' | 'Old_Permic' | 'Old_Persian' | 'Old_Sogdian' | 'Old_South_Arabian' | 'Old_Turkic' | 'Oriya' | 'Osage' | 'Osmanya' | 'Pahawh_Hmong' | 'Palmyrene' | 'Pau_Cin_Hau' | 'Phags_Pa' | 'Phoenician' | 'Psalter_Pahlavi' | 'Rejang' | 'Runic' | 'Samaritan' | 'Saurashtra' | 'Sharada' | 'Shavian' | 'Siddham' | 'SignWriting' | 'Sinhala' | 'Sogdian' | 'Sora_Sompeng' | 'Soyombo' | 'Sundanese' | 'Syloti_Nagri' | 'Syriac' | 'Tagalog' | 'Tagbanwa' | 'Tai_Le' | 'Tai_Tham' | 'Tai_Viet' | 'Takri' | 'Tamil' | 'Tangut' | 'Telugu' | 'Thaana' | 'Thai' | 'Tibetan' | 'Tifinagh' | 'Tirhuta' | 'Ugaritic' | 'Vai' | 'Wancho' | 'Warang_Citi' | 'Yezidi' | 'Yi' | 'Zanabazar_Square'; } interface String { match(regexp: RE): ReturnType; matchAll(regexp: RE): ReturnType; } declare namespace $ { type Groups_to_params = { [P in keyof T]?: T[P] | boolean | undefined; }; export type $mol_regexp_source = number | string | RegExp | { [key in string]: $mol_regexp_source; } | readonly [$mol_regexp_source, ...$mol_regexp_source[]]; export type $mol_regexp_groups = Source extends number ? {} : Source extends string ? {} : Source extends $mol_regexp_source[] ? $mol_type_merge<$mol_type_intersect<{ [key in Extract]: $mol_regexp_groups; }[Extract]>> : Source extends RegExp ? Record extends NonNullable>['groups']> ? {} : NonNullable>['groups']> : Source extends { readonly [key in string]: $mol_regexp_source; } ? $mol_type_merge<$mol_type_intersect<{ [key in keyof Source]: $mol_type_merge<$mol_type_override<{ readonly [k in Extract]: string; }, { readonly [k in key]: Source[key] extends string ? Source[key] : string; }> & $mol_regexp_groups>; }[keyof Source]>> : never; /** Type safe reguar expression builder */ export class $mol_regexp> extends RegExp { readonly groups: (Extract)[]; /** Prefer to use $mol_regexp.from */ constructor(source: string, flags?: string, groups?: (Extract)[]); [Symbol.matchAll](str: string): RegExpStringIterator>; /** Parses input and returns found capture groups or null */ [Symbol.match](str: string): null | RegExpMatchArray; /** Splits string by regexp edges */ [Symbol.split](str: string): string[]; test(str: string): boolean; exec(str: string): RegExpExecArray & $mol_type_override | null; generate(params: Groups_to_params): string | null; get native(): RegExp; /** Makes regexp that greedy repeats this pattern with delimiter */ static separated(chunk: Chunk, sep: Sep): $mol_regexp<[$mol_regexp<[[Chunk], Sep] extends infer T ? T extends [[Chunk], Sep] ? T extends $mol_regexp_source[] ? $mol_type_merge<$mol_type_intersect<{ [key in Extract]: $mol_regexp_groups; }[Extract]>> : T extends RegExp ? Record extends NonNullable>["groups"]> ? {} : NonNullable>["groups"]> : T extends { readonly [x: string]: $mol_regexp_source; } ? $mol_type_merge<$mol_type_intersect<{ [key_1 in keyof T]: $mol_type_merge]: string; }, key_1> & { readonly [k_1 in key_1]: T[key_1] extends string ? T[key_1] : string; } & $mol_regexp_groups>; }[keyof T]>> : never : never : never>, Chunk] extends infer T_1 ? T_1 extends [$mol_regexp<[[Chunk], Sep] extends infer T_2 ? T_2 extends [[Chunk], Sep] ? T_2 extends $mol_regexp_source[] ? $mol_type_merge<$mol_type_intersect<{ [key_4 in Extract]: $mol_regexp_groups; }[Extract]>> : T_2 extends RegExp ? Record extends NonNullable>["groups"]> ? {} : NonNullable>["groups"]> : T_2 extends { readonly [x: string]: $mol_regexp_source; } ? $mol_type_merge<$mol_type_intersect<{ [key_5 in keyof T_2]: $mol_type_merge]: string; }, key_5> & { readonly [k_1 in key_5]: T_2[key_5] extends string ? T_2[key_5] : string; } & $mol_regexp_groups>; }[keyof T_2]>> : never : never : never>, Chunk] ? T_1 extends $mol_regexp_source[] ? $mol_type_merge<$mol_type_intersect<{ [key_2 in Extract]: $mol_regexp_groups; }[Extract]>> : T_1 extends RegExp ? Record extends NonNullable>["groups"]> ? {} : NonNullable>["groups"]> : T_1 extends { readonly [x: string]: $mol_regexp_source; } ? $mol_type_merge<$mol_type_intersect<{ [key_3 in keyof T_1]: $mol_type_merge]: string; }, key_3> & { readonly [k_1 in key_3]: T_1[key_3] extends string ? T_1[key_3] : string; } & $mol_regexp_groups>; }[keyof T_1]>> : never : never : never>; /** Makes regexp that non-greedy repeats this pattern from min to max count */ static repeat(source: Source, min?: number, max?: number): $mol_regexp<$mol_regexp_groups>; /** Makes regexp that greedy repeats this pattern from min to max count */ static repeat_greedy(source: Source, min?: number, max?: number): $mol_regexp<$mol_regexp_groups>; /** Makes regexp that match any of options */ static vary(sources: Sources, flags?: string): $mol_regexp<$mol_regexp_groups>; /** Makes regexp that allow absent of this pattern */ static optional(source: Source): $mol_regexp<$mol_regexp_groups>; /** Makes regexp that look ahead for pattern */ static force_after(source: $mol_regexp_source): $mol_regexp>; /** Makes regexp that look ahead for pattern */ static forbid_after(source: $mol_regexp_source): $mol_regexp>; /** Converts some js values to regexp */ static from(source: Source, { ignoreCase, multiline }?: Partial>): $mol_regexp<$mol_regexp_groups>; /** Makes regexp which includes only unicode category */ static unicode_only(...category: $mol_unicode_category): $mol_regexp>; /** Makes regexp which excludes unicode category */ static unicode_except(...category: $mol_unicode_category): $mol_regexp>; static char_range(from: number, to: number): $mol_regexp<{}>; static char_only(...allowed: readonly [$mol_regexp_source, ...$mol_regexp_source[]]): $mol_regexp<{}>; static char_except(...forbidden: readonly [$mol_regexp_source, ...$mol_regexp_source[]]): $mol_regexp<{}>; static decimal_only: $mol_regexp<{}>; static decimal_except: $mol_regexp<{}>; static latin_only: $mol_regexp<{}>; static latin_except: $mol_regexp<{}>; static space_only: $mol_regexp<{}>; static space_except: $mol_regexp<{}>; static word_break_only: $mol_regexp<{}>; static word_break_except: $mol_regexp<{}>; static tab: $mol_regexp<{}>; static slash_back: $mol_regexp<{}>; static nul: $mol_regexp<{}>; static char_any: $mol_regexp<{}>; static begin: $mol_regexp<{}>; static end: $mol_regexp<{}>; static or: $mol_regexp<{}>; static line_end: $mol_regexp<{ readonly win_end: string; readonly mac_end: string; }>; } export {}; } export = $; //# sourceMappingURL=node.d.ts.map