import { formatAndValidate } from './helpers/formatAndValidateForDefinition.js'; import { Definition } from './DefinitionClass.js'; import { GoodCopDefinitionPartial, DefinitionObjChild, GoodCopDefinitionPartialFn, GoodCopProvidedModels, GoodCopMainTypes, SwaggerSchema } from './definitionTypes.js'; export declare class DefinitionBase { isRequired?: boolean | undefined; _refValue?: string | undefined; /** used to store models for model() and ref() definitions */ _definitions: (GoodCopDefinitionPartial | GoodCopDefinitionPartialFn)[]; protected getModels?: () => GoodCopProvidedModels; constructor(definitions?: GoodCopDefinitionPartial | GoodCopDefinitionPartial[], previousThis?: DefinitionBase); _pushNewDef(definition: GoodCopDefinitionPartial, doSort?: boolean): void; /** @returns formatted result */ formatAndValidate: typeof formatAndValidate; _getObjectCache(): DefinitionObjChild | undefined; /** for all definitions of the object (eg [string, required]) it will find a defined value and return when the value is met the first time. Eg: for a value of 'isRequired', it will check all definitions for the first containing that field and return it's value */ getDefinitionValue(name: K): (GoodCopDefinitionPartial[K] | void); getName(): string | void; getMainType(): void | GoodCopMainTypes; isType(type: GoodCopMainTypes): boolean; getTsTypeAsString(depth?: number): { read: string; write: string; }; /** Get Swagger type object for this definition */ getSwaggerType(depth?: number): SwaggerSchema; getExampleValue( /** Keep track of recursive executions internally for security and performance purposes */ depth?: number): string | void; /** This is a helper that will get any object definition to its flat version (with dot notation for subobjects) with a replacer callback. * ```ts * _getDefinitionObjFlat({ * a: { * b: { c: Definition }, * d: Definition * }, * e: Definition * }, * item => 'replaced' * }) * ``` * * Will become: * ```ts * { * 'a.b.c': 'replaced', * 'a.d': 'replaced', * e: 'replaced' * } * ``` */ _getDefinitionObjFlat( /** This option will remove 'myObj.myArr[0].item' => 'myObj.myArr.item' */ removeArrayBracketsNotation?: boolean, onDefinition?: (def: Definition) => T, addr?: string, objFlat?: {}, /** Keep track of recursive executions for security */ depth?: number): Record; }