universal-picgo 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/README.md +100 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +21530 -0
  4. package/dist/package.json +53 -0
  5. package/dist/src/core/ExternalPicgo.d.ts +24 -0
  6. package/dist/src/core/Lifecycle.d.ts +15 -0
  7. package/dist/src/core/UniversalPicGo.d.ts +51 -0
  8. package/dist/src/core/UniversalPicGo.spec.d.ts +1 -0
  9. package/dist/src/db/config/index.d.ts +32 -0
  10. package/dist/src/db/config/index.spec.d.ts +1 -0
  11. package/dist/src/db/externalPicGo/index.d.ts +24 -0
  12. package/dist/src/db/pluginLoder/index.d.ts +24 -0
  13. package/dist/src/headless/UniversalPicGoHeadlessManager.d.ts +24 -0
  14. package/dist/src/headless/UniversalPicGoHeadlessManager.spec.d.ts +1 -0
  15. package/dist/src/headless/index.d.ts +3 -0
  16. package/dist/src/headless/types.d.ts +116 -0
  17. package/dist/src/headless/uploaderSchemas.d.ts +9 -0
  18. package/dist/src/i18n/browserI18nDb.d.ts +16 -0
  19. package/dist/src/i18n/en.d.ts +3 -0
  20. package/dist/src/i18n/index.d.ts +18 -0
  21. package/dist/src/i18n/simpleI18n.d.ts +19 -0
  22. package/dist/src/i18n/zh-CN.d.ts +143 -0
  23. package/dist/src/i18n/zh-TW.d.ts +3 -0
  24. package/dist/src/index.d.ts +24 -0
  25. package/dist/src/index.spec.d.ts +1 -0
  26. package/dist/src/lib/LifecyclePlugins.d.ts +18 -0
  27. package/dist/src/lib/PicGoRequest.d.ts +21 -0
  28. package/dist/src/lib/PluginHandler.d.ts +20 -0
  29. package/dist/src/lib/PluginLoader.d.ts +29 -0
  30. package/dist/src/plugins/transformer/base64.d.ts +6 -0
  31. package/dist/src/plugins/transformer/index.d.ts +4 -0
  32. package/dist/src/plugins/transformer/path.d.ts +6 -0
  33. package/dist/src/plugins/uploader/aliyun/index.d.ts +3 -0
  34. package/dist/src/plugins/uploader/aliyun/node.d.ts +1 -0
  35. package/dist/src/plugins/uploader/aliyun/web.d.ts +4 -0
  36. package/dist/src/plugins/uploader/awss3.d.ts +3 -0
  37. package/dist/src/plugins/uploader/github.d.ts +3 -0
  38. package/dist/src/plugins/uploader/gitlab.d.ts +3 -0
  39. package/dist/src/plugins/uploader/imgur.d.ts +3 -0
  40. package/dist/src/plugins/uploader/index.d.ts +4 -0
  41. package/dist/src/plugins/uploader/lsky/index.d.ts +3 -0
  42. package/dist/src/plugins/uploader/qiniu/digest.d.ts +7 -0
  43. package/dist/src/plugins/uploader/qiniu/index.d.ts +3 -0
  44. package/dist/src/plugins/uploader/qiniu/rs.d.ts +13 -0
  45. package/dist/src/plugins/uploader/qiniu/util.d.ts +8 -0
  46. package/dist/src/plugins/uploader/s3/uploader.d.ts +30 -0
  47. package/dist/src/plugins/uploader/s3/utils.d.ts +8 -0
  48. package/dist/src/plugins/uploader/s3/utils.spec.d.ts +1 -0
  49. package/dist/src/plugins/uploader/smms.d.ts +3 -0
  50. package/dist/src/plugins/uploader/tcyun.d.ts +9 -0
  51. package/dist/src/plugins/uploader/upyun/index.d.ts +3 -0
  52. package/dist/src/utils/CodingUtil.d.ts +39 -0
  53. package/dist/src/utils/CodingUtil.spec.d.ts +1 -0
  54. package/dist/src/utils/browserUtils.d.ts +12 -0
  55. package/dist/src/utils/clipboard/browser.d.ts +4 -0
  56. package/dist/src/utils/clipboard/electron.d.ts +4 -0
  57. package/dist/src/utils/common.d.ts +135 -0
  58. package/dist/src/utils/constants.d.ts +1 -0
  59. package/dist/src/utils/createContext.d.ts +9 -0
  60. package/dist/src/utils/cryptoUtil.d.ts +7 -0
  61. package/dist/src/utils/enums.d.ts +32 -0
  62. package/dist/src/utils/getClipboardImage.d.ts +4 -0
  63. package/dist/src/utils/hashUtil.d.ts +2 -0
  64. package/dist/src/utils/image-size/detector.d.ts +4 -0
  65. package/dist/src/utils/image-size/index.d.ts +12 -0
  66. package/dist/src/utils/image-size/types/bmp.d.ts +3 -0
  67. package/dist/src/utils/image-size/types/cur.d.ts +3 -0
  68. package/dist/src/utils/image-size/types/dds.d.ts +3 -0
  69. package/dist/src/utils/image-size/types/gif.d.ts +3 -0
  70. package/dist/src/utils/image-size/types/heif.d.ts +3 -0
  71. package/dist/src/utils/image-size/types/icns.d.ts +3 -0
  72. package/dist/src/utils/image-size/types/ico.d.ts +3 -0
  73. package/dist/src/utils/image-size/types/index.d.ts +21 -0
  74. package/dist/src/utils/image-size/types/interface.d.ts +15 -0
  75. package/dist/src/utils/image-size/types/j2c.d.ts +3 -0
  76. package/dist/src/utils/image-size/types/jp2.d.ts +3 -0
  77. package/dist/src/utils/image-size/types/jpg.d.ts +3 -0
  78. package/dist/src/utils/image-size/types/ktx.d.ts +3 -0
  79. package/dist/src/utils/image-size/types/png.d.ts +3 -0
  80. package/dist/src/utils/image-size/types/pnm.d.ts +3 -0
  81. package/dist/src/utils/image-size/types/psd.d.ts +3 -0
  82. package/dist/src/utils/image-size/types/svg.d.ts +3 -0
  83. package/dist/src/utils/image-size/types/tga.d.ts +3 -0
  84. package/dist/src/utils/image-size/types/tiff.d.ts +3 -0
  85. package/dist/src/utils/image-size/types/utils.d.ts +17 -0
  86. package/dist/src/utils/image-size/types/webp.d.ts +3 -0
  87. package/dist/src/utils/mimeLookup.d.ts +1 -0
  88. package/dist/src/utils/nodePolyfill.d.ts +4 -0
  89. package/dist/src/utils/nodeUtils.d.ts +31 -0
  90. package/dist/src/utils/os/index.d.ts +3 -0
  91. package/dist/src/utils/os/is-docker/index.d.ts +2 -0
  92. package/dist/src/utils/os/is-inside-container/index.d.ts +1 -0
  93. package/dist/src/utils/os/is-wsl/index.d.ts +2 -0
  94. package/dist/src/utils/pathObject.d.ts +4 -0
  95. package/dist/src/utils/pathObject.spec.d.ts +1 -0
  96. package/dist/src/utils/picgoEventBus.d.ts +4 -0
  97. package/dist/src/utils/pluginRuntime.d.ts +9 -0
  98. package/dist/src/utils/pluginRuntime.spec.d.ts +1 -0
  99. package/dist/vite.config.d.ts +2 -0
  100. package/package.json +2 -2
