@mts-pjsc/image-optimize 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es5/components/Image.d.ts +30 -0
- package/dist/es5/helpers/check-avif-feature.d.ts +1 -0
- package/dist/es5/helpers/check-webp-feature.d.ts +1 -0
- package/dist/es5/index.d.ts +3 -0
- package/dist/esnext/components/Image.d.ts +30 -0
- package/dist/esnext/helpers/check-avif-feature.d.ts +1 -0
- package/dist/esnext/helpers/check-webp-feature.d.ts +1 -0
- package/dist/esnext/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface IImageOptions {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
offset?: number;
|
|
6
|
+
quality?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
setRef?: (elem: HTMLImageElement | null) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare class Image<P extends IImageOptions> extends React.Component<P> {
|
|
11
|
+
static isShowDiagnostic: boolean;
|
|
12
|
+
static isAvif: boolean | null;
|
|
13
|
+
static isWebP: boolean | null;
|
|
14
|
+
resultUrl: string;
|
|
15
|
+
resizeCheckTimeout: number;
|
|
16
|
+
thisComponent: HTMLImageElement | null;
|
|
17
|
+
private sourceUrl;
|
|
18
|
+
private readonly extensionsRegexp;
|
|
19
|
+
private readonly controlPoints;
|
|
20
|
+
private readonly windowResizeHandler;
|
|
21
|
+
private lastOptimalSize;
|
|
22
|
+
private checks;
|
|
23
|
+
constructor(props: P);
|
|
24
|
+
componentDidMount(): void;
|
|
25
|
+
shouldComponentUpdate(props: P): boolean;
|
|
26
|
+
componentWillUnmount(): void;
|
|
27
|
+
render(): JSX.Element;
|
|
28
|
+
private checkImage;
|
|
29
|
+
private onWindowResize;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkAvifFeature: () => Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkWebpFeature: () => Promise<boolean>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface IImageOptions {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
offset?: number;
|
|
6
|
+
quality?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
setRef?: (elem: HTMLImageElement | null) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare class Image<P extends IImageOptions> extends React.Component<P> {
|
|
11
|
+
static isShowDiagnostic: boolean;
|
|
12
|
+
static isAvif: boolean | null;
|
|
13
|
+
static isWebP: boolean | null;
|
|
14
|
+
resultUrl: string;
|
|
15
|
+
resizeCheckTimeout: number;
|
|
16
|
+
thisComponent: HTMLImageElement | null;
|
|
17
|
+
private sourceUrl;
|
|
18
|
+
private readonly extensionsRegexp;
|
|
19
|
+
private readonly controlPoints;
|
|
20
|
+
private readonly windowResizeHandler;
|
|
21
|
+
private lastOptimalSize;
|
|
22
|
+
private checks;
|
|
23
|
+
constructor(props: P);
|
|
24
|
+
componentDidMount(): void;
|
|
25
|
+
shouldComponentUpdate(props: P): boolean;
|
|
26
|
+
componentWillUnmount(): void;
|
|
27
|
+
render(): JSX.Element;
|
|
28
|
+
private checkImage;
|
|
29
|
+
private onWindowResize;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkAvifFeature: () => Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkWebpFeature: () => Promise<boolean>;
|