UNPKG

ngx-bit

Version:

A flexible NG-ZORRO helper library

158 lines (157 loc) 3.86 kB
import { NavigationExtras, Router } from '@angular/router'; import { NzI18nService } from 'ng-zorro-antd/i18n'; import { Location } from '@angular/common'; import { Subject } from 'rxjs'; import { BitConfig } from './bit-config'; import { ListByPageOption, I18nGroupOption, I18nTooltipOption, I18nOption } from './types'; import { ListByPage } from './utils/list-by-page'; import { BitCurdService } from './bit-curd.service'; import { StorageMap } from '@ngx-pwa/local-storage'; export declare class BitService { private curd; private storage; private router; private location; private nzI18nService; /** * 静态资源地址 * Static resource address */ readonly static: string; /** * 上传地址 * Upload address */ readonly uploads: string; /** * 公共语言包 * Common language pack */ private language; /** * 默认语言包 ID * Default language ID */ readonly localeDefault: string; /** * 语言包 ID 索引 * Language ID index */ readonly localeMapping: string[]; /** * 语言包 ID 与 NG-ZORRO 语言包关联 * Language ID associated with NG-ZORRO language */ readonly localeBind: any[]; /** * 语言包 ID * Language ID */ locale: string; /** * 语言包 ID 状态 * Language ID changed */ readonly localeChanged: Subject<string>; /** * 语言包引用 * Language pack reference */ l: any; /** * 默认国际化 ID,^ 国际化是面向表单输入的 * Default I18n ID, ^ I18n is for form input */ readonly i18nDefault: string; /** * 国际化 ID * I18n ID */ i18n: string; /** * 国际化 ID 状态 * I18n ID changed */ readonly i18nChanged: Subject<string>; /** * 国际化包含语言 ID * I18n includes languages ID */ i18nContain: any[]; /** * 国际化详情 * I18n Detail */ i18nSwitch: I18nOption[]; /** * 国际化输入提示状态 * I18n tooltip status */ i18nTooltip: I18nTooltipOption; /** * 默认分页限制 * Default Page Limit */ readonly pageDefault: number; constructor(bitConfig: BitConfig, curd: BitCurdService, storage: StorageMap, router: Router, location: Location, nzI18nService: NzI18nService); /** * 路由导航 * Route navigation */ open(path: any[], extras?: NavigationExtras): void; /** * 导航历史 * Navigation history */ history(key: string): void; /** * 导航返回 * Navigate back */ back(): void; /** * 初始化语言包 * Setup language pack */ setupLocale(): void; /** * 载入语言包 * Registered language pack */ registerLocales(packer: object | Promise<any>): void; /** * 设置语言包 ID * Set language ID */ setLocale(locale: string): void; /** * 国际化 ID 是否相等 * Are the I18n IDs equal */ equalI18n(i18n: string): boolean; /** * 重置国际化 ID * Reset I18n ID */ resetI18n(): void; /** * 生成 I18n FormGroup * Generate I18n FormGroup */ i18nGroup(options: I18nGroupOption): any; /** * 解析国际化数据 * Parse i18n string json */ i18nParse(text: string): any; /** * 生产分页数据对象 * Factory list by page */ listByPage(option: ListByPageOption): ListByPage; /** * 清除应用本地存储 * Clear app local storage */ clear(): void; }