@@ -0,0 +1,3 @@
1
+ import { IImage } from './interface';
2
+
3
+ export declare const SVG: IImage;
@@ -0,0 +1,3 @@
1
+ import { IImage } from './interface';
2
+
3
+ export declare const TGA: IImage;
@@ -0,0 +1,3 @@
1
+ import { IImage } from './interface';
2
+
3
+ export declare const TIFF: IImage;
@@ -0,0 +1,17 @@
1
+ import { win } from 'universal-picgo-store';
2
+
3
+ export declare const toUTF8String: (input: typeof win.Uint8Array, start?: number, end?: any) => string;
4
+ export declare const toHexString: (input: typeof win.Uint8Array, start?: number, end?: any) => any;
5
+ export declare const readInt16LE: (input: typeof win.Uint8Array, offset?: number) => number;
6
+ export declare const readUInt16BE: (input: typeof win.Uint8Array, offset?: number) => any;
7
+ export declare const readUInt16LE: (input: typeof win.Uint8Array, offset?: number) => any;
8
+ export declare const readUInt24LE: (input: typeof win.Uint8Array, offset?: number) => any;
9
+ export declare const readInt32LE: (input: typeof win.Uint8Array, offset?: number) => any;
10
+ export declare const readUInt32BE: (input: typeof win.Uint8Array, offset?: number) => any;
11
+ export declare const readUInt32LE: (input: typeof win.Uint8Array, offset?: number) => any;
12
+ export declare function readUInt(input: typeof win.Uint8Array, bits: 16 | 32, offset: number, isBigEndian: boolean): number;
13
+ export declare function findBox(buffer: typeof win.Uint8Array, boxName: string, offset: number): {
14
+ name: string;
15
+ offset: number;
16
+ size: any;
17
+ } | undefined;
@@ -0,0 +1,3 @@
1
+ import { IImage } from './interface';
2
+
3
+ export declare const WEBP: IImage;
@@ -0,0 +1 @@
1
+ export declare function lookupMimeType(fileName?: string): string | undefined;
@@ -0,0 +1,4 @@
1
+ import { Buffer } from 'node:buffer';
2
+ import { EventEmitter } from 'node:events';
3
+
4
+ export { EventEmitter, Buffer };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * 实现 fs.pathExistsSync 函数
3
+ *
4
+ * @param fs
5
+ * @param path
6
+ * @param filePath
7
+ */
8
+ export declare const pathExistsSync: (fs: any, path: any, filePath: string) => boolean;
9
+ /**
10
+ * 实现 fs.ensureFileSync 函数
11
+ *
12
+ * @param fs
13
+ * @param path
14
+ * @param filePath
15
+ */
16
+ export declare const ensureFileSync: (fs: any, path: any, filePath: string) => void;
17
+ /**
18
+ * 确保目录存在
19
+ *
20
+ * @param fs
21
+ * @param dir
22
+ */
23
+ export declare const ensureFolderSync: (fs: any, dir: string) => void;
24
+ /**
25
+ * 同步读取 JSON 文件的方法
26
+ *
27
+ * @param fs - fs 模块
28
+ * @param filePath - JSON 文件路径
29
+ * @returns - JSON 文件内容转换后的对象,如果出错则返回空对象 {}
30
+ */
31
+ export declare const readJSONSync: (fs: any, filePath: string) => any;
@@ -0,0 +1,3 @@
1
+ export type Platform = "darwin" | "win32" | "win10" | "linux" | "wsl";
2
+ declare const getCurrentPlatform: () => Platform;
3
+ export { getCurrentPlatform };
@@ -0,0 +1,2 @@
1
+ declare const isDocker: () => boolean;
2
+ export { isDocker };
@@ -0,0 +1 @@
1
+ export default function isInsideContainer(): boolean;
@@ -0,0 +1,2 @@
1
+ declare const isWsl: () => boolean;
2
+ export { isWsl };
@@ -0,0 +1,4 @@
1
+ export declare function getByPath(obj: any, path?: string, defaultValue?: any): any;
2
+ export declare function setByPath(obj: any, path: string, value: any): void;
3
+ export declare function unsetByPath(obj: any, path: string): boolean;
4
+ export declare function deepMerge<T extends Record<string, any>>(target: T, source: Record<string, any>): T;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { EventEmitter } from './nodePolyfill';
2
+
3
+ declare const picgoEventBus: EventEmitter<[never]>;
4
+ export { picgoEventBus };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * PicGo 第三方插件依赖 Electron 的本机能力(node_modules、@electron/remote、插件菜单等)。
3
+ *
4
+ * v2 配置会在多个运行端共享,但非 Electron 端(浏览器、Docker、publisher 的 web runtime 等)
5
+ * 不能读取或应用任何第三方插件配置,否则会把本机 PC-only 状态误当成跨端平台能力。
6
+ */
7
+ export declare const isElectronRuntime: () => boolean;
8
+ export declare const isThirdPartyPluginRuntimeAvailable: () => boolean;
9
+ export declare const isPicGoPluginPackageName: (name: string) => boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vite').UserConfig;
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-picgo",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "description": "picgo lib for node, browser and electron",
6
6
  "main": "./dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "mime": "^4.0.3",
39
39
  "queue": "^7.0.0",
40
40
  "zhi-lib-base": "^0.8.0",
41
- "universal-picgo-store": "2.0.0"
41
+ "universal-picgo-store": "2.0.1"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"