import type { DeepReadonly, JsonSchema, PrimaryKey, RxDocumentData, RxJsonSchema, RxStorageDefaultCheckpoint, StringKeys } from './types/index.d.ts'; import type { RxSchema } from './rx-schema.ts'; /** * Helper function to create a valid RxJsonSchema * with a given version. */ export declare function getPseudoSchemaForVersion(version: number, primaryKey: StringKeys): RxJsonSchema>; /** * Returns the sub-schema for a given path. * Results are cached per schema reference and path * to avoid redundant string operations and property lookups. */ export declare function getSchemaByObjectPath(rxJsonSchema: RxJsonSchema, path: keyof T | string): JsonSchema; export declare function fillPrimaryKey(primaryPath: keyof T, jsonSchema: RxJsonSchema, documentData: RxDocumentData): RxDocumentData; export declare function getPrimaryFieldOfPrimaryKey(primaryKey: PrimaryKey): StringKeys; export declare function getLengthOfPrimaryKey(schema: RxJsonSchema>): number; /** * Returns the composed primaryKey of a document by its data. */ export declare function getComposedPrimaryKeyOfDocumentData(jsonSchema: RxJsonSchema | RxJsonSchema>, documentData: Partial): string; /** * Normalize the RxJsonSchema. * We need this to ensure everything is set up properly * and we have the same hash on schemas that represent the same value but * have different json. * * - Orders the schemas attributes by alphabetical order * - Adds the primaryKey to all indexes that do not contain the primaryKey * - We need this for deterministic sort order on all queries, which is required for event-reduce to work. * * @return RxJsonSchema - ordered and filled */ export declare function normalizeRxJsonSchema(jsonSchema: RxJsonSchema): RxJsonSchema; /** * If the schema does not specify any index, * we add this index so we at least can run RxQuery() * and only select non-deleted fields. */ export declare function getDefaultIndex(primaryPath: string): string[]; /** * fills the schema-json with default-settings * @return cloned schemaObj */ export declare function fillWithDefaultSettings(schemaObj: RxJsonSchema): RxJsonSchema>; export declare const META_LWT_UNIX_TIME_MAX = 1000000000000000; export declare const RX_META_SCHEMA: JsonSchema; /** * returns the final-fields of the schema * @return field-names of the final-fields */ export declare function getFinalFields(jsonSchema: RxJsonSchema): string[]; /** * fills all unset fields with default-values if set * @hotPath */ export declare function fillObjectWithDefaults(rxSchema: RxSchema, obj: any): any; export declare const DEFAULT_CHECKPOINT_SCHEMA: DeepReadonly>;