UNPKG

@stackend/api

Version:

JS bindings to api.stackend.com

60 lines 2 kB
import { State, Thunk } from '../api'; /** * Generate a class name * @param s */ export declare function generateClassName(s: string | null | undefined): string; /** * Calculate a hash number from a string * @param s */ export declare function hash(s: string | null | undefined): number; /** * Get a stackend supported locale given the corresponding language code * @param language */ export declare function getStackendLocale(language?: string | null): string; /** * Get the locale, falling back to the community locale if not supplied * @param locale */ export declare function getLocale(locale?: string | null): Thunk<Promise<string>>; /** * Get a local storage key name prefixed with the current community permalink * @param name */ export declare function getLocalStorageKey(name: string): Thunk<string>; /** * Get a local storage key name prefixed with the current community permalink * @param state * @param name */ export declare function _getLocalStorageKey(state: State, name: string): string; /** * Store any object in local storage under a community unique key * @param name * @param value */ export declare function setLocalStorageItem(name: string, value: string): Thunk<void>; /** * Get any object from local storage using a community unique key * @param name */ export declare function getLocalStorageItem(name: string): Thunk<string | null>; /** * Remove an object from local storage using a community unique key * @param name */ export declare function removeLocalStorageItem(name: string): Thunk<void>; /** * An email validation regular expression that covers most cases without * being to costly to evaluate. Not 100% correct, but covers most use cases. */ export declare const EMAIL_VALIDATION_REGEXP_RELAXED: RegExp; /** * Get a (cached) currency formatter. * @param currencyCode * @param locale */ export declare function getCurrencyFormatter(currencyCode: string, locale: string): Intl.NumberFormat; //# sourceMappingURL=index.d.ts.map