ng-cw-v12
Version:
Angular UI Component Library
47 lines (46 loc) • 1.55 kB
TypeScript
import { DomSanitizer } from '@angular/platform-browser';
import * as i0 from "@angular/core";
export interface NcWeatherOptions {
lng?: number | string;
lat?: number | string;
}
export declare class LocalService {
private sanitizer;
constructor(sanitizer: DomSanitizer);
getWeather(token: string, options: NcWeatherOptions): Promise<any>;
private getRealTimeWeather;
private skyconEnum;
/**
* 格式化时间
* @param type 格式化类型yyyy-MM-dd HH:mm:ss,注意MM为月份、mm为分钟
* @param time 可选。默认当前时间
* @returns yyyy-MM-dd HH:mm:ss
*/
formatDate(type: string, time?: any): string;
/**
* jsonp封装
* @param obj \{url: '', success: ()=> {}}
*/
private jsonpFunction;
/**
* 获取当前位置的经纬度
* @returns Promise<{latitude: number, longitude: number}>
*/
private getGeolocation;
/**
* 保留指定小数位数(降水量)
* @param num 需要处理的数值
* @param len 要保留的小数位数
* @returns 处理后的数值,保留指定小数位数
*/
private retainDecimal;
private roundPercent;
private getPrecipitationDesc1;
private getPrecipitationDesc2;
private getWindLevel;
private getWindDirection;
private getAQIParams;
private sanitizerSvg;
static ɵfac: i0.ɵɵFactoryDeclaration<LocalService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<LocalService>;
}