93 lines
3.9 KiB
TypeScript
93 lines
3.9 KiB
TypeScript
import * as i0 from '@angular/core';
|
|
import { OnInit, OnChanges, ElementRef, 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
|
|
*/
|
|
type NzImageSrcLoader = (params: {
|
|
src: string;
|
|
width?: number;
|
|
}) => string;
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
|
|
declare const NZ_CONFIG_MODULE_NAME: NzConfigKey;
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
|
|
declare const defaultImageSrcLoader: NzImageSrcLoader;
|
|
/**
|
|
* AliObjectsLoader return format
|
|
* {domain}/{src}?x-oss-process=image/resize,w_{width}
|
|
*/
|
|
declare function createAliObjectsLoader(domain: string): NzImageSrcLoader;
|
|
/**
|
|
* ImgixLoader return format
|
|
* {domain}/{src}?format=auto&fit=max&w={width}
|
|
*/
|
|
declare function createImgixLoader(domain: string): NzImageSrcLoader;
|
|
/**
|
|
* CloudinaryLoader return format
|
|
* {domain}/c_limit,q_auto,w_{width}/{src}
|
|
*/
|
|
declare function createCloudinaryLoader(domain: string): NzImageSrcLoader;
|
|
|
|
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
|
|
*/
|
|
declare function isFixedSize(size: number | string): boolean;
|
|
declare function normalizeSrc(src: string): string;
|
|
|
|
export { NZ_CONFIG_MODULE_NAME, NzImageModule, NzImageViewComponent, createAliObjectsLoader, createCloudinaryLoader, createImgixLoader, defaultImageSrcLoader, isFixedSize, normalizeSrc };
|
|
export type { NzImageSrcLoader };
|