// @ts-nocheck
// #ifndef APP-ANDROID || APP-IOS
export interface LBarcodeOptions {
	format : string
	width : number
	height : number
	/**
	 * 显示value
	 * @default true
	 */
	displayValue : boolean
	text : string
	fontOptions : string
	font : string
	textAlign : string
	textPosition : string
	textMargin : number
	fontSize : number
	background : string
	lineColor : string
	margin : number
	marginTop : number
	marginBottom : number
	marginLeft : number
	marginRight : number
	flat : boolean
	ean128 : boolean
	mod43 ?: boolean
	lastChar ?: string
}
export interface EncodeResultOptions {
	textAlign ?: string
	fontSize ?: number
	height ?: number
}
export interface EncodeResult {
	data : string
	text ?: string
	width ?: number
	height ?: number
	barcodePadding ?: number
	options ?: LBarcodeOptions
}

// #endif
// #ifdef UNI-APP-X
// #ifndef APP
/**
 * 组件截图成功的返回数据
 */
export type TakeSnapshotSuccess = {
  /**
   * 截图保存的临时文件路径
   */
  tempFilePath: string
}

/**
 * 组件截图失败的返回数据
 */
export type TakeSnapshotFail = {
  errMsg: string
}
// #endif


/**
 * 成功回调函数定义
 */
export type TakeSnapshotSuccessCallback = (res: UTSJSONObject) => void
/**
 * 失败回调函数定义
 */
export type TakeSnapshotFailCallback = (res: UTSJSONObject) => void
/**
 * 完成回调函数定义
 */
export type TakeSnapshotCompleteCallback = (res: any) => void


export type LBarcodeFailCallback = TakeSnapshotFailCallback
export type LBarcodeCompleteCallback = TakeSnapshotCompleteCallback
export type LBarcodeSuccessCallback  = TakeSnapshotSuccessCallback

// #endif

// #ifdef APP-ANDROID
export type Numberc = any
// #endif
// #ifndef APP-ANDROID
export type Numberc = string | number
// #endif

export interface BarCodeProps {
	format: string;
	lineWidth?: Numberc;
	lineLength?: Numberc;
	displayValue: boolean;
	text: string;
	fontOptions: string;
	font?: string;
	textAlign?: string;
	textPosition: string;
	textMargin?: Numberc;
	fontSize?: Numberc;
	background?: string;
	lineColor?: string;
	margin?: Numberc;
	marginTop?: Numberc;
	marginBottom?: Numberc;
	marginLeft?: Numberc;
	marginRight?: Numberc;
	flat: boolean;
	ean128: boolean;
	useCanvasToTempFilePath: boolean;
	lStyle?: string,
}


// 定义 CanvasState 接口，描述 canvas 对象的结构
export type CanvasState = {
  width: number;
  height: number;
  node: UniCanvasElement | null;
  _node: UniCanvasElement | null;
  init: boolean;
}