@uploadcare/blocks
Version:
Building blocks for Uploadcare products integration
132 lines • 3.41 kB
TypeScript
/**
* @typedef {Object} Keypoint
* @property {String} src
* @property {Number} opacity
* @property {Number} zIndex
* @property {HTMLImageElement} image
* @property {Number} value
*/
export class EditorImageFader extends Block {
/**
* @private
* @type {Boolean}
*/
private _isActive;
/**
* @private
* @type {Boolean}
*/
private _hidden;
/** @private */
private _addKeypointDebounced;
/**
* @private
* @param {String} src
* @returns {() => void} Destructor
*/
private _handleImageLoading;
/** @private */
private _flush;
_raf: number;
/**
* @private
* @param {Object} options
* @param {String} [options.url]
* @param {String} [options.filter]
* @param {String} [options.operation]
* @param {Number} [options.value]
* @returns {String}
*/
private _imageSrc;
/**
* @private
* @param {String} operation
* @param {Number} value
* @returns {Keypoint}
*/
private _constructKeypoint;
/**
* Check if current operation and filter equals passed ones
*
* @private
* @param {String} operation
* @param {String} [filter]
* @returns {Boolean}
*/
private _isSame;
/**
* @private
* @param {String} operation
* @param {String | null} filter
* @param {Number} value
*/
private _addKeypoint;
/** @param {String | Number} value */
set(value: string | number): void;
/**
* @private
* @param {String} operation
* @param {Number} value
*/
private _update;
_operation: string;
_value: number;
/** @private */
private _createPreviewImage;
/** @private */
private _initNodes;
_previewImage: any;
_cancelLastImages: any;
_container: HTMLDivElement;
/** @param {import('./types.js').Transformations} transformations */
setTransformations(transformations: import('./types.js').Transformations): void;
_transformations: import("./types.js").Transformations;
/**
* @param {object} options
* @param {String} options.url
* @param {String} options.operation
* @param {Number} options.value
* @param {String} [options.filter]
*/
preload({ url, filter, operation, value }: {
url: string;
operation: string;
value: number;
filter?: string;
}): void;
_cancelBatchPreload: () => void;
/** @private */
private _setOriginalSrc;
/**
* @param {object} options
* @param {String} options.url
* @param {String} [options.operation]
* @param {Number} [options.value]
* @param {String} [options.filter]
* @param {Boolean} [options.fromViewer]
*/
activate({ url, operation, value, filter, fromViewer }: {
url: string;
operation?: string;
value?: number;
filter?: string;
fromViewer?: boolean;
}): void;
_url: string;
_filter: string;
_fromViewer: boolean;
_keypoints: Keypoint[];
/** @param {{ hide?: Boolean }} options */
deactivate({ hide }?: {
hide?: boolean;
}): void;
}
export type Keypoint = {
src: string;
opacity: number;
zIndex: number;
image: HTMLImageElement;
value: number;
};
import { Block } from "../../../abstract/Block.js";
//# sourceMappingURL=EditorImageFader.d.ts.map