UNPKG

@normalized-db/normalizer

Version:

Normalize and restore `JavaScript` objects based on a simple schema.

11 lines (10 loc) 845 B
import type { KeyTypes, ObjectKey, SchemaStructure } from '../types/normalizer-config-types'; import type { Depth, NormalizedDataTree, PreloadEntities, Schema } from '../types/normalizer-types'; export declare namespace Ndb { function findEntityKeys<DataTypes extends SchemaStructure, EntityType extends keyof DataTypes, KeyPath extends ObjectKey<DataTypes[EntityType], KeyTypes>, Key extends DataTypes[EntityType][KeyPath]>(schema: Schema<DataTypes>, tree: NormalizedDataTree<DataTypes>, rootType: EntityType, { keys: rootKeys, depth: rootDepth }?: { keys?: Key | Key[]; depth?: Depth<DataTypes[EntityType]>; }): PreloadEntities<DataTypes>; function nextDepth<T = any>(depth: Depth<T> | undefined, nestedProperty: keyof T): Depth<T> | undefined; function isDone<T = any>(depth: Depth<T> | undefined): boolean; }