declare namespace NajsEloquent.Model { class IModelSerialization { /** * The attributes that are visible when serialized. */ protected visible?: string[]; /** * The attributes that are hidden when serialized. */ protected hidden?: string[]; } interface IModelSerialization { /** * Get the visible attributes for the model. */ getVisible(): string[]; /** * Set the visible attributes for the model. Warning: this function reset all visible setting included static. */ setVisible(visible: string[]): this; /** * Add temporary visible attributes for the model. * * @param {string|string[]} keys */ addVisible(...keys: Array): this; /** * Make the given, typically hidden, attributes visible. * * @param {Model} model * @param {Array} keys */ makeVisible(...keys: Array): this; /** * Determine if the given attribute may be included in JSON. * * @param {string} key */ isVisible(...keys: Array): boolean; /** * Get the hidden attributes for the model. */ getHidden(): string[]; /** * Set the hidden attributes for the model. Warning: this function reset all hidden setting included static. */ setHidden(hidden: string[]): this; /** * Add temporary hidden attributes for the model. * * @param {string|string[]} keys */ addHidden(...keys: Array): this; /** * Make the given, typically visible, attributes hidden. * * @param {Model} model * @param {Array} keys */ makeHidden(...keys: Array): this; /** * Determine if the given key hidden in JSON. * * @param {string} key */ isHidden(...keys: Array): boolean; /** * Convert the model data to a plain object. * * Visible and hidden are applied. */ attributesToObject(): T; /** * Convert the loaded relations to a plain object the name of relation in result is formatted like an attribute. * * Visible and hidden are applied. */ relationsToObject(): T; /** * Convert the model given relations to a plain object the name of relation in result is formatted like an attribute. * * Visible and hidden are applied. */ relationsToObject(...names: Array): T; /** * Convert the model given relations to a plain object with option format name like attribute or not. * * Visible and hidden are applied. */ relationsToObject(formatName: boolean, ...names: Array): T; /** * Convert the model data and model relations to a plain object. * * Visible and hidden are applied. */ toObject(): T; /** * Convert the model data and model given relations to a plain object with custom options. */ toObject(options: Feature.ToObjectOptions): T; /** * Convert model data and relations to a plain object which used for JSON.stringify() */ toJSON(): T; /** * Convert the model data and model given relations to a plain object with custom options. */ toJSON(options: Feature.ToObjectOptions): T; /** * Convert the model instance to JSON string. */ toJson(replacer?: (key: string, value: any) => any, space?: string | number): string; } }