| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- declare namespace abp {
- let appPath: string;
- let pageLoadTime: Date;
- function toAbsAppPath(path: string): string;
- namespace multiTenancy {
- enum sides {
- TENANT = 1,
- HOST = 2
- }
- let isEnabled: boolean;
- let tenantIdCookieName: string;
- function setTenantIdCookie(tenantId?: number): void;
- function getTenantIdCookie(): number;
- }
- interface IAbpSession {
- readonly userId?: number;
- readonly tenantId?: number;
- readonly impersonatorUserId?: number;
- readonly impersonatorTenantId?: number;
- readonly multiTenancySide: multiTenancy.sides;
- }
- let session: IAbpSession;
- namespace localization {
- interface ILanguageInfo {
- name: string;
- displayName: string;
- icon: string;
- isDefault: boolean;
- isDisabled: boolean;
- }
- interface ILocalizationSource {
- name: string;
- type: string;
- }
- let languages: ILanguageInfo[];
- let currentLanguage: ILanguageInfo;
- let sources: ILocalizationSource[];
- let defaultSourceName: string;
- let values: { [key: string]: string };
- let abpWeb: (key: string) => string;
- function localize(key: string, sourceName: string): string;
- function getSource(sourceName: string): (key: string) => string;
- function isCurrentCulture(name: string): boolean;
- }
- namespace auth {
- let allPermissions: { [name: string]: boolean };
- let grantedPermissions: { [name: string]: boolean };
- function isGranted(permissionName: string): boolean;
- function isAnyGranted(...args: string[]): boolean;
- function areAllGranted(...args: string[]): boolean;
- let tokenCookieName: string;
- /**
- * Saves auth token.
- * @param authToken The token to be saved.
- * @param expireDate Optional expire date. If not specified, token will be deleted at end of the session.
- */
- function setToken(authToken: string, expireDate?: Date): void;
- function getToken(): string;
- function clearToken(): void;
- }
- namespace features {
- interface IFeature {
- value: string;
- }
- let allFeatures: { [name: string]: IFeature };
- function get(name: string): IFeature;
- function getValue(name: string): string;
- function isEnabled(name: string): boolean;
- }
- namespace setting {
- let values: { [name: string]: string };
- function get(name: string): string;
- function getBoolean(name: string): boolean;
- function getInt(name: string): number;
- enum settingScopes {
- Application = 1,
- Tenant = 2,
- User = 4
- }
- }
- namespace nav {
- interface IMenu {
- name: string;
- displayName?: string;
- customData?: any;
- items: IMenuItem[];
- }
- interface IMenuItem {
- name: string;
- order: number;
- displayName?: string;
- icon?: string;
- url?: string;
- customData?: any;
- items: IMenuItem[];
- }
- let menus: { [name: string]: IMenu };
- }
- namespace notifications {
- enum severity {
- INFO,
- SUCCESS,
- WARN,
- ERROR,
- FATAL
- }
- enum userNotificationState {
- UNREAD,
- READ
- }
- //TODO: We can extend this interface to define built-in notification types, like ILocalizableMessageNotificationData
- interface INotificationData {
- type: string;
- properties: any;
- }
- interface INotification {
- id: string;
- notificationName: string;
- severity: severity;
- entityType?: any;
- entityTypeName?: string;
- entityId?: any;
- data: INotificationData;
- creationTime: Date;
- }
- interface IUserNotification {
- id: string;
- userId: number;
- state: userNotificationState;
- notification: INotification;
- }
- let messageFormatters: any;
- function getUserNotificationStateAsString(userNotificationState: userNotificationState): string;
- function getUiNotifyFuncBySeverity(severity: severity): (message: string, title?: string, options?: any) => void;
- function getFormattedMessageFromUserNotification(userNotification: IUserNotification): string;
- function showUiNotifyForUserNotification(userNotification: IUserNotification, options?: any): void;
- }
- namespace log {
- enum levels {
- DEBUG,
- INFO,
- WARN,
- ERROR,
- FATAL
- }
- let level: levels;
- function log(logObject?: any, logLevel?: levels): void;
- function debug(logObject?: any): void;
- function info(logObject?: any): void;
- function warn(logObject?: any): void;
- function error(logObject?: any): void;
- function fatal(logObject?: any): void;
- }
- namespace notify {
- function info(message: string, title?: string, options?: any): void;
- function success(message: string, title?: string, options?: any): void;
- function warn(message: string, title?: string, options?: any): void;
- function error(message: string, title?: string, options?: any): void;
- }
- namespace message {
- //TODO: these methods return jQuery.Promise instead of any. fix it.
- function info(message: string, title?: string, isHtml?: boolean): any;
- function success(message: string, title?: string, isHtml?: boolean): any;
- function warn(message: string, title?: string, isHtml?: boolean): any;
- function error(message: string, title?: string, isHtml?: boolean): any;
- function confirm(message: string, callback?: (result: boolean) => void): any;
- function confirm(message: string, title?: string, callback?: (result: boolean) => void, isHtml?: boolean): any;
- }
- namespace ui {
- function block(elm?: any): void;
- function unblock(elm?: any): void;
- function setBusy(elm?: any, optionsOrPromise?: any): void;
- function clearBusy(elm?: any): void;
- }
- namespace event {
- function on(eventName: string, callback: (...args: any[]) => void): void;
- function off(eventName: string, callback: (...args: any[]) => void): void;
- function trigger(eventName: string, ...args: any[]): void;
- }
- interface INameValue {
- name: string;
- value?: any;
- }
- namespace utils {
- function createNamespace(root: any, ns: string): any;
- function replaceAll(str: string, search: string, replacement: any): string;
- function formatString(str: string, ...args: any[]): string;
- function toPascalCase(str: string): string;
- function toCamelCase(str: string): string;
- function truncateString(str: string, maxLength: number): string;
- function truncateStringWithPostfix(str: string, maxLength: number, postfix?: string): string;
- function isFunction(obj: any): boolean;
- function buildQueryString(parameterInfos: INameValue[], includeQuestionMark?: boolean): string;
- /**
- * Sets a cookie value for given key.
- * This is a simple implementation created to be used by ABP.
- * Please use a complete cookie library if you need.
- * @param {string} key
- * @param {string} value
- * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session.
- * @param {string} path (optional)
- */
- function setCookieValue(key: string, value: string, expireDate?: Date, path?: string): void;
- /**
- * Gets a cookie with given key.
- * This is a simple implementation created to be used by ABP.
- * Please use a complete cookie library if you need.
- * @param {string} key
- * @returns {string} Cookie value or null
- */
- function getCookieValue(key: string): string;
- /**
- * Deletes cookie for given key.
- * This is a simple implementation created to be used by ABP.
- * Please use a complete cookie library if you need.
- * @param {string} key
- * @param {string} path (optional)
- */
- function deleteCookie(key: string, path?: string): void;
- }
- namespace timing {
- interface IClockProvider {
- supportsMultipleTimezone: boolean;
- now(): Date;
- normalize(date: Date): Date;
- }
- interface ITimeZoneInfo {
- windows: {
- timeZoneId: string;
- baseUtcOffsetInMilliseconds: number;
- currentUtcOffsetInMilliseconds: number;
- isDaylightSavingTimeNow: boolean;
- },
- iana: {
- timeZoneId: string;
- }
- }
- const utcClockProvider: IClockProvider;
- const localClockProvider: IClockProvider;
- const unspecifiedClockProvider: IClockProvider;
- function convertToUserTimezone(date: Date): Date;
- let timeZoneInfo: ITimeZoneInfo;
- }
- namespace clock {
- let provider: timing.IClockProvider;
- function now(): Date;
- function normalize(date: Date): Date;
- }
- namespace security {
- namespace antiForgery {
- let tokenCookieName: string;
- let tokenHeaderName: string;
- function getToken(): string;
- }
- }
- }
|