UNPKG

prg-class

Version:

Clases genéricas utilizadas por microservicios Programamos SPA.

89 lines (88 loc) 3.62 kB
import { IParamRet } from '../interface'; declare function unixDate(aoDate: Date): number; /** * Retorna el string de una expresión. Los objetos se convierten a string vacío. * * @param {*} aoValue Expresión que se convertirá a string. * @returns {string} Retorna el string de una expresión. Los objetos se convierten a string vacío. */ declare function fnToString(aoValue: any): string; /** * Quita espacios a la izquierda y derecha de una expresión. * * @param {*} aoValue Expresión a la que se quitarán espacios. * @returns {string} Quita espacios a la izquierda y derecha de una expresión. */ declare function trim(aoValue: any): string; /** * Retorna indicador de fecha válida. * * @param {Date} aoDate Fecha. * @returns {boolean} Retorna true en caso de fecha válida, false en caso de fecha inválida. */ declare function fnIsValidDate(aoDate: Date): boolean; /** * Recibe un dato del tipo fecha. Retorna un string con formato: aaaa-mm-dd. * * @param {Date} aoDate Fecha. * @param {boolean} abHourMin Indica si se deben incluir horas y minutos. * @returns {string} Retorna un string con formato: aaaa-mm-dd. */ declare function fnGetDateString(aoDate: Date, abHourMin: boolean): string; /** * Muestra un error por consola. * * @param {string} asMsg Mensaje a mostrar por consola. * @returns {string} Retorna string vacío. */ declare function fnLogError(asMsg: string): string; /** * Sustituye caracteres en un texto. Si no recibe parámetros, cambia apóstrofe por un tilde (´). * * @param {string} asCharCambiar El caracter que se eliminará. * @param {string} asCharCambio El caracter que se agregará. * @param {string} asTxt Texto al cual se le modificarán caracteres. * @returns {string} Texto con el caracter modificado. Si es nulo on indefinido, retorna string vacío. */ declare function fnStrReplace(asCharCambiar: string, asCharCambio: string, asTxt: string): string; /** * Retorna boolean indicando si un valor es nulo o undefined. * @param aoValue */ declare function novaluePure(aoValue: any): boolean; /** * Retorna boolean indicando si un valor es nulo o undefined. * @param aoValue */ declare function novalue(aoValue: any): boolean; /** * Retorna número entero representado por una expresión. * * @param {*} aoValue Expresión que será evaluada para obtener valor numérico entero. * @param {boolean} [abFtoChile=false] Indica si se debe interpretar la expresión como un número con formato chileno. * @returns {number} Retorna número entero representado por una expresión. */ declare function intval(aoValue: any, abFtoChile?: boolean): number; declare function fnReturn(asError: any, aoData: any | undefined, alResponseCode: number): IParamRet; declare function fnRetOk(aoRet: any, alCode?: number): IParamRet; declare function fnRetErrBP(aoErr: any, alCode?: number): IParamRet; declare function fnRetErrInt(aoErr: any, alCode?: number): IParamRet; declare function middlewareIpUa(aoReq: any): any; declare const _default: { fnRetOk: typeof fnRetOk; fnRetErrBP: typeof fnRetErrBP; fnRetErrInt: typeof fnRetErrInt; fnIsValidDate: typeof fnIsValidDate; fnGetDateString: typeof fnGetDateString; fnLogError: typeof fnLogError; fnStrReplace: typeof fnStrReplace; novaluePure: typeof novaluePure; novalue: typeof novalue; intval: typeof intval; fnReturn: typeof fnReturn; fnToString: typeof fnToString; trim: typeof trim; middlewareIpUa: typeof middlewareIpUa; unixDate: typeof unixDate; }; export = _default;