@aidc/utils
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -6,2 +6,1 @@ import _debug from 'debug'; | ||
export declare const debug: _debug.Debugger; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -5,2 +5,1 @@ import { ReactElement } from 'react'; | ||
export declare function injectStyle(url: string): void; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,2 +9,1 @@ export declare const isWindow: boolean; | ||
export declare const isChromeBackground: boolean; | ||
//# sourceMappingURL=index.d.ts.map |
export declare function getClassName(object: any): any; | ||
//# sourceMappingURL=index.d.ts.map | ||
export declare function openWindow(url: string, size?: { | ||
width: number; | ||
height: number; | ||
}): void; |
@@ -0,1 +1,3 @@ | ||
import { debug } from "../debug"; | ||
// 获取一个 JS 实例或类的 “类的名称” | ||
@@ -10,2 +12,17 @@ export function getClassName(object) { | ||
return 'Unknown'; | ||
} | ||
// 打开一个新的浏览器窗口 | ||
export function openWindow(url, size) { | ||
debug('[debug] openWindow url:', url); | ||
if (size) { | ||
// 如果设置了尺寸,就使其屏幕居中显示 | ||
var left = (window.screen.width - size.width) / 2; | ||
var top = (window.screen.height - size.height) / 2; | ||
var features = "width=".concat(size.width, ",height=").concat(size.height, ",left=").concat(left, ",top=").concat(top); | ||
window.open(url, '_blank', features); | ||
debug('[debug] openWindow features:', features); | ||
} else { | ||
window.open(url, '_blank'); | ||
} | ||
} |
export declare function checkWebp(): boolean; | ||
//# sourceMappingURL=check-webp.d.ts.map |
@@ -15,2 +15,1 @@ interface CompressInfoProps { | ||
export {}; | ||
//# sourceMappingURL=compress-image.d.ts.map |
@@ -19,2 +19,1 @@ export * from './check-webp'; | ||
export declare function onlyWebp(imgUrl: string): string; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,2 +9,1 @@ export * from './debug'; | ||
export * from './time'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,2 @@ | ||
export declare function pingAlibabaAvatarImage(): Promise<unknown>; | ||
export declare function pingAlibabaAvatarImage(): Promise<void>; | ||
export declare function pingAlibabaNetwork(): Promise<boolean>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -7,4 +7,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime"; | ||
img.onload = function () { | ||
// @ts-ignore | ||
if (this.width === 200 && this.height === 200) resolve();else reject(); | ||
if (img.width === 200 && img.height === 200) { | ||
resolve(); | ||
} else { | ||
reject(); | ||
} | ||
}; | ||
@@ -11,0 +14,0 @@ img.onerror = reject; |
@@ -23,2 +23,1 @@ export interface RequestOptions { | ||
export declare function request<T extends RequestResponse>(url: string, options?: RequestOptions): Promise<T["data"]>; | ||
//# sourceMappingURL=index.d.ts.map |
export declare function delay(ms: number): Promise<unknown>; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@aidc/utils", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"repository": "git@gitlab.alibaba-inc.com:aidc-innovation/aidc-fe.git", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
502
20792
24