import { ModuleFilePath, ModulePath, SourcePath } from "@valbuild/core"; /** * The one way to build a child's source path. * * There were five hand-rolled versions of this, three of them subtly different * and two of them wrong, and the wrong ones were wrong in a way that hid: a * module path segment has to be JSON-quoted if it is a string and bare if it is * an array index, and both broken copies appended the raw key at the module * root. An unquoted key parses fine as long as it contains no `.` — so every * object field and every ordinary record key still resolved, and only a key with * a dot in it broke. That is exactly what a media gallery is keyed by, so * clicking a file in the Media panel navigated to * `?p=/public/val/red-8x8_bfbd0.png`, which `splitModulePath` reads as the two * segments `/public/val/red-8x8_bfbd0` and `png`, and the studio said the module * was not found. * * So: one function, and never a template string. `Internal.createValPathOfItem` * is the rule itself — `JSON.stringify` quotes a string and leaves a number * bare, which is precisely the module-path grammar — and everything here defers * to it rather than restating it. */ export declare function sourcePathOfChild(parent: SourcePath | ModuleFilePath, key: string | number): SourcePath; /** * The same thing, for callers holding the module file path and module path apart. * * `ModulePath` is empty at the module root, which is the case both broken copies * got wrong: there is no separator in the path yet, so the key is the first * segment and still has to be quoted. */ export declare function concatModulePath(moduleFilePath: ModuleFilePath, modulePath: ModulePath, key: string | number): SourcePath;