@etsoo/appscript
Version:
Applications shared TypeScript framework
54 lines (53 loc) • 1.84 kB
TypeScript
import { DataTypes, IdType, ListType } from "@etsoo/shared";
import { CustomCultureData } from "../def/CustomCulture";
import { QueryRQ } from "../api/rq/QueryRQ";
/**
* Business utils
*/
export declare namespace BusinessUtils {
/**
* Format avatar title
* @param title Title
* @param maxChars Max characters
* @param defaultTitle Default title
* @returns Result
*/
function formatAvatarTitle(title?: string, maxChars?: number, defaultTitle?: string): string;
/**
* Format query, dealing with paging data
* @param rq Query
* @returns Result
*/
function formatQuery<T extends IdType>(rq: QueryRQ<T>): {
id?: T | undefined;
ids?: T[] | undefined;
excludedIds?: T[] | undefined;
keyword?: string;
queryPaging: import("..").QueryPagingData | undefined;
};
/**
* Get 12-month items
* @param monthLabels Month labels
* @param startMonth Start month, 0 as Jan.
* @returns 12 months
*/
function getMonths(monthLabels: string[], startMonth?: number): ListType[];
/**
* Check if the item is a custom culture data
* @param item Item to check
* @param hasOrgId Has orgId or not
* @returns Result
*/
function isCustomCultureData(item: unknown, hasOrgId?: boolean): item is CustomCultureData;
/**
* Merge custom resources to target collection
* @param target Target collection merges to
* @param resources New resources to merge
*/
function mergeCustomResources(target: DataTypes.StringRecord, resources: CustomCultureData[]): void;
/**
* Restore resources to target collection
* @param target Target collection to restore resources to, null to clear cache
*/
function restoreResources(target?: DataTypes.StringRecord): void;
}