import MemberDef from './types/memberdef.js'; import { MemberMap } from './schema-types.js'; declare class IOSchema { /** Name of the schema */ name: string; /** The names of the members (properties) in the schema */ readonly names: string[]; /** The definitions of the members (properties) in the schema */ readonly defs: MemberMap; /** * Controls additional properties (dynamic fields) in the object. * - false: No additional properties allowed * - true: Any additional property allowed (no constraints) * - MemberDef: Additional properties must match the given type/constraints * (e.g., string, array, object, or with constraints like {string, minLen: 10}) * * If the schema uses *: type, *: {}, or *: [string], then open is set to the corresponding MemberDef. * If the schema uses just *, then open is true. * If no * is present, open is false. */ open: boolean | MemberDef; [key: string]: any; /** * Creates a new instance of Internet Object IOSchema. * Backward-compatible with legacy constructor usage that passes member objects. * @param name The name of the schema * @param o Optional member definition objects (legacy) */ constructor(name: string, ...o: { [key: string]: MemberDef; }[]); /** Returns the member definition of the given member name. */ get(name: string): MemberDef | undefined; /** Checks if a member exists by name. */ has(name: string): boolean; /** Returns the number of members in the schema. */ get memberCount(): number; /** Builder entry for new, immutable-style construction while keeping runtime mutability */ static create(name: string): SchemaBuilder; /** Legacy helper for creating from varargs member objects */ static fromLegacy(name: string, ...memberObjects: { [key: string]: MemberDef; }[]): IOSchema; } declare class SchemaBuilder { private name; private names; private defs; private isOpen; constructor(name: string); addMember(name: string, def: MemberDef): this; setOpen(open: boolean | MemberDef): this; build(): IOSchema; } export { SchemaBuilder, IOSchema as default };