//#region src/core/guards.d.ts /** * Shared type guards and safe property access. * * Every module in schema-components needs `isObject` and `getProperty`. * Defining them once eliminates the six re-implementations that existed * across core, react, openapi, html, and themes. * * The `object → Record` conversion (`toRecord`) is * the one place where a cast is genuinely unavoidable — TypeScript's * `object` type has no index signature. See AGENTS.md * (`object → Record`). */ /** * Narrows `unknown` to a non-null, non-array object. * This is the most fundamental narrowing in the library — every module * that reads JSON Schema or OpenAPI objects uses this. */ declare function isObject(value: unknown): value is Record; /** * Safe property access on unknown values. Returns `undefined` if the * value is not an object or the key doesn't exist. */ declare function getProperty(value: unknown, key: string): unknown; /** * Check if a value is an object with a specific own-property. */ declare function hasProperty(value: unknown, key: string): boolean; /** * Convert a known `object` to `Record` by iterating * `Object.entries`. This avoids the cast that TypeScript's `object` * type (no index signature) otherwise forces. * * Only use this when you already know `value` is an `object` — it does * not perform a type guard. */ declare function toRecord(value: object): Record; /** * Convert `unknown` to `Record | undefined`. * Returns `undefined` for non-objects, null, and arrays. */ declare function toRecordOrUndefined(value: unknown): Record | undefined; //#endregion export { getProperty, hasProperty, isObject, toRecord, toRecordOrUndefined };