ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
118 lines • 3.73 kB
TypeScript
import * as i0 from "@angular/core";
import { ElementRef, OnChanges, OnInit, SimpleChanges } from "@angular/core";
import { NzConfigKey } from "ng-zorro-antd/core/config";
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
export type NzImageSrcLoader = (params: {
src: string;
width?: number;
}) => string;
declare namespace image_component_d_exports {
export { NZ_CONFIG_MODULE_NAME, NzImageViewComponent };
}
export declare const NZ_CONFIG_MODULE_NAME: NzConfigKey;
export declare class NzImageViewComponent implements OnInit, OnChanges {
private cdr;
private imagePreloadService;
private destroyRef;
readonly _nzModuleName: NzConfigKey;
nzSrc: string;
nzAlt: string;
nzWidth: string | number;
nzHeight: string | number;
nzSrcLoader: NzImageSrcLoader;
nzAutoSrcset: boolean;
nzPriority: boolean;
nzFallback: string | null;
nzPlaceholder: string | null;
nzDisablePreview: boolean;
imageRef: ElementRef<HTMLImageElement>;
src: string;
width: string | number;
height: string | number;
srcset: string;
private reloadDisposeHandler;
constructor();
ngOnInit(): void;
ngOnChanges(changes: SimpleChanges): void;
private preload;
private optimizable;
private composeImageAttrs;
private getLoader;
private convertWidths;
static ɵfac: i0.ɵɵFactoryDeclaration<NzImageViewComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzImageViewComponent, "nz-image", ["nzImage"], {
"nzSrc": {
"alias": "nzSrc";
"required": false;
};
"nzAlt": {
"alias": "nzAlt";
"required": false;
};
"nzWidth": {
"alias": "nzWidth";
"required": false;
};
"nzHeight": {
"alias": "nzHeight";
"required": false;
};
"nzSrcLoader": {
"alias": "nzSrcLoader";
"required": false;
};
"nzAutoSrcset": {
"alias": "nzAutoSrcset";
"required": false;
};
"nzPriority": {
"alias": "nzPriority";
"required": false;
};
"nzFallback": {
"alias": "nzFallback";
"required": false;
};
"nzPlaceholder": {
"alias": "nzPlaceholder";
"required": false;
};
"nzDisablePreview": {
"alias": "nzDisablePreview";
"required": false;
};
}, {}, never, never, true, never>;
static ngAcceptInputType_nzAutoSrcset: unknown;
static ngAcceptInputType_nzPriority: unknown;
static ngAcceptInputType_nzDisablePreview: unknown;
}
export declare const defaultImageSrcLoader: NzImageSrcLoader;
/**
* AliObjectsLoader return format
* {domain}/{src}?x-oss-process=image/resize,w_{width}
*/
export declare function createAliObjectsLoader(domain: string): NzImageSrcLoader;
/**
* ImgixLoader return format
* {domain}/{src}?format=auto&fit=max&w={width}
*/
export declare function createImgixLoader(domain: string): NzImageSrcLoader;
/**
* CloudinaryLoader return format
* {domain}/c_limit,q_auto,w_{width}/{src}
*/
export declare function createCloudinaryLoader(domain: string): NzImageSrcLoader;
export declare class NzImageModule {
static ɵfac: i0.ɵɵFactoryDeclaration<NzImageModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<NzImageModule, never, [typeof NzImageViewComponent], [typeof NzImageViewComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<NzImageModule>;
}
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
export declare function isFixedSize(size: number | string): boolean;
export declare function normalizeSrc(src: string): string;