import * as nt from 'noodl-types'; import NuiViewport from './Viewport'; import type { NormalizePropsContext } from './types'; export interface ParseOptions = Record> { /** * Any data needed to render/parse components */ context?: NormalizePropsContext; /** * If true, styles like fontSize will be converted to vw or vh if given the format */ keepVpUnit?: boolean; /** * A custom function called when resolving traversal references (ex: ___.viewTag). * * When resolving traversal referencies, if no function is provided then undefined will be returned */ getParent?: (opts: { props: Record; blueprint: Partial; context: NormalizePropsContext; op?: 'traverse' | undefined; opArgs?: Record; }) => any; getHelpers?: (opts?: Record) => { props: Record; getParent?: any; blueprint: Partial | nt.ReferenceString; context: NormalizePropsContext; root: Record | (() => Record); rootKey: string; }; /** * Current page. If retrieving local root references, it will use this variable * as the local root key */ pageName?: string; /** * The root object or a function that returns the root object. This will * be used to cross-reference other page objects if needed */ root?: Record | (() => Record); /** * A viewport containing the width/height. * This will be used to resolve the positioning/sizes of component styles */ viewport?: NuiViewport | { width: number; height: number; }; assign?: (obj: any, ...rest: any[]) => any; entries?: typeof Object.entries; isArr?: (v: any) => boolean; isObj?: (obj: any) => boolean; isNil?: (v: any) => boolean; isNum?: (v: any) => boolean; isStr?: (str: any) => boolean; isUnd?: (v: any) => boolean; toArr?: (v: any) => any; get?: (component: C, key: any, initialValue?: any) => any; set?: (obj: any, key: string | number, value: any) => void; unset?: (obj: any, key: string | number) => void; getAssetsUrl?: Function; } /** * * Normalizes + parses a component object for browsers to consume * @example * ```js const componentObject = { style: { shadow: 'true' } } const normalized = { style: { boxShadow: '5px 5px 10px 3px rgba(0, 0, 0, 0.015)' } } ``` */ declare function parse = Record>(blueprint: Partial, parseOptions: ParseOptions): any; declare function parse = Record>(props: Record, blueprint: Partial, parseOptions: ParseOptions): any; export default parse;