shot-web-screen
Version:
截屏、截图插件、capture screen
59 lines (58 loc) • 2.33 kB
TypeScript
import { POSITIONINFO, RENDERINFO, OPTION, CUTBOXINFO, JUDGERESULT } from '../types/index';
/**
* @func 绘制椭圆
* @desc 同矩形操作方法相同,差别在于需要将矩形所需要的信息进行转化
* @param {}
* @return {}
*/
declare class drawCircle {
dpr: number;
baseLineWidth: number;
degreeOfBlur: number;
constructor();
/**
* @func 绘制椭圆形
* @desc
* @param {}
* @return {}
*/
draw(ctx: CanvasRenderingContext2D, info: RENDERINFO): Path2D;
setOptions(ctx: CanvasRenderingContext2D, option: OPTION): void;
/**
* @func 绘制辅助点位,用于展示图形选中状态,即白色圆形点位
* @desc
* @param {}
* @return {}
*/
drawAuxiliaryPoint(ctx: CanvasRenderingContext2D, positionInfo: POSITIONINFO): void;
getPointsPlace(positionInfo: POSITIONINFO): Array<Array<number>>;
/**
* @func 判断椭圆操作方法:移动、大小设置
* @desc 注意:由于是外层使用,需要指定当前的this,否则this指向存在问题
* @param {}
* @return {
* 判断成功后,返回对应的mouse移动事件处理方法、鼠标状态或 抑或是其他信息
* 其中返回函数支持参数依次为
* startPoistion 图形操作之前、已经转为像素的点位或路径信息
* offsetX x方向、 鼠标移动偏移大小
* offsetY y方向、 鼠标移动偏移大小
* cutBoxInfo 剪裁框信息
* }
*/
judgeOperate(info: RENDERINFO, ctx: CanvasRenderingContext2D, x: number, y: number): JUDGERESULT | undefined;
/**
* @func 将像素位置、设置偏移后,再转为经纬度
* @desc 包含经纬度转为像素位置和点击位置信息
* @param {
* positionList 原像素位置
* offsetX,offsetY 偏移量
* }
* @return {}
*/
changePosition(positionList: POSITIONINFO, offsetX: number, offsetY: number): POSITIONINFO;
correctPosition(positionList: POSITIONINFO, cutBoxInfo: CUTBOXINFO): POSITIONINFO;
judgeWithinRound(mouseX: number, mouseY: number, center: Array<number>): boolean;
isInBorder(mouseX: number, mouseY: number, positionInfo: POSITIONINFO, option: OPTION): boolean;
}
declare const _default: drawCircle;
export default _default;