/* * MIT License * * Copyright (c) 2018-2020 Ardalan Amini * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import * as Odin from "."; export * from "prototyped.js/es6/methods"; export declare const initialize: (Model: typeof Odin, document: Odin.Document) => Odin; /** * Adds the getter/setter to the given object * @param {object} obj * @param {("get" | "set")} method * @param {string} name * @param {(value?: any) => any} func */ export declare function define(obj: Record, method: "get" | "set", name: string, func: (value?: any) => any): void; /** * Generates getter name for the given key * @param {string} key * @returns {string} * @example * getGetterName("first_name"); // getFirstNameAttribute */ export declare const getGetterName: (key: string) => string; /** * Generates setter name for the given key * @param {string} key * @returns {string} * @example * getSetterName("first_name"); // setFirstNameAttribute */ export declare const getSetterName: (key: string) => string; /** * Generates collection name for the given name * @param {string} name * @returns {string} * @example * makeCollectionName("user_account"); // user_accounts */ export declare const makeCollectionName: (name: string) => string; /** * Generates the singular form of the given collection name * @param {string} name * @returns {string} * @example * makeCollectionType("user_accounts"); // user_account */ export declare const makeCollectionType: (name: string) => string; /** * Generates the id related to the given collection name * @param {string} name * @returns {string} * @example * makeCollectionId("users"); // user_id */ export declare const makeCollectionId: (name: string) => string; /** * Generates the polymorphic collection name * @param {string} name * @returns {string} * @example * makeMorphType("accounts"); // accountable */ export declare const makeMorphType: (name: string) => string; /** * Gets the name of the caller method of the given function * @param {Function} func * @returns {string} */ export declare const getCallerFunctionName: (func: (...args: any[]) => any) => any; export declare const OPERATORS: { [operator: string]: string; }; export declare const isID: (id: string) => boolean; export declare const prepareKeyToRead: (key: string) => string; export declare const prepareKey: (key: string) => string; export declare const prepareToRead: (document: any) => any; export declare const prepareToStore: (document: any) => any;