import { Document, Pair, Scalar, YAMLMap } from 'yaml'; import { LocalizationBaseConfig, LocalizationConfig, TypeLocalizationConfig } from '../config'; import { TypeKind } from '../config/type'; export declare function describeTypeKind(kind: TypeKind): "an enum type" | "a scalar type" | "a root entity type" | "a child entity type" | "an entity extension type" | "a value object type"; export declare function getYamlNodePairAtPath(source: string | Document, path: unknown[] | ReadonlyArray): Pair> | null; export declare function getYamlNodePairAtPathOrThrow(source: string | Document, path: unknown[] | ReadonlyArray): Pair>; export declare function getYamlMapAtPath(source: string | Document, path: unknown[]): YAMLMap | undefined; /** * Helper function that transfers the `commentBefore` from the parent map to the target node if existing. * This is a workaround for the fact that `yaml` library attaches the `commentBefore` of the first pair * in a map to the map itself and not to the pair's key. * * @returns The original node if nothing needed to be patched, otherwise a clone of the original node with the patched comment. */ export declare function patchBeforeCommentFromParentMap(doc: Document, targetNode: Pair, path: unknown[] | ReadonlyArray): Pair; export declare function safeParseDocument(str: string): Document | null; /** * Finds the first config (per language) that declares at least one global field localization */ export declare function getFirstMatchingGlobalFieldConfigs(configs: ReadonlyArray): Record; /** * Returns the raw localization configs for the given type, if existing. */ export declare function getTypeLocalizationConfigs(configs: ReadonlyArray, typeName: string): Record; /** * Returns the raw localization configs for the field under the given type, if existing. * * This function can be used when non-merged (i.e. not containing global localization) localizations are needed. */ export declare function getFieldLocalizationConfigs(configs: ReadonlyArray, typeName: string, fieldName: string): Record; /** * Returns the raw global localization configs for a given field name, if existing. * * This function can be used when non-merged (i.e. not containing type dependent localizations are needed. */ export declare function getGlobalFieldLocalizationConfigs(configs: ReadonlyArray, fieldName: string): Record;