@squared-functions/types
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -14,2 +14,3 @@ /// <reference path="type.d.ts" /> | ||
type FileCompressFormat = "gz" | "br"; | ||
type CloudFunctions = "upload"; | ||
type FileManagerWriteImageCallback = (data: internal.FileData, output: string, command: string, compress?: squared.CompressFormat, error?: Null<Error>) => void; | ||
@@ -43,20 +44,21 @@ type FileManagerPerformAsyncTaskCallback = () => void; | ||
interface CloudService { | ||
interface CloudService extends ObjectMap<unknown> { | ||
service: string; | ||
settings?: string; | ||
upload?: CloudServiceUpload; | ||
} | ||
interface CloudServiceAction { | ||
active?: boolean; | ||
} | ||
interface CloudServiceUpload extends CloudServiceAction { | ||
filename?: string; | ||
localStorage?: boolean; | ||
uploadAll?: boolean; | ||
filename?: string; | ||
apiEndpoint?: string; | ||
all?: boolean; | ||
publicAccess?: boolean; | ||
settings?: string; | ||
objects?: CloudObject[]; | ||
overwrite?: boolean; | ||
[key: string]: Undef<unknown>; | ||
} | ||
interface CloudObject extends Partial<LocationUri> { | ||
keyName: string; | ||
} | ||
interface WatchInterval { | ||
@@ -190,2 +192,16 @@ interval?: number; | ||
namespace Cloud { | ||
interface CloudUploadOptions<T>{ | ||
upload: squared.CloudServiceUpload; | ||
credentials: T; | ||
filename: string; | ||
fileUri: string; | ||
mimeType?: string; | ||
} | ||
type CloudServiceClient = (config: squared.CloudService) => boolean; | ||
type CloudServiceHost = (this: IFileManager, credentials: PlainObject, serviceName: string) => CloudUploadCallback; | ||
type CloudUploadCallback = (buffer: Buffer, options: CloudUploadOptions<unknown>, success: (value?: unknown) => void) => void; | ||
} | ||
interface FileData { | ||
@@ -203,18 +219,8 @@ file: ExternalAsset; | ||
namespace external { | ||
interface CloudUploadOptions<T>{ | ||
config: squared.CloudService; | ||
credentials: T; | ||
filename: string; | ||
fileUri: string; | ||
mimeType?: string; | ||
namespace Cloud { | ||
interface StorageSharedKeyCredential { | ||
accountName: string; | ||
accountKey: string; | ||
} | ||
} | ||
interface StorageSharedKeyCredential { | ||
accountName: string; | ||
accountKey: string; | ||
} | ||
type CloudServiceClient = (config: squared.CloudService) => boolean; | ||
type CloudServiceHost = (this: IFileManager, config: PlainObject, serviceName: string) => CloudServiceUpload; | ||
type CloudServiceUpload = (buffer: Buffer, success: (value?: unknown) => void, options: CloudUploadOptions<unknown>) => void; | ||
} | ||
@@ -234,3 +240,3 @@ | ||
azure?: { | ||
[key: string]: external.StorageSharedKeyCredential; | ||
[key: string]: external.Cloud.StorageSharedKeyCredential; | ||
}; | ||
@@ -297,4 +303,4 @@ gcs?: { | ||
settings: settings.CloudModule; | ||
getService(data: Undef<squared.CloudService[]>): Undef<squared.CloudService>; | ||
hasService(data: squared.CloudService): data is squared.CloudService; | ||
getService(data: Undef<squared.CloudService[]>, functionName: CloudFunctions): Undef<squared.CloudService>; | ||
hasService(data: squared.CloudService, functionName: CloudFunctions): squared.CloudServiceAction | false; | ||
} | ||
@@ -301,0 +307,0 @@ |
{ | ||
"name": "@squared-functions/types", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Type definitions for squared-functions", | ||
@@ -5,0 +5,0 @@ "types": "lib/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19804
439