// @ts-nocheck
export * from './interface';
import { type ChooseFileOption } from './interface';

export function chooseFile(options: ChooseFileOption){
	// #ifdef WEB || APP-HARMONY
	uni.chooseFile({
		count: options.count ?? 100,
		type: options.type,
		extension: options.extension,
		success(res) {
			options.success?.({
				// tempFilePaths
				errMsg : 'ok',
				tempFiles: res.tempFiles
			})
		},
		fail(err) {
			options.fail?.({
				errCode: err.errCode,
				errSubject: 'lime-choose-file'
			})
		},
		complete(res) {
			// options.complete?.(res)
		}
	})
	// #endif
	// #ifdef MP-WEIXIN
	uni.chooseMessageFile(options)
	// #endif
	// #ifndef WEB || MP-WEIXIN || APP-HARMONY
	console.error('chooseFile 不支持该平台')
	// #endif
}