declare type AllowedRegexAttrValueFlag = 'i' | 'm' | 's' | 'u'; declare type AttrValueIsUnsafeToIntersect = typeof _AttrValueIsUnsafeToIntersect; declare const _AttrValueIsUnsafeToIntersect: unique symbol; declare type CarefullyIntersectNodes = L extends null ? R : R extends null ? L : Extract; declare type Cartesian = Dnfs extends [infer First, ...infer Rest] ? First extends { args: any[]; } ? CartesianSemiInner> : never : [[]]; declare type CartesianInner = Args extends [infer First, ...infer Rest] ? First extends any[] ? CartesianInner : never : Acc; declare type CartesianSemiInner = FArgs extends [ infer First, ...infer Rest ] ? First extends { args: any[]; } ? CartesianSemiInner ]> : never : Acc; declare type CheckMetaField = T extends `${string}.${string}` ? If : Else; declare type CollapseChildRelations = Right extends [infer First, ...infer Rest] ? First extends { args: any[]; } ? CollapseChildRelations, AST> ]> : never : Acc[number]; declare type CollapseNegativesFromConjunction = Negatives extends [infer First, ...infer Rest] ? First extends MetaAcc ? CollapseNegativesFromConjunction, Exclude, First['extract']>, First['exclude']>>>> : never : Acc; declare type CollapsePositivesFromConjunction> = Positives extends [infer First, ...infer Rest] ? First extends MetaAcc ? CollapsePositivesFromConjunction : PrecollapseCollectChildBoundaries, unknown extends First['extract'] ? Exclude, First['extract']>, First['exclude']> : Exclude, PreprocessExtract['extract']>, First['exclude']>, PreprocessExtract['exclude']>>, First['inferredNodes'] extends null ? any : First['inferredNodes']>>> : never : Acc; declare type ConjunctionDnf = unknown & { type: 'or'; args: WrapCartesian>>; }; declare type DisjunctionDnf = IsDisjunctionDnf extends true ? T : { type: 'or'; args: DnfArgs; }; declare type Dnf = T extends MetaAcc ? { type: 'or'; args: [ { type: 'and'; args: [T]; } ]; } : T extends { type: 'or'; args: any[]; } ? DisjunctionDnf : T extends { type: 'and'; args: any[]; } ? ConjunctionDnf : T extends { type: 'not'; arg: any; } ? NotDnf : never; declare type DnfArgs = Args extends [infer First, ...infer Rest] ? DnfArgs extends infer Res ? Res extends { args: any[]; } ? Flat extends true ? Res extends [...any[]] ? [...Acc, ...FlatWithArgs] : [...Acc, ...Res['args']] : [...Acc, Res] : never : never> : Acc; declare enum EndOfSelectorsList { None = 0, ClosingParen = 1 } declare type Equal = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? true : false; declare type EveryArgIsDnf = Args extends [infer First, ...infer Rest] ? First extends MetaAcc ? IsVariableDnf : First extends { type: 'and'; args: any[]; } ? IsConjunctionDnf extends true ? EveryArgIsDnf : false : First extends { type: 'or'; args: any[]; } ? IsDisjunctionDnf extends true ? EveryArgIsDnf : false : First extends { type: 'not'; arg: any; } ? IsNotDnf extends true ? EveryArgIsDnf : false : never : true; declare type ExtractChildDeps = NonNullable<{ [K in keyof T]: K extends 'parent' ? never : FilterNodes; }[keyof T]>; declare type FilterNodes = NonNullable extends infer NonNullableT ? NonNullableT extends { type: AST['type']; } ? NonNullableT : NonNullableT extends [...infer Elements] ? NonNullable extends { type: AST['type']; } ? NonNullable : never : never : never; declare type FilterTuple = T extends [ infer First, ...infer Rest ] ? First extends false ? FilterTuple : FilterTuple : Acc; declare type FlatWithArgs = T extends [ infer First, ...infer Rest ] ? First extends { args: any[]; } ? FlatWithArgs : never : never; declare type GenParseAttrRes = ParseRes extends string ? `parseAttrErr-${ParseRes}` : ParseRes extends { res: infer ParseResRes; rest: infer ParseResRest; } ? ParseAttrName extends infer AttrNameParseRes ? AttrNameParseRes extends string ? `genParseAttrResErr-${AttrNameParseRes}` : Simplify : never : never; declare type IdentifierNameRestrictedSymbols = ' ' | '[' | ']' | ',' | '(' | ')' | ':' | '#' | '!' | '=' | '>' | '<' | '~' | '+' | '.'; declare type IdentifierNameRestrictedSymbolsWithDot = Exclude; declare type IfString = T extends string ? U : T; declare type IntersectAndSimplify = unknown extends L ? R : unknown extends R ? L : Simplify; declare type IsConjunctionDnf = Depth extends 1 ? EveryArgIsDnf : false; declare type IsDisjunctionDnf = Depth extends 0 ? EveryArgIsDnf : false; declare type IsNotDnf = Depth extends 2 ? EveryArgIsDnf<[T['arg']], 3> : false; declare type IsVariableDnf = Depth extends 0 ? false : Depth extends 1 ? false : true; declare type LeftIsAny = typeof _LeftIsAny; declare const _LeftIsAny: unique symbol; export declare type Match = MatchIt; declare type MatchIt = CollapseChildRelations> extends infer Res ? Res extends { args: any[]; } ? Res['args'] : never : never, AST>; declare type MatchSplittedConjunction = Extract, CollapseNegativesFromConjunction>; declare type MergeTwoMetaFields = L extends null ? CheckMetaField : R extends null ? CheckMetaField : CheckMetaField, CheckMetaField extends true ? L : NeverError<`different fields: ${L}, ${R}`>>>; declare type MergeTwoMetaIdentifiers = L extends null ? R : R extends null ? L : Equal extends true ? L : NeverError<`different identifiers: ${L}, ${R}`>; declare type MergeTwoMetas = MergeTwoMetaIdentifiers extends infer MergedIdentifiers ? MergedIdentifiers extends NeverError ? NeverError : MergeTwoMetaFields extends infer MergedFields ? MergedFields extends NeverError ? NeverError : { identifier: MergedIdentifiers; field: MergedFields; extract: IntersectAndSimplify; exclude: L['exclude'] | R['exclude']; inferredNodes: CarefullyIntersectNodes; } : NeverError : NeverError; declare interface MetaAcc { identifier: string | null; field: string | null; extract: any; exclude: any; inferredNodes: any | null; } declare type NegatedArgs = Args extends [ infer First, ...infer Rest ] ? NegatedArgs : Acc; declare type NegatedDnf = T extends { type: 'or'; args: any[]; } ? Dnf<{ type: 'and'; args: NegatedArgs; }> : T extends { type: 'and'; args: any[]; } ? Dnf<{ type: 'or'; args: NegatedArgs; }> : T extends { type: 'not'; arg: any; } ? Dnf : never; declare type NeverError = [typeof NeverErrorSymbol, Message]; declare const NeverErrorSymbol: unique symbol; declare type NotDnf = IsNotDnf extends true ? { type: 'or'; args: [ { type: 'and'; args: [T]; } ]; } : NegatedDnf; export declare type Parse = ParseIt; declare type ParseAtom = ParseWildcard extends infer WildcardParseRes ? WildcardParseRes extends string ? ParseIdentifier extends infer IdentifierParseRes ? IdentifierParseRes extends string ? ParseAttr extends infer AttrParseRes ? AttrParseRes extends string ? ParseField extends infer FieldParseRes ? FieldParseRes extends string ? ParseNegation extends infer NegationParseRes ? NegationParseRes extends string ? ParseMatches extends infer MatchesParseRes ? MatchesParseRes extends string ? ParseHas extends infer HasParseRes ? HasParseRes extends string ? ParseClass extends infer ClassParseRes ? ClassParseRes extends string ? 'super next Stub (unimplemented)' : ClassParseRes : never : HasParseRes : never : MatchesParseRes : never : NegationParseRes : never : FieldParseRes : never : AttrParseRes : never : IdentifierParseRes : never : WildcardParseRes : never; declare type ParseAttr = T extends `[${infer Rest}` ? SplitToClosingSquareBracketOrEqualSignOrAngleBracket extends infer SplitRes ? SplitRes extends string ? `attrParseErr-split-${SplitRes}` : SplitRes extends [infer AttrName, infer AfterAttrName] ? AttrName extends string ? AfterAttrName extends string ? ParseAttrImpl : never : never : never : never : 'attrParseErr-cantFindOpeningSquareBracket'; declare type ParseAttrImpl = _AfterAttrName extends `=${infer AfterAttrName}` ? TrimSpacesLeft extends infer TrimmedAfterAttrName ? TrimmedAfterAttrName extends string ? AttrName extends `${infer RawAttrName}<` ? GenParseAttrRes=', ParseAttrValueForOps> : AttrName extends `${infer RawAttrName}!` ? IfString>, GenParseAttrRes> : never : never : _AfterAttrName extends `>${infer AfterAttrName}` ? TrimSpacesLeft extends infer TrimmedAfterAttrName ? TrimmedAfterAttrName extends string ? GenParseAttrRes', ParseAttrValueForOps> : never : never : _AfterAttrName extends `]${infer Rest}` ? ParseAttrName extends infer AttrNameParseRes ? AttrNameParseRes extends string ? `attrParseErr-${AttrNameParseRes}` : Simplify : never : 'attrParseErr-wrongAttr'; declare type ParseAttrName = RawAttrName extends string ? ParseIdentifierName, IdentifierNameRestrictedSymbolsWithDot> extends infer AttrNameParseRes ? AttrNameParseRes extends string ? `genParseAttrResErr-${AttrNameParseRes}` : AttrNameParseRes extends { value: infer AttrNameParseResValue; rest: infer AttrNameParseResRest; } ? AttrNameParseResRest extends '' ? { type: 'attribute'; name: AttrNameParseResValue; } : 'genParseAttrResErr-wrongAttrName' : never : never : never; declare type ParseAttrValueForEqOps = PostProcessAttrValueWithRest, AttrValue extends `${infer FullAttrValue}]${infer Rest}` ? TrimSpaces extends infer TrimmedFullAttrValue ? TrimmedFullAttrValue extends string ? ParseTypeAttrValue extends infer TypeParseRes ? TypeParseRes extends string ? 'parseAttrValueForEqOpsErr-doesntMatch' : { res: TypeParseRes; rest: Rest; } : never : never : never : 'parseAttrValueForOpsErr-unterminatedAttrSquareBracket'>; declare type ParseAttrValueForOps = PostProcessAttrValueWithRest, AttrValue extends `${infer FullAttrValue}]${infer Rest}` ? TrimSpaces extends infer TrimmedFullAttrValue ? TrimmedFullAttrValue extends string ? ParseNumberAttrValue extends infer NumberParseRes ? NumberParseRes extends string ? ParsePathAttrValue extends infer PathParseRes ? PathParseRes extends string ? 'parseAttrValueForOpsErr-doesntMatch' : { res: PathParseRes; rest: Rest; } : never : { res: NumberParseRes; rest: Rest; } : never : never : never : 'parseAttrValueForOpsErr-unterminatedAttrSquareBracket'>; declare type ParseBinaryOp = TrimSpacesLeft extends infer Op ? Op extends `>${infer Rest}` ? { op: 'child'; rest: Rest; } : Op extends `~${infer Rest}` ? { op: 'sibling'; rest: Rest; } : Op extends `+${infer Rest}` ? { op: 'adjacent'; rest: Rest; } : T extends ` ${infer Rest}` ? { op: 'descendant'; rest: Rest; } : 'unknownBinaryOp' : never; declare type ParseClass = T extends `:${infer Class}` ? ParseIdentifierName extends infer IdentifierNameParseRes ? IdentifierNameParseRes extends 'identifierNameEmpty' ? 'classErr-identifierNameNope' : IdentifierNameParseRes extends { value: infer IdentifierNameParseResValue; rest: infer IdentifierNameParseResRest; } ? { type: 'class'; name: IdentifierNameParseResValue; rest: IdentifierNameParseResRest; } : never : 'field stub' : 'not class'; declare type ParseField = T extends `.${infer Rest}` ? ParseIdentifierName extends infer IdentifierNameParseRes ? IdentifierNameParseRes extends 'identifierNameEmpty' ? 'fieldErr-identifierNameNope' : IdentifierNameParseRes extends { value: infer IdentifierNameParseResValue; rest: infer IdentifierNameParseResRest; } ? { type: 'field'; name: IdentifierNameParseResValue; rest: IdentifierNameParseResRest; } : never : 'field stub' : 'field not starts with dot'; declare type ParseHas = ParsePseudoClass; declare type ParseIdentifier = T extends `#${infer Rest}` ? ParseIdentifierInternal : ParseIdentifierInternal; declare type ParseIdentifierInternal = ParseIdentifierName extends infer ParseRes ? ParseRes extends { value: infer V; rest: infer R; } ? { type: 'identifier'; value: V; rest: R; } : ParseRes extends 'identifierNameEmpty' ? 'identifierEmpty' : 'identifier-unhandled' : never; declare type ParseIdentifierName = T extends '' ? Acc extends '' ? 'identifierNameEmpty' : { value: Acc; rest: T; } : T extends `${infer First}${infer Rest}` ? First extends RestrictedChars ? Acc extends '' ? 'identifierNameEmpty' : { value: Acc; rest: T; } : ParseIdentifierName : never; declare type ParseIt = ParseSelectors> extends infer SelectorsParseRes ? SelectorsParseRes extends string ? SelectorsParseRes : SelectorsParseRes extends { selectors: infer Selectors; } ? Selectors extends [infer First, ...infer Rest] ? Rest[0] extends undefined ? First : { type: 'matches'; selectors: [First, ...Rest]; } : never : never : never; declare type ParseMatches = ParsePseudoClass; declare type ParseNegation = ParsePseudoClass; declare type ParseNumberAttrValue = T extends `${infer N extends number}` ? { type: 'literal'; value: N; } : 'arrValueNumberErr'; declare type ParsePathAttrValue = ParseIdentifierName extends infer Res ? Res extends string ? `pathParseErr-${Res}` : Res extends { value: infer ResValue; rest: infer ResRest; } ? ResRest extends '' ? { type: 'literal'; value: ResValue; } : `pathParseErr-hasSomeRest` : never : never; declare type ParsePseudoClass = T extends `:${PseudoClassName}(${infer Rest}` ? { type: PseudoClassName; } & ParseSelectors, [ ], EndOfSelectorsList.ClosingParen> extends infer SelectorsParseRes ? SelectorsParseRes : never : `is not ${PseudoClassName} pseudo class`; declare type ParseRegexAttrValue = ParseRegexAttrValueImpl extends infer Res ? Res extends string ? Res : Res extends { res: infer ResRes; rest: infer Rest; } ? { type: 'regexp'; value: ResRes; rest: Rest; } : never : never; declare type ParseRegexAttrValueFlags = T extends '' ? 'regexEmptyFlags' : T extends `${infer First}${infer Rest}` ? First extends AllowedRegexAttrValueFlag ? Rest extends '' ? { acc: First; res: First; rest: ''; } : ParseRegexAttrValueFlags extends infer NestedRes ? NestedRes extends string ? NestedRes : NestedRes extends { acc: infer NestedResAcc; res: infer NestedResRes; rest: infer NestedResRest; } ? First extends NestedResAcc ? `regexDuplicatedFlag-${First}` : NestedResRes extends string ? { acc: First | NestedResAcc; res: `${First}${NestedResRes}`; rest: NestedResRest; } : never : never : never : { acc: never; res: ''; rest: T; } : never; declare type ParseRegexAttrValueImpl = T extends `/${infer Inner}/${infer Rest}` ? ParseRegexAttrValueFlags extends infer ParsedFlags ? ParsedFlags extends string ? ParsedFlags extends 'regexEmptyFlags' ? { res: `/${Inner}/`; rest: Rest; } : `regexErrInFlags-${ParsedFlags}` : ParsedFlags extends { res: infer ParsedFlagsRes; rest: infer ParsedFlagsRest; } ? ParsedFlagsRes extends string ? { res: `/${Inner}/${ParsedFlagsRes}`; rest: ParsedFlagsRest; } : never : never : never : 'regexParseErr-doesntMatch'; declare type ParseSelector = ParseSequence extends infer SeqParseRes ? SeqParseRes extends string ? `sequenceErr-SeqParseFailed-${SeqParseRes}` : SeqParseRes extends { rest: infer Rest; } ? Rest extends string ? Rest extends '' ? SimplifySeq : ParseSelectorRequrser> : never : never : never; declare type ParseSelectorRequrser = ParseBinaryOp extends infer BinaryOpParseRes ? BinaryOpParseRes extends string ? { error: `recursersequenceErr-atomParseFailed-${BinaryOpParseRes}`; acc: Acc; rest: T; } : BinaryOpParseRes extends { op: infer Op; rest: infer BinaryOpParseResRest; } ? BinaryOpParseResRest extends string ? ParseSequence> extends infer SeqParseRes ? SeqParseRes extends string | never ? { error: `recursersequenceErr-SeqParseFailed-${SeqParseRes}`; acc: Acc; rest: T; } : SeqParseRes extends { selectors: infer Selectors; rest: infer Rest; } ? Selectors extends [infer _, ...infer __] ? Rest extends '' ? { type: Op; left: Acc; right: SimplifySeq; } : Rest extends string ? ParseSelectorRequrser; }> : never : { error: `recursersequenceErr-SeqParseFailed-${'todo'}`; acc: Acc; rest: BinaryOpParseResRest; } : 'here Stub' : never : never : never : never; declare type ParseSelectors = ParseSelector extends infer SelectorParseRes ? SelectorParseRes extends { error: unknown; acc: infer SelectorAcc; rest: infer Rest; } ? Rest extends string ? _ParseSelectorsTrimCommaAtStart extends infer RestWithoutComma ? RestWithoutComma extends string ? Eosl extends EndOfSelectorsList.None ? `${Rest}-nanoStub-${RestWithoutComma}` : Eosl extends EndOfSelectorsList.ClosingParen ? TrimSpacesLeft extends infer R ? R extends `)${infer RestRest}` ? { selectors: [...Acc, SelectorAcc]; rest: RestRest; } : `commaErr-${T}` : never : never : RestWithoutComma extends { res: infer RestWithoutCommaRes; } ? RestWithoutCommaRes extends string ? ParseSelectors : never : never : never : never : SelectorParseRes extends { rest: infer Rest; } ? { selectors: [...Acc, Simplify>]; rest: Rest; } : { selectors: [...Acc, Simplify>]; rest: ''; } : never; declare type _ParseSelectorsTrimCommaAtStart = TrimSpacesLeft extends infer R ? R extends `,${infer Rest}` ? { res: TrimSpacesLeft; } : `commaErr-${T}` : never; declare type ParseSequence = ParseAtom extends infer AtomParseRes ? AtomParseRes extends string ? { selectors: Acc; rest: T; } : AtomParseRes extends { rest: infer Rest; } ? Rest extends string ? ParseSequence>]> : never : never : never; declare type ParseStringAttrValue = T extends `"${infer Rest}` ? ParseStringAttrValueImpl : T extends `'${infer Rest}` ? ParseStringAttrValueImpl : 'stringParseErr-itDoesntStartWithQuotes'; declare type ParseStringAttrValueImpl = ParseStringAttrValueRecurser extends infer Res ? Res extends string ? `stringParseErr-${Res}` : Res extends { res: infer ResRes; rest: infer ResRest; } ? ResRes extends string ? { type: 'literal'; value: Replace; rest: ResRest; } : never : never : never; declare type ParseStringAttrValueRecurser = T extends `${infer BeforeQuote}${Q}${infer Rest}` ? BeforeQuote extends `${string}\\` ? ParseStringAttrValueRecurser extends infer Res ? Res extends string ? 'unterminatedString' : Res extends { res: infer ResRes; rest: infer ResRest; } ? ResRes extends string ? { res: `${BeforeQuote}${Q}${ResRes}`; rest: ResRest; } : never : never : never : { res: BeforeQuote; rest: Rest; } : 'no'; declare type ParseTypeAttrValue = T extends `type(${infer Inner})${infer Rest}` ? Rest extends '' ? TrimSpaces extends infer TrimmedInner ? TrimmedInner extends '' ? 'typeParseErr-emptyType' : { type: 'type'; value: TrimmedInner; } : never : 'attrValueTypeErr-somethingAfterClosingParen' : 'attrValueTypeErr-doesntMatch'; declare type ParseWildcard = T extends `*${infer Rest}` ? { type: 'wildcard'; value: '*'; rest: Rest; } : 'wildcardnope'; declare type PartitionBy = Tuple extends [infer First, ...infer Rest] ? Rest extends [string, string][] ? First extends [infer PairFirst, infer PairLast] ? PairFirst extends string ? PairLast extends string ? PairFirst extends `${CompareTo}${string}` ? PartitionBy : PartitionBy : never : never : never : never : [LeftAcc, RightAcc]; declare type PatchMeta = MergeTwoMetas extends infer Res ? Res extends MetaAcc ? Res : never : never>; declare type PickNode = [T] extends [any] ? Extract : never; declare type PostProcessAttrValueWithRest = V extends infer ParseRes ? ParseRes extends string ? Next : ParseRes extends { rest: infer Rest; } ? Rest extends string ? TrimSpacesLeft extends `]${infer RestRest}` ? { res: Simplify>; rest: RestRest; } : 'attrParseErr-unterminatedAttrSquareBracket' : never : never : never; declare type PrecollapseCollectChildBoundaries = Ctx['field'] extends null ? ExtractChildDeps : FilterNodes[Ctx['field']], AST>; declare type PrepreprocessCompoundSelector = Selectors extends [infer Selector, ...infer Rest] ? Selector extends { type: 'matches'; } ? PrepreprocessCompoundSelector> : Selector extends { type: 'not'; } ? PrepreprocessCompoundSelector> : PrepreprocessCompoundSelector> : PreprocessCompoundSelector<[ ...(Acc['matches'] extends [infer _, ...infer __] ? [ { type: 'matches'; selectors: [{ type: 'compound'; selectors: Acc['selectors']; }]; } ] : Acc['nots'] extends [infer _, ...infer __] ? [ { type: 'matches'; selectors: [{ type: 'compound'; selectors: Acc['selectors']; }]; } ] : Acc['selectors']), ...Acc['matches'], ...Acc['nots'] ], SelectorAcc, AST>; declare type PreprocessCompoundSelector = Selectors extends [infer Selector, ...infer Rest] ? Selector extends { type: 'wildcard'; } | { type: 'class'; } | { type: 'has'; } ? PreprocessCompoundSelector : Selector extends { type: 'identifier'; value: any; } ? PatchMeta extends infer PatchRes ? PatchRes extends MetaAcc ? PreprocessCompoundSelector : NeverError : never : Selector extends { type: 'attribute'; name: any; } ? Selector['name'] extends `${string}.${string}` ? PreprocessCompoundSelector : Selector extends { operator: any; value: any; } ? Selector['value'] extends { type: 'literal'; value: any; } ? Selector['operator'] extends '=' ? TryToParseAttrValue extends infer AttrValue ? AttrValue extends AttrValueIsUnsafeToIntersect ? PreprocessCompoundSelector : PatchMeta extends infer PatchRes ? PatchRes extends MetaAcc ? PreprocessCompoundSelector : NeverError : never : never : Selector['operator'] extends '!=' ? TryToParseAttrValue extends infer AttrValue ? AttrValue extends AttrValueIsUnsafeToIntersect ? PreprocessCompoundSelector : PatchMeta extends infer PatchRes ? PatchRes extends MetaAcc ? PreprocessCompoundSelector : NeverError : never : never : PreprocessCompoundSelector : PreprocessCompoundSelector : PatchMeta extends infer PatchRes ? PatchRes extends MetaAcc ? PreprocessCompoundSelector : NeverError : never : Selector extends { type: 'field'; name: any; } ? PatchMeta extends infer PatchRes ? PatchRes extends MetaAcc ? PreprocessCompoundSelector : NeverError : never : PreprocessCompoundSelector ]> : Acc extends any[] ? Acc : [SelectorAcc]; declare type PreprocessExtract = { extract: { [K in keyof T]: T[K] extends boolean ? boolean : T[K]; }; exclude: { [K in keyof T]: T[K] extends boolean ? T[K] extends true ? false : true : never; }; }; declare type PreprocessSelector = T extends { type: 'sibling'; } | { type: 'adjacent'; } | { type: 'descendant'; } ? T extends { right: any; } ? PreprocessSelector : never : T extends { type: 'wildcard'; } | { type: 'identifier'; } | { type: 'attribute'; } | { type: 'field'; } | { type: 'class'; } | { type: 'has'; } ? PreprocessSelector<{ type: 'compound'; selectors: [T]; }, SelectorAcc, AST> : T extends { type: 'compound'; selectors: any; } ? { type: 'and'; args: PrepreprocessCompoundSelector; } : T extends { type: 'child'; left: any; right: any; } ? CollapseChildRelations, Dnf> extends infer Res ? Res extends { args: any[]; } ? Res['args'] : never : never, AST> extends infer InferredNodes ? [InferredNodes] extends [never] ? never : { identifier: null; field: null; extract: unknown; exclude: never; inferredNodes: InferredNodes; } : never : T extends { type: 'matches'; selectors: any; } ? PreprocessSelectorsList : T extends { type: 'not'; selectors: any; } ? { type: 'and'; args: [ { type: 'not'; arg: { type: 'not'; arg: SelectorAcc; }; }, { type: 'not'; arg: PreprocessSelectorsList; } ]; } : NeverError<'not impleeemented'>; declare type PreprocessSelectorsList = Selectors extends [infer Selector, ...infer Rest] ? PreprocessSelectorsList ]> : { type: 'or'; args: Acc; }; export declare type Query = Match, AST>; declare type Replace = T extends `${infer Before}${From}${infer After}` ? Replace<`${Before}${To}${After}`, From, To> : T; declare type Simplify = { [K in keyof T]: T[K]; } & {}; declare type SimplifySeq = S extends { selectors: infer Selectors; } ? Selectors extends [infer First, ...infer Rest] ? Rest[0] extends undefined ? First : { type: 'compound'; selectors: [First, ...Rest]; } : never : never; declare type SortPairsByShortestTemplateLiteral = Pairs extends [infer Head, ...infer Tail] ? Tail extends [string, string][] ? Head extends [infer HeadFirst, infer _] ? HeadFirst extends string ? PartitionBy extends [infer Left, infer Right] ? Left extends [string, string][] ? Right extends [string, string][] ? [ ...SortPairsByShortestTemplateLiteral, Head, ...SortPairsByShortestTemplateLiteral ] : never : never : never : never : never : never : []; declare type SplitConjunction = T extends [infer First, ...infer Rest] ? First extends { type: 'not'; arg: MetaAcc; } ? SplitConjunction> : First extends MetaAcc ? SplitConjunction> : never : Simplify; declare type SplitToClosingSquareBracketOrEqualSignOrAngleBracket = SortPairsByShortestTemplateLiteral'>, TryToSplitByAngleBracket, TryToSplitBy ]>> extends [infer First, ...infer _] ? First : 'cant find splitter'; declare type Trim = T extends `${R}${infer Rest}${R}` ? Trim : T extends `${R}${infer Rest}` ? TrimLeft : T extends `${infer Rest}${R}` ? TrimRight : T; declare type TrimLeft = T extends `${R}${infer Rest}` ? TrimLeft : T; declare type TrimRight = T extends `${infer Rest}${R}` ? TrimRight : T; declare type TrimSpaces = Trim; declare type TrimSpacesLeft = TrimLeft; declare type TryToNarrowByExtracting = Extract extends never ? Extract : Extract; declare type TryToParseAttrValue = T extends 'true' ? true : T extends 'false' ? false : T extends 'null' ? null : T extends 'undefined' ? undefined : AttrValueIsUnsafeToIntersect; declare type TryToSplitBy = T extends `${infer Before}${S}${infer After}` ? [Before, `${S}${After}`] : false; declare type TryToSplitByAngleBracket' | '<'> = T extends `${infer Before}${S}${infer After}` ? After extends `=${string}` ? [`${Before}${S}`, After] : [Before, `${S}${After}`] : false; declare type WildcardMeta = { identifier: null; field: null; extract: unknown; exclude: never; inferredNodes: null; }; declare type WrapCartesian = C extends [ infer First, ...infer Rest ] ? WrapCartesian : Acc; export { }