vue-web-terminal
Version:
A beautiful web-side command line window plugin (native simulation). 一个漂亮的网页命令行插件(原生模拟)
93 lines (92 loc) • 3.35 kB
TypeScript
import { ScreenType } from "~/types";
/**
* 将空格、回车、Tab转译为html
*
* @param str
* @returns {*|string}
* @private
*/
export declare function _html(str: string): string;
/**
* 判断一个对象是否为逻辑上的空
*
* @param value
* @returns {boolean|boolean}
* @private
*/
export declare function _isEmpty(value: string | object | undefined | null): boolean;
export declare function _nonEmpty(value: string | object | undefined | null): boolean;
export declare function _screenType(width?: number): ScreenType;
export declare function _isSafari(): boolean;
export declare function _getByteLen(val: string): number;
/**
* 获取两个连续字符串的不同部分
*
* @param one
* @param two
* @returns {string}
*/
export declare function _getDifferent(one: string, two: string): string;
export declare function _eventOn(dom: Document | Window, eventName: string, handler: EventListenerOrEventListenerObject): void;
export declare function _eventOff(dom: Document | Window, eventName: string, handler: EventListenerOrEventListenerObject): void;
export declare function _getClipboardText(): Promise<string>;
export declare function _copyTextToClipboard(text: string | null): Promise<any>;
export declare function _pointInRect(point: any, rect: any): boolean;
export declare function _getSelection(): Selection;
export declare function _parseToJson(obj: any): any;
export declare function _openUrl(url: string, pushMessage: Function): void;
/**
* 默认命令行样式格式化实现,对部分关键符号高亮处理。
*
* 此方法会对高亮字符进行合并,适用于记录命令行
*
* @param cmd
* @return {string}
* @private
*/
export declare function _defaultMergedCommandFormatter(cmd: string): string;
/**
* 默认命令行样式格式化实现,对部分关键符号高亮出路。
*
* 此方法会对每个字符进行分割,由单独的span约束,适用于编辑命令行
*
* @param cmd
* @private
*/
export declare function _defaultSplittableCommandFormatter(cmd: string): string;
/**
* 判断一个Dom A是否是另一个Dom B的孩子节点
*
* @param target 目标Dom,A
* @param parent 父级Dom,B
* @param clazz 中断类,当检索到当前节点拥有这个 class 时就中断搜索,用于优化处理,避免搜索整个Dom树
* @return {boolean}
* @private
*/
export declare function _isParentDom(target: any, parent: any, clazz?: any): boolean;
export declare function _isPhone(): boolean;
export declare function _isPad(): boolean;
/**
*
* <pre>
* methods: {
* _someMethod: _debounce(function () {
* // ...
* }, 100)
* }
* </pre>
*
* @param fn
* @param delay
* @return {(function(): void)|*}
* @private
*/
export declare function _debounce(fn: Function, delay?: number): () => void;
/**
* 将配置值转为像素度单位值
* @param value {number | string} 配置值,如果为number值则单位默认为px,如果为string只支持百分比和px单位配置
* @param parentPixel 父元素的像素度,用于百分比计算
* @param defaultValue 默认值,如果解析失败则使用默认值
*/
export declare function _parsePixelFromValue(value: number | string, parentPixel: number, defaultValue: number): number;
export declare function _hash(str: string): string;