nakedobjects.spa
Version:
Single Page Application client for a Naked Objects application.
29 lines (28 loc) • 1.48 kB
TypeScript
import * as Ro from './ro-interfaces';
import { ConfigService } from './config.service';
export interface IMaskServiceConfigurator {
setNumberMaskMapping: (customMask: string, format: Ro.FormatType, digits?: string, locale?: string) => void;
setDateMaskMapping: (customMask: string, format: Ro.FormatType, mask: string, tz?: string, locale?: string) => void;
setCurrencyMaskMapping: (customMask: string, format: Ro.FormatType, symbol?: string, digits?: string, locale?: string) => void;
}
export interface ILocalFilter {
filter(val: any): string;
}
export interface IMaskMap {
[index: string]: {
[index: string]: ILocalFilter;
};
}
export declare class MaskService implements IMaskServiceConfigurator {
private readonly appConfig;
private maskMap;
constructor(appConfig: ConfigService);
private readonly defaultLocale;
defaultLocalFilter(format: Ro.FormatType): ILocalFilter;
private customFilter(format, remoteMask);
toLocalFilter(remoteMask: string | null, format: Ro.FormatType): ILocalFilter;
setNumberMaskMapping(customMask: string, format: Ro.FormatType, digits?: string, locale?: string): void;
setDateMaskMapping(customMask: string, format: Ro.FormatType, mask: string, tz?: string, locale?: string): void;
setCurrencyMaskMapping(customMask: string, format: Ro.FormatType, symbol?: string, digits?: string, locale?: string): void;
private configureFromConfig();
}