vue-select-avatar-base
Version:
基于vue选择头像的包
45 lines (40 loc) • 1.16 kB
TypeScript
import Vue from 'vue';
import { Config, Result, Orientation, DataType, ImageFormat } from './src/type';
export declare class AvatarBody extends Vue {
// 配置对象
config: Config;
/**
* 注入数据
* @param file 文件对象
*/
inject(file: File): void;
/**
* 截取
* @param dataType 数据类型
* @param format 图片格式
* @param name 文件名(即 File 对象的 name 属性,注意不要加扩展名)
*/
capture(dataType?: DataType, format?: ImageFormat, name?: string): Promise<Result>;
/**
* 移动
* @param orientation 方向
*/
move(orientation: Orientation): void;
/**
* 缩放
* @param s 放大/ 缩小
* @param zoX 缩放中心点 x 轴偏移百分比
* @param zoY 缩放中心点 y 轴偏移百分比
*/
zoom(s: boolean, zoX: number, zoY: number): void;
}
/**
* File 对象转 base64
*/
export declare const fileToBase64: (file: File) => Promise<string>;
/**
* 选择图片
* @param component 组件实例
*/
export declare const selectImage: (component?: any) => Promise<File | undefined>;
export * from './src/type';