@crowdin/app-project-module
Version:
Module that generates for you all common endpoints for serving standalone Crowdin App
21 lines (20 loc) • 1.29 kB
TypeScript
import { Request, Response } from 'express';
import { Config, CrowdinClientRequest, ImagePath, UnauthorizedConfig } from '../types';
export declare class CodeError extends Error {
code: number | undefined;
constructor(message: string, code?: number);
}
export declare function runAsyncWrapper(callback: Function): (req: Request | CrowdinClientRequest, res: Response, next: Function) => void;
export declare function encryptData(config: Config, data: string): string;
export declare function decryptData(config: Config, data: string): string;
export declare function executeWithRetry<T>(func: () => Promise<T>, numOfRetries?: number): Promise<T>;
export declare function getLogoUrl(moduleConfig?: ImagePath, modulePath?: string): string;
export declare function isAuthorizedConfig(config: Config | UnauthorizedConfig): config is Config;
export declare function isJson(string: string): boolean;
export declare function getPreviousDate(days: number): Date;
export declare function prepareFormDataMetadataId(req: CrowdinClientRequest, config: Config): Promise<string>;
export declare function validateEmail(email: string | number): boolean;
export declare function getFormattedDate({ date, userTimezone }: {
date: Date | number;
userTimezone: string | undefined;
}): string;