/** */ import { BatchOp, Level } from './level'; import type { Collection } from '@tinacms/schema-tools'; export declare enum OP { EQ = "eq", GT = "gt", LT = "lt", GTE = "gte", LTE = "lte", STARTS_WITH = "startsWith", IN = "in" } export type BinaryFilter = { pathExpression: string; rightOperand: FilterOperand; operator: OP.EQ | OP.GT | OP.LT | OP.GTE | OP.LTE | OP.STARTS_WITH | OP.IN; type: string; pad?: PadDefinition; list: boolean; }; export type TernaryFilter = { pathExpression: string; leftOperand: FilterOperand; rightOperand: FilterOperand; leftOperator: OP.GTE | OP.GT; rightOperator: OP.LT | OP.LTE; type: string; pad?: PadDefinition; list: boolean; }; export type IndexDefinition = { fields: { name: string; type?: string; pad?: PadDefinition; list: boolean; }[]; }; export type PadDefinition = { fillString: string; maxLength: number; }; export type FilterOperand = string | number | boolean | string[] | number[]; export type FilterCondition = { filterExpression: Record; filterPath: string; }; type StringEscaper = (input: T) => T; export declare const DEFAULT_COLLECTION_SORT_KEY = "__filepath__"; export declare const REFS_COLLECTIONS_SORT_KEY = "__refs__"; export declare const REFS_REFERENCE_FIELD = "__tina_ref__"; export declare const REFS_PATH_FIELD = "__tina_ref_path__"; export declare const DEFAULT_NUMERIC_LPAD = 4; export declare const coerceFilterChainOperands: (filterChain: (BinaryFilter | TernaryFilter)[], escapeString?: StringEscaper) => (BinaryFilter | TernaryFilter)[]; export declare const makeFilter: ({ filterChain, }: { filterChain?: (BinaryFilter | TernaryFilter)[]; }) => ((values: Record) => boolean); export declare const makeFilterChain: ({ conditions, }: { conditions: FilterCondition[]; }) => (BinaryFilter | TernaryFilter)[]; export declare const makeFilterSuffixes: (filterChain: (BinaryFilter | TernaryFilter)[], index: IndexDefinition) => { left?: string; right?: string; } | undefined; export declare const FOLDER_ROOT = "~"; type FolderTree = Record>; export declare class FolderTreeBuilder { _tree: FolderTree; constructor(); get tree(): FolderTree; update(documentPath: string, collectionPath: string): any; } export declare const makeFolderOpsForCollection: (folderTree: FolderTree, collection: Collection, indexDefinitions: Record, opType: "put" | "del", level: Level, escapeStr?: StringEscaper) => BatchOp[]; export declare const makeIndexOpsForDocument: (filepath: string, collection: string | undefined, indexDefinitions: Record, data: T, opType: "put" | "del", level: Level, escapeStr?: StringEscaper) => BatchOp[]; export declare const makeRefOpsForDocument: (filepath: string, collection: string | undefined, references: Record | undefined | null, data: T, opType: "put" | "del", level: Level) => BatchOp[]; export declare const makeStringEscaper: (regex: RegExp, replacement: string) => StringEscaper; export declare const stringEscaper: StringEscaper; export {};