@squared-functions/types
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -6,2 +6,3 @@ /// <reference path="type.d.ts" /> | ||
import type { WriteStream } from 'fs'; | ||
import type { BackgroundColor, ForegroundColor } from 'chalk'; | ||
@@ -47,3 +48,4 @@ import type { ConfigurationOptions } from 'aws-sdk/lib/core'; | ||
service: string; | ||
settings?: string; | ||
credential: StringMap; | ||
publicRead?: boolean; | ||
upload?: CloudServiceUpload; | ||
@@ -63,3 +65,3 @@ download?: CloudServiceDownload; | ||
all?: boolean; | ||
publicAccess?: boolean; | ||
publicRead?: boolean; | ||
} | ||
@@ -103,3 +105,3 @@ | ||
attributes?: AttributeValue[]; | ||
basePath?: string; | ||
baseUrl?: string; | ||
bundleId?: number; | ||
@@ -211,7 +213,10 @@ bundleIndex?: number; | ||
interface UploadData<T> { | ||
interface FunctionData<T = PlainObject, U = CloudService> { | ||
credential: T; | ||
service: U; | ||
} | ||
interface UploadData<T, U> extends FunctionData<T, U> { | ||
upload: CloudServiceUpload; | ||
buffer: Buffer; | ||
service: CloudService; | ||
upload: CloudServiceUpload; | ||
credential: T; | ||
fileUri: string; | ||
@@ -224,10 +229,16 @@ fileGroup: [Buffer | string, string][]; | ||
interface DownloadData<T, U> extends FunctionData<T, U> { | ||
download: CloudServiceDownload; | ||
} | ||
interface ServiceClient { | ||
validate: (config: CloudService) => boolean; | ||
setCredential?: (credential: PlainObject) => void; | ||
validate: (credential: StringMap) => boolean; | ||
setCredential?: (this: IFileManager, credential: PlainObject) => void; | ||
setPublicRead?: (this: IFileManager, ...args: unknown[]) => void; | ||
} | ||
type UploadHost = (this: IFileManager, service: string, credential: PlainObject) => UploadCallback; | ||
type DownloadHost = (this: IFileManager, service: string, credential: PlainObject, download: CloudServiceDownload, success: (value: Null<Buffer | string>) => void) => void; | ||
type UploadCallback = (data: UploadData<unknown>, success: (value: string) => void) => void; | ||
type UploadHost = (this: IFileManager, service: string, credential: unknown, sdk?: string) => UploadCallback; | ||
type DownloadHost = (this: IFileManager, service: string, credential: unknown, data: DownloadData<unknown, unknown>, success: (value: Null<Buffer | string>) => void, sdk?: string) => void; | ||
type UploadCallback = (data: UploadData<unknown, unknown>, success: (value: string) => void) => void; | ||
} | ||
@@ -309,3 +320,3 @@ | ||
withinSizeRange(fileUri: string, value: Undef<string>): boolean; | ||
tryFile(fileUri: string, data: squared.CompressFormat, preCompress?: FileManagerPerformAsyncTaskCallback, postWrite?: FileManagerCompleteAsyncTaskCallback): void; | ||
tryFile(fileUri: string, data: squared.CompressFormat, initialize?: FileManagerPerformAsyncTaskCallback, callback?: FileManagerCompleteAsyncTaskCallback): void; | ||
tryImage(fileUri: string, callback: FileOutputCallback): void; | ||
@@ -356,3 +367,3 @@ } | ||
productionRelease: boolean; | ||
basePath?: string; | ||
baseUrl?: string; | ||
Chrome?: IChrome; | ||
@@ -380,10 +391,10 @@ Cloud?: settings.CloudModule; | ||
performFinalize(): void; | ||
replacePath(source: string, segments: string[], value: string, matchSingle?: boolean, base64?: boolean): Undef<string>; | ||
escapePathSeparator(value: string): string; | ||
getFileOutput(file: ExternalAsset): internal.FileOutput; | ||
replaceUri(source: string, segments: string[], value: string, matchSingle?: boolean, base64?: boolean): Undef<string>; | ||
setFileUri(file: ExternalAsset): internal.FileOutput; | ||
findAsset(uri: string, fromElement?: boolean): Undef<ExternalAsset>; | ||
getHtmlPages(): ExternalAsset[]; | ||
getRelativeUri(file: ExternalAsset, uri: string): Undef<string>; | ||
getAbsoluteUri(value: string, href: string): string; | ||
getFileUri(file: ExternalAsset, filename?: string): string; | ||
removeCwd(value: Undef<string>): string; | ||
relativePosix(file: ExternalAsset, uri: string): Undef<string>; | ||
absolutePath(value: string, href: string): string; | ||
relativePath(file: ExternalAsset, filename?: string): string; | ||
getUTF8String(file: ExternalAsset, fileUri?: string): string; | ||
@@ -426,5 +437,7 @@ appendContent(file: ExternalAsset, fileUri: string, content: string, bundleIndex: number): Promise<string>; | ||
getTempDir(): string; | ||
escapePosix(value: string): string; | ||
toPosix(value: string, filename?: string): string; | ||
writeMessage(value: string, message?: unknown, title?: string, color?: "red" | "yellow" | "green" | "blue" | "white" | "grey"): void; | ||
writeFail(value: string, message?: unknown): void; | ||
writeFail(value: string | [string, string], message?: unknown): void; | ||
formatMessage(title: string, value: string | [string, string], message?: unknown, color?: typeof ForegroundColor, bgColor?: typeof BackgroundColor): void; | ||
writeMessage(title: string, value: string, message?: unknown, color?: typeof ForegroundColor, bgColor?: typeof BackgroundColor): void; | ||
} | ||
@@ -453,3 +466,3 @@ | ||
quality(): void; | ||
rotate(parent?: ExternalAsset, preRotate?: FileManagerPerformAsyncTaskCallback, postWrite?: FileManagerCompleteAsyncTaskCallback): void; | ||
rotate(parent?: ExternalAsset, initialize?: FileManagerPerformAsyncTaskCallback, callback?: FileManagerCompleteAsyncTaskCallback): void; | ||
write(output: string, options?: internal.Image.UsingOptions): void; | ||
@@ -456,0 +469,0 @@ finalize(output: string, callback: (result: string) => void): void; |
{ | ||
"name": "@squared-functions/types", | ||
"version": "0.7.1", | ||
"version": "0.7.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
21551
469