1.给所有的接口导出和引入加上type关键字
Signed-off-by: zhoulisheng1 <zhoulisheng1@huawei.com>
This commit is contained in:
parent
f9137d11b3
commit
8a007854cd
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,4 +1,15 @@
|
|||
## 1.0.7
|
||||
|
||||
- 新增开发者可对图片缓存进行全局配置能力
|
||||
- 新增对OpenHarmony图库的Uri数据加载的能力(需要申请图库访问权限和文件读取权限,动态申请图库访问权限)
|
||||
- 修复若干问题:
|
||||
|
||||
1.ImageKnifeOption的loadSrc为undefined,导致的crash问题
|
||||
|
||||
2.ImageKnifeComponent直接绘制GIF图片格式第几帧的时候,无法绘制问题。
|
||||
|
||||
## 1.0.6
|
||||
|
||||
- 适配DevEco Studio 3.1Beta1及以上版本。
|
||||
|
||||
- 适配OpenHarmony SDK API version 9及以上版本。
|
||||
|
|
|
@ -142,6 +142,7 @@ struct TestImageKnifeOptionChangedPage4 {
|
|||
if(index<30){
|
||||
index++
|
||||
let nextFunc = this.drawMainAnimate.bind(this,index, context, scaleType, imagePixelMap, widthPixel, heightPixel, compWidth, compHeight)
|
||||
// @ts-ignore
|
||||
this.mTimerId = setTimeout(nextFunc, 1000/30.0)
|
||||
}else{
|
||||
// 不做处理
|
||||
|
@ -225,6 +226,7 @@ struct TestImageKnifeOptionChangedPage4 {
|
|||
console.log('imageinfo width =' + imageInfo.size.width + ' height=' + imageInfo.size.height + 'scaleType=' + scaleType)
|
||||
|
||||
let func = this.drawMainAnimate.bind(this,0, context, scaleType, data.drawPixelMap.imagePixelMap, imageInfo.size.width, imageInfo.size.height, compWidth, compHeight)
|
||||
// @ts-ignore
|
||||
this.mTimerId = setTimeout(func, 1000/30.0)
|
||||
|
||||
console.log('TestImageKnifeOptionChangedPage4 drawMainSource end!')
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
import { NativeEglRender } from '../gl/NativeEglRender'
|
||||
import { GPUFilterType } from '../gl/GPUFilterType'
|
||||
import { Runnable } from '../interface/Runnable'
|
||||
import type { Runnable } from '../interface/Runnable'
|
||||
import LinkedList from '@ohos.util.LinkedList';
|
||||
import ArrayList from '@ohos.util.ArrayList';
|
||||
|
||||
|
|
|
@ -27,16 +27,16 @@ export * from './src/main/ets/components/cache/diskstrategy/enum/AUTOMATIC'
|
|||
export * from './src/main/ets/components/cache/diskstrategy/enum/DATA'
|
||||
export * from './src/main/ets/components/cache/diskstrategy/enum/NONE'
|
||||
export * from './src/main/ets/components/cache/diskstrategy/enum/RESOURCE'
|
||||
export * from './src/main/ets/components/cache/key/EngineKeyInterface'
|
||||
export type {EngineKeyInterface} from './src/main/ets/components/cache/key/EngineKeyInterface'
|
||||
export * from './src/main/ets/components/cache/key/EngineKeyFactories'
|
||||
|
||||
/**
|
||||
* compress
|
||||
*/
|
||||
export * from './src/main/ets/components/imageknife/compress/CompressBuilder'
|
||||
export * from './src/main/ets/components/imageknife/compress/listener/OnCompressListener'
|
||||
export * from './src/main/ets/components/imageknife/compress/listener/OnRenameListener'
|
||||
export * from './src/main/ets/components/imageknife/compress/listener/CompressDataListener'
|
||||
export type {OnCompressListener} from './src/main/ets/components/imageknife/compress/listener/OnCompressListener'
|
||||
export type {OnRenameListener} from './src/main/ets/components/imageknife/compress/listener/OnRenameListener'
|
||||
export type {CompressDataListener} from './src/main/ets/components/imageknife/compress/listener/CompressDataListener'
|
||||
export * from './src/main/ets/components/imageknife/compress/listener/CompressionPredicate'
|
||||
export * from './src/main/ets/components/imageknife/compress/provider/CompressAdapter'
|
||||
export * from './src/main/ets/components/imageknife/compress/provider/CompressProvider'
|
||||
|
@ -55,7 +55,7 @@ export * from './src/main/ets/components/imageknife/crop/CropCallback'
|
|||
/**
|
||||
* transform
|
||||
*/
|
||||
export * from './src/main/ets/components/imageknife/transform/BaseTransform'
|
||||
export type {BaseTransform} from './src/main/ets/components/imageknife/transform/BaseTransform'
|
||||
export * from './src/main/ets/components/imageknife/transform/BlurTransformation'
|
||||
export * from './src/main/ets/components/imageknife/transform/BrightnessFilterTransformation'
|
||||
export * from './src/main/ets/components/imageknife/transform/ContrastFilterTransformation'
|
||||
|
@ -99,10 +99,11 @@ export * from './src/main/ets/components/imageknife/ImageKnifeComponent'
|
|||
export * from './src/main/ets/components/imageknife/ImageKnifeDrawFactory'
|
||||
export * from './src/main/ets/components/imageknife/ImageKnifeOption'
|
||||
export * from './src/main/ets/components/imageknife/ImageKnifeData'
|
||||
export * from './src/main/ets/components/imageknife/interface/IAllCacheInfoCallback'
|
||||
export * from './src/main/ets/components/imageknife/interface/IParseImage'
|
||||
export * from './src/main/ets/components/imageknife/networkmanage/IDataFetch'
|
||||
export * from './src/main/ets/components/imageknife/requestmanage/ICache'
|
||||
export type {IAllCacheInfoCallback} from './src/main/ets/components/imageknife/interface/IAllCacheInfoCallback'
|
||||
export type {AllCacheInfo} from './src/main/ets/components/imageknife/interface/IAllCacheInfoCallback'
|
||||
export type {IParseImage} from './src/main/ets/components/imageknife/interface/IParseImage'
|
||||
export type {IDataFetch} from './src/main/ets/components/imageknife/networkmanage/IDataFetch'
|
||||
export type {ICache} from './src/main/ets/components/imageknife/requestmanage/ICache'
|
||||
export * from './src/main/ets/components/imageknife/utils/FileTypeUtil'
|
||||
export * from './src/main/ets/components/imageknife/utils/ParseImageUtil'
|
||||
|
||||
|
@ -121,7 +122,7 @@ export {gifHandler} from './GifWorker'
|
|||
|
||||
// 自定义组件新增
|
||||
// 自定义组件绘制生命周期
|
||||
export * from './src/main/ets/components/imageknife/interface/IDrawLifeCycle'
|
||||
export type {IDrawLifeCycle} from './src/main/ets/components/imageknife/interface/IDrawLifeCycle'
|
||||
|
||||
// 日志管理
|
||||
export * from './src/main/ets/components/imageknife/utils/LogUtil'
|
|
@ -16,12 +16,8 @@
|
|||
"type": "module",
|
||||
"version": "1.0.6",
|
||||
"dependencies": {
|
||||
"pako": "^1.0.5",
|
||||
"js-binary-schema-parser": "^2.0.3",
|
||||
"@ohos/disklrucache": "^1.0.0",
|
||||
"@ohos/svg": "1.1.0",
|
||||
"crc-32": "^1.2.0",
|
||||
"spark-md5": "^3.0.2",
|
||||
"@ohos/gpu_transform": "^0.1.0"
|
||||
},
|
||||
"tags": [
|
||||
|
|
|
@ -26,9 +26,9 @@ import {RequestManager} from "../imageknife/requestmanage/RequestManager"
|
|||
import {NONE} from "../cache/diskstrategy/enum/NONE"
|
||||
import {FileTypeUtil} from '../imageknife/utils/FileTypeUtil'
|
||||
import {DownloadClient} from '../imageknife/networkmanage/DownloadClient'
|
||||
import {IDataFetch} from '../imageknife/networkmanage/IDataFetch'
|
||||
import type {IDataFetch} from '../imageknife/networkmanage/IDataFetch'
|
||||
import {ParseResClient} from '../imageknife/resourcemanage/ParseResClient'
|
||||
import {IResourceFetch} from '../imageknife/resourcemanage/IResourceFetch'
|
||||
import type {IResourceFetch} from '../imageknife/resourcemanage/IResourceFetch'
|
||||
import {ImageKnifeData,ImageKnifeType} from '../imageknife/ImageKnifeData'
|
||||
import {FileUtils} from '../cache/FileUtils'
|
||||
import {FileReader} from '../cache/FileReader'
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
*/
|
||||
|
||||
import { DiskStrategy } from "../cache/diskstrategy/DiskStrategy"
|
||||
import { AsyncCallback } from "../imageknife/interface/asynccallback"
|
||||
import { AsyncSuccess } from "../imageknife/interface/AsyncSuccess"
|
||||
import { IAllCacheInfoCallback } from "../imageknife/interface/IAllCacheInfoCallback"
|
||||
import type { AsyncCallback } from "../imageknife/interface/asynccallback"
|
||||
import type { AsyncSuccess } from "../imageknife/interface/AsyncSuccess"
|
||||
import type { IAllCacheInfoCallback } from "../imageknife/interface/IAllCacheInfoCallback"
|
||||
import { AUTOMATIC } from "../cache/diskstrategy/enum/AUTOMATIC"
|
||||
import { BaseTransform } from "../imageknife/transform/BaseTransform"
|
||||
import { RotateImageTransformation } from "../imageknife/transform/RotateImageTransformation"
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {ImageKnifeData} from '../ImageKnifeData'
|
||||
export interface IDrawExtension{
|
||||
<T>(context: CanvasRenderingContext2D,data: ImageKnifeData, imageKnifeOption:T, compWidth:number,compHeight:number, setGifTimeId?:(timeId:number)=>void)
|
||||
}
|
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { IDataFetch } from '../networkmanage/IDataFetch'
|
||||
import type { IDataFetch } from '../networkmanage/IDataFetch'
|
||||
import { RequestOption } from '../RequestOption'
|
||||
import { Md5 } from '../../cache/Md5'
|
||||
import { FileUtils } from '../../cache/FileUtils'
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { IDataFetch } from '../networkmanage/IDataFetch'
|
||||
import type { IDataFetch } from '../networkmanage/IDataFetch'
|
||||
import { RequestOption } from '../RequestOption'
|
||||
import fs from '@ohos.file.fs';
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { IDataFetch } from '../networkmanage/IDataFetch'
|
||||
import type { IDataFetch } from '../networkmanage/IDataFetch'
|
||||
import { RequestOption } from '../RequestOption'
|
||||
import { Md5 } from '../../cache/Md5'
|
||||
import { FileUtils } from '../../cache/FileUtils'
|
||||
|
|
|
@ -13,14 +13,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { IDataFetch } from '../networkmanage/IDataFetch'
|
||||
import type { IDataFetch } from '../networkmanage/IDataFetch'
|
||||
import { RequestOption } from '../RequestOption'
|
||||
import { Md5 } from '../../cache/Md5'
|
||||
import { FileUtils } from '../../cache/FileUtils'
|
||||
import loadRequest from '@ohos.request';
|
||||
|
||||
// 数据加载器
|
||||
export class NetworkDownloadClient {
|
||||
export class NetworkDownloadClient implements IDataFetch {
|
||||
loadData(request: RequestOption, onComplete: (img: ArrayBuffer) => void, onError: (err: string) => void) {
|
||||
let filename = Md5.hashStr(request.generateDataKey);
|
||||
let downloadFolder = request.getFilesPath() + "/" + request.networkCacheFolder;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ICache } from "../requestmanage/ICache"
|
||||
import type { ICache } from "../requestmanage/ICache"
|
||||
import { DiskLruCache } from "@ohos/disklrucache"
|
||||
|
||||
export class DiskCacheProxy implements ICache<string, ArrayBuffer> {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {ICache} from "../requestmanage/ICache"
|
||||
import type {ICache} from "../requestmanage/ICache"
|
||||
import {LruCache} from "../../cache/LruCache"
|
||||
|
||||
export class MemoryCacheProxy <K, V> implements ICache<K, V> {
|
||||
|
|
|
@ -21,12 +21,12 @@ import {Md5} from "../../cache/Md5"
|
|||
import{MemoryCacheProxy} from "../requestmanage/MemoryCacheProxy"
|
||||
import{DiskCacheProxy} from "../requestmanage/DiskCacheProxy"
|
||||
import{FileTypeUtil} from "../utils/FileTypeUtil"
|
||||
import{IDataFetch} from "../../imageknife/networkmanage/IDataFetch"
|
||||
import{IResourceFetch} from "../../imageknife/resourcemanage/IResourceFetch"
|
||||
import type {IDataFetch} from "../../imageknife/networkmanage/IDataFetch"
|
||||
import type {IResourceFetch} from "../../imageknife/resourcemanage/IResourceFetch"
|
||||
import{ImageKnifeData,ImageKnifeType} from "../ImageKnifeData"
|
||||
import {AllCacheInfo, IAllCacheInfoCallback} from "../../imageknife/interface/IAllCacheInfoCallback"
|
||||
import {AllCacheInfo} from "../../imageknife/interface/IAllCacheInfoCallback"
|
||||
import{ParseImageUtil} from '../utils/ParseImageUtil'
|
||||
import{IParseImage} from '../interface/IParseImage'
|
||||
import type {IParseImage} from '../interface/IParseImage'
|
||||
import image from "@ohos.multimedia.image"
|
||||
import { SVGParseImpl } from '../utils/svg/SVGParseImpl'
|
||||
import { GIFParseImpl } from '../utils/gif/GIFParseImpl'
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {IResourceFetch} from '../resourcemanage/IResourceFetch'
|
||||
import type {IResourceFetch} from '../resourcemanage/IResourceFetch'
|
||||
import {ResourceTypeEts} from '../../imageknife/constants/ResourceTypeEts'
|
||||
|
||||
import resourceManager from '@ohos.resourceManager';
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {IResourceFetch} from '../resourcemanage/IResourceFetch'
|
||||
import type {IResourceFetch} from '../resourcemanage/IResourceFetch'
|
||||
import {ResourceTypeEts} from '../../imageknife/constants/ResourceTypeEts'
|
||||
import {Base64} from '../../cache/Base64'
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {DataCallBack} from "../interface/DataCallBack"
|
||||
import type {DataCallBack} from "../interface/DataCallBack"
|
||||
|
||||
export namespace ColorUtils {
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import{IParseImage} from '../interface/IParseImage'
|
||||
import type {IParseImage} from '../interface/IParseImage'
|
||||
import image from '@ohos.multimedia.image';
|
||||
|
||||
export class ParseImageUtil implements IParseImage {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {IParseSvg} from'./IParseSvg'
|
||||
import type {IParseSvg} from'./IParseSvg'
|
||||
import {SVGImageView} from '@ohos/svg'
|
||||
export class SVGParseImpl implements IParseSvg{
|
||||
parseSvg(imageinfo: ArrayBuffer,size?:{width:number,height:number}): Promise<PixelMap>{
|
||||
|
|
Loading…
Reference in New Issue