@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
155 lines (154 loc) • 4.66 kB
TypeScript
/**
* Export Promise Class (for simplified module path)
* @returns {Promise} promise class
*/
/**
* Clamp value
* @param {number} value - Value
* @param {number} minValue - Minimum value
* @param {number} maxValue - Maximum value
* @returns {number} clamped value
*/
export declare function clamp(value: any, minValue: any, maxValue: any): number;
/**
* Make key-value object from arguments
* @returns {object.<string, string>}
*/
export declare function keyMirror(...args: any[]): {};
/**
* Make CSSText
* @param {Object} styleObj - Style info object
* @returns {string} Connected string of style
*/
export declare function makeStyleText(styleObj: any): string;
/**
* Get object's properties
* @param {Object} obj - object
* @param {Array} keys - keys
* @returns {Object} properties object
*/
export declare function getProperties(obj: any, keys: any): {};
/**
* ParseInt simpliment
* @param {number} value - Value
* @returns {number}
*/
export declare function toInteger(value: any): number;
/**
* String to camelcase string
* @param {string} targetString - change target
* @returns {string}
* @private
*/
export declare function toCamelCase(targetString: any): any;
/**
* Check browser file api support
* @returns {boolean}
* @private
*/
export declare function isSupportFileApi(): boolean;
/**
* hex to rgb
* @param {string} color - hex color
* @param {string} alpha - color alpha value
* @returns {string} rgb expression
*/
export declare function getRgb(color: any, alpha: any): string;
/**
* send hostname
*/
export declare function sendHostName(): void;
/**
* Apply css resource
* @param {string} styleBuffer - serialized css text
* @param {string} tagId - style tag id
*/
export declare function styleLoad(styleBuffer: any, tagId: any): void;
/**
* Get selector
* @param {HTMLElement} targetElement - target element
* @returns {Function} selector
*/
export declare function getSelector(targetElement: any): (str: any) => any;
/**
* Change base64 to blob
* @param {String} data - base64 string data
* @returns {Blob} Blob Data
*/
export declare function base64ToBlob(data: any): Blob;
/**
* Fix floating point diff.
* @param {number} value - original value
* @returns {number} fixed value
*/
export declare function fixFloatingPoint(value: any): number;
/**
* Assignment for destroying objects.
* @param {Object} targetObject - object to be removed.
*/
export declare function assignmentForDestroy(targetObject: any): void;
/**
* Make class name for ui
* @param {String} str - main string of className
* @param {String} prefix - prefix string of className
* @returns {String} class name
*/
export declare function cls(str?: string, prefix?: string): string;
/**
* Change object origin
* @param {fabric.Object} fObject - fabric object
* @param {Object} origin - origin of fabric object
* @param {string} originX - horizontal basis.
* @param {string} originY - vertical basis.
*/
export declare function changeOrigin(fObject: any, origin: any): void;
/**
* Object key value flip
* @param {Object} targetObject - The data object of the key value.
* @returns {Object}
*/
export declare function flipObject(targetObject: any): {};
/**
* Set custom properties
* @param {Object} targetObject - target object
* @param {Object} props - custom props object
*/
export declare function setCustomProperty(targetObject: any, props: any): void;
/**
* Get custom property
* @param {fabric.Object} fObject - fabric object
* @param {Array|string} propNames - prop name array
* @returns {object | number | string}
*/
export declare function getCustomProperty(fObject: any, propNames: any): {};
/**
* Capitalize string
* @param {string} targetString - target string
* @returns {string}
*/
export declare function capitalizeString(targetString: any): any;
/**
* Array includes check
* @param {Array} targetArray - target array
* @param {string|number} compareValue - compare value
* @returns {boolean}
*/
export declare function includes(targetArray: any, compareValue: any): boolean;
/**
* Get fill type
* @param {Object | string} fillOption - shape fill option
* @returns {string} 'color' or 'filter'
*/
export declare function getFillTypeFromOption(fillOption?: {}): any;
/**
* Get fill type of shape type object
* @param {fabric.Object} shapeObj - fabric object
* @returns {string} 'transparent' or 'color' or 'filter'
*/
export declare function getFillTypeFromObject(shapeObj: any): string;
/**
* Check if the object is a shape object.
* @param {fabric.Object} obj - fabric object
* @returns {boolean}
*/
export declare function isShape(obj: any): boolean;