import { Entity } from '../engine'; import { Color3Type } from './custom/Color3'; import { Color4Type } from './custom/Color4'; import { QuaternionType } from './custom/Quaternion'; import { Vector3Type } from './custom/Vector3'; import { ISchema, JsonSchemaExtended, JsonArray, JsonMap, JsonPrimitive } from './ISchema'; export { QuaternionType, Vector3Type, ISchema, Color3Type, Color4Type, JsonSchemaExtended, JsonArray, JsonMap, JsonPrimitive }; /** * @public */ export declare namespace Schemas { /** @public */ type SchemaType = ISchema; /** @public */ const Boolean: ISchema; /** @public */ const String: ISchema; /** @public */ const Float: ISchema; /** @public */ const Double: ISchema; /** @public */ const Byte: ISchema; /** @public */ const Short: ISchema; /** @public */ const Int: ISchema; /** @public */ const Int64: ISchema; /** @public */ const Number: ISchema; /** @public */ const Vector3: ISchema; /** @public */ const Quaternion: ISchema; /** @public */ const Color3: ISchema; /** @public */ const Color4: ISchema; /** @public */ const Entity: ISchema; /** @public */ const EnumNumber: (enumObject: Record, defaultValue: T) => ISchema; /** @public */ const EnumString: (enumObject: Record, defaultValue: T) => ISchema; /** @public */ const Array: (type: ISchema) => ISchema; /** @public */ const Map: (spec: T, defaultValue?: Partial> | undefined) => ISchema>; /** @public */ const Optional: (spec: ISchema) => ISchema; /** @public */ const OneOf: (specs: T) => ISchema<{ [K in keyof T]: { readonly $case: K; readonly value: ReturnType; }; }[keyof T]>; /** * @public Create an ISchema object from the json-schema * @param jsonSchema * @returns a ISchema or fail for unsupported json-schema */ const fromJson: (json: JsonSchemaExtended) => ISchema; /** * @public * * Traverses and mutates values in a JSON schema-based structure, applying the given mutation function to each value. * The function is designed to work with nested maps and arrays, recursively processing each element. * * @param jsonSchema - The JSON schema object that describes the structure of the value. * It must have a serializationType of 'map', 'array', or other custom types like 'entity'. * @param value - The value to be mutated, which should conform to the provided JSON schema. * @param mutateFn - A function that takes a value and its corresponding valueType (JsonSchemaExtended) as arguments * and returns a tuple [boolean, any]. The boolean indicates whether the mutation should be applied, * and the second element is the mutated value. */ const mutateNestedValues: (jsonSchema: JsonSchemaExtended, value: unknown, mutateFn: (value: unknown, valueType: JsonSchemaExtended) => { changed: boolean; value?: any; }) => void; }