|
@@ -0,0 +1,51 @@
|
|
|
+// Type augmentation for fmode-ng/core
|
|
|
+// This file provides type declarations for NovaStorage and NovaFile which are missing in the package
|
|
|
+
|
|
|
+declare module 'fmode-ng/core' {
|
|
|
+ import { FmodeParse, FmodeObject, FmodeQuery, FmodeUser } from 'fmode-ng/core';
|
|
|
+ import { WxworkAuth, WxworkCorp, WxworkSDK } from 'fmode-ng/core';
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NovaFile interface
|
|
|
+ * Represents a file uploaded to Nova storage
|
|
|
+ */
|
|
|
+ export interface NovaFile {
|
|
|
+ id: string;
|
|
|
+ key: string;
|
|
|
+ url: string;
|
|
|
+ name: string;
|
|
|
+ type: string;
|
|
|
+ size: number;
|
|
|
+ metadata?: any;
|
|
|
+ md5?: string;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NovaUploadOptions interface
|
|
|
+ * Options for uploading files
|
|
|
+ */
|
|
|
+ export interface NovaUploadOptions {
|
|
|
+ prefixKey?: string;
|
|
|
+ onProgress?: (progress: { total: { percent: number; loaded: number; size: number } }) => void;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NovaStorage class
|
|
|
+ * Handles file storage operations
|
|
|
+ */
|
|
|
+ export class NovaStorage {
|
|
|
+ /**
|
|
|
+ * Initialize NovaStorage with a company ID
|
|
|
+ * @param cid Company ID
|
|
|
+ */
|
|
|
+ static withCid(cid: string): Promise<NovaStorage>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Upload a file to storage
|
|
|
+ * @param file File to upload
|
|
|
+ * @param options Upload options
|
|
|
+ */
|
|
|
+ upload(file: File, options?: NovaUploadOptions): Promise<NovaFile>;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|