@squared-functions/types
Advanced tools
+38
-29
@@ -14,6 +14,7 @@ /// <reference path="type.d.ts" /> | ||
| type CloudFunctions = "upload" | "download"; | ||
| type FileManagerWriteImageCallback = (data: internal.FileData, output: string, options?: internal.Image.UsingOptions, error?: Null<Error>) => void; | ||
| type FileManagerFinalizeImageMethod = (output: string, data: internal.FileData, options?: internal.Image.UsingOptions, error?: Null<Error>) => void; | ||
| type FileManagerPerformAsyncTaskCallback = (parent?: ExternalAsset) => void; | ||
| type FileManagerCompleteAsyncTaskCallback = (value?: unknown, parent?: ExternalAsset) => void; | ||
| type CompressTryImageCallback = (result: string) => void; | ||
| type CompressTryFileMethod = (fileUri: string, data: squared.CompressFormat, initalize?: Null<FileManagerPerformAsyncTaskCallback>, callback?: FileManagerCompleteAsyncTaskCallback) => void; | ||
| type CompressTryImageCallback = (success?: boolean) => void; | ||
@@ -114,3 +115,2 @@ namespace squared { | ||
| namespace chrome { | ||
| type OutputAttribute = KeyValue<string, Null<string>>; | ||
| type UnusedStyles = string[]; | ||
@@ -147,13 +147,2 @@ | ||
| namespace internal { | ||
| namespace Serve { | ||
| interface Routing { | ||
| [key: string]: Route[]; | ||
| } | ||
| interface Route { | ||
| mount?: string; | ||
| path?: string; | ||
| } | ||
| } | ||
| namespace Image { | ||
@@ -165,3 +154,3 @@ interface UsingOptions { | ||
| time?: number; | ||
| callback?: FileManagerWriteImageCallback; | ||
| callback?: FileManagerFinalizeImageMethod; | ||
| } | ||
@@ -224,2 +213,10 @@ | ||
| interface CacheTimeout { | ||
| aws?: number; | ||
| azure?: number; | ||
| gcloud?: number; | ||
| ibm?: number; | ||
| oci?: number; | ||
| } | ||
| interface FunctionData { | ||
@@ -251,3 +248,3 @@ admin?: squared.CloudStorageAdmin; | ||
| deleteObjects?(this: InstanceHost, credential: unknown, bucket: string, service?: string, sdk?: string): Promise<void>; | ||
| executeQuery?(this: InstanceHost, credential: unknown, data: squared.CloudDatabase, cacheKey?: string): Promise<PlainObject[]>; | ||
| executeQuery?(this: ICloud, credential: unknown, data: squared.CloudDatabase, cacheKey?: string): Promise<PlainObject[]>; | ||
| } | ||
@@ -295,2 +292,7 @@ | ||
| } | ||
| interface Route { | ||
| mount?: string; | ||
| path?: string; | ||
| } | ||
| } | ||
@@ -310,5 +312,3 @@ | ||
| isDirectoryUNC(value: string): boolean; | ||
| fromSameOrigin(value: string, other: string): boolean; | ||
| parsePath(value: string): Undef<string>; | ||
| resolvePath(value: string, href: string, hostname?: boolean): Undef<string>; | ||
| resolvePath(value: string, href: string): string; | ||
| } | ||
@@ -320,2 +320,4 @@ | ||
| tinifyApiKey: string; | ||
| compressorProxy: ObjectMap<CompressTryFileMethod>; | ||
| registerCompressor(format: string, callback: CompressTryFileMethod): void; | ||
| createWriteStreamAsGzip(source: string, fileUri: string, level?: number): WriteStream; | ||
@@ -325,5 +327,4 @@ createWriteStreamAsBrotli(source: string, fileUri: string, quality?: number, mimeType?: string): WriteStream; | ||
| hasImageService(): boolean; | ||
| parseSizeRange(value: string): [number, number]; | ||
| withinSizeRange(fileUri: string, value: Undef<string>): boolean; | ||
| tryFile(fileUri: string, data: squared.CompressFormat, initialize?: Null<FileManagerPerformAsyncTaskCallback>, callback?: FileManagerCompleteAsyncTaskCallback): void; | ||
| tryFile: CompressTryFileMethod; | ||
| tryImage(fileUri: string, callback: CompressTryImageCallback): void; | ||
@@ -365,3 +366,3 @@ } | ||
| rotate(initialize?: FileManagerPerformAsyncTaskCallback, callback?: FileManagerCompleteAsyncTaskCallback, parent?: ExternalAsset): void; | ||
| write(data: internal.FileData, output: string, options?: internal.Image.UsingOptions): void; | ||
| write(output: string, data: internal.FileData, options?: internal.Image.UsingOptions): void; | ||
| finalize(output: string, callback: (result: string) => void): void; | ||
@@ -374,13 +375,16 @@ constructor(instance: T, fileUri: string, command?: string, finalAs?: string); | ||
| database: squared.CloudDatabase[]; | ||
| cacheExpires: number; | ||
| setObjectKeys(assets: ExternalAsset[]): void; | ||
| createBucket(service: string, credential: unknown, bucket: string, publicRead?: boolean): Promise<boolean>; | ||
| deleteObjects(service: string, credential: unknown, bucket: string): Promise<void>; | ||
| downloadObject(service: string, credential: PlainObject, bucket: string, download: squared.CloudStorageDownload, callback: (value: Null<Buffer | string>) => void, bucketGroup?: string): Promise<void>; | ||
| downloadObject(service: string, credential: unknown, bucket: string, download: squared.CloudStorageDownload, callback: (value: Null<Buffer | string>) => void, bucketGroup?: string): Promise<void>; | ||
| getStorage(action: CloudFunctions, data: Undef<squared.CloudStorage[]>): Undef<squared.CloudStorage>; | ||
| hasStorage(action: CloudFunctions, storage: squared.CloudStorage): squared.CloudStorageUpload | false; | ||
| getDatabaseRows(database: squared.CloudDatabase, cacheKey?: string): Promise<PlainObject[]>; | ||
| getDatabaseRows(data: squared.CloudDatabase, cacheKey?: string): Promise<PlainObject[]>; | ||
| getDatabaseResult(service: string, credential: unknown, queryString: string, cacheKey?: string): Undef<any[]>; | ||
| setDatabaseResult(service: string, credential: unknown, queryString: string, result: any[], cacheKey?: string): void; | ||
| hasCredential(feature: CloudFeatures, data: squared.CloudService): boolean; | ||
| getCredential(data: squared.CloudService): PlainObject; | ||
| getUploadHandler(service: string, credential: PlainObject): internal.Cloud.UploadCallback; | ||
| getDownloadHandler(service: string, credential: PlainObject): internal.Cloud.DownloadCallback; | ||
| getUploadHandler(service: string, credential: unknown): internal.Cloud.UploadCallback; | ||
| getDownloadHandler(service: string, credential: unknown): internal.Cloud.DownloadCallback; | ||
| } | ||
@@ -450,3 +454,3 @@ | ||
| findAsset(uri: string, fromElement?: boolean): Undef<ExternalAsset>; | ||
| findRelativePath(file: ExternalAsset, uri: string): Undef<string>; | ||
| findRelativePath(file: ExternalAsset, location: string, partial?: boolean): Undef<string>; | ||
| getHtmlPages(): ExternalAsset[]; | ||
@@ -465,3 +469,3 @@ removeCwd(value: Undef<string>): string; | ||
| compressFile(file: ExternalAsset): Promise<unknown>; | ||
| finalizeImage: FileManagerWriteImageCallback; | ||
| finalizeImage: FileManagerFinalizeImageMethod; | ||
| finalizeAsset(data: internal.FileData, parent?: ExternalAsset): Promise<void>; | ||
@@ -529,3 +533,3 @@ processAssets(watch?: boolean): void; | ||
| port?: StringMap; | ||
| routing?: internal.Serve.Routing; | ||
| routing?: ExtendedSettings.RoutingModule; | ||
| request_post_limit?: string; | ||
@@ -542,2 +546,6 @@ logger?: ExtendedSettings.LoggerModule; | ||
| namespace ExtendedSettings { | ||
| interface RoutingModule { | ||
| [key: string]: internal.Route[]; | ||
| } | ||
| interface LoggerModule { | ||
@@ -567,2 +575,3 @@ unknown?: boolean; | ||
| interface CloudModule { | ||
| cache?: Partial<internal.Cloud.CacheTimeout>; | ||
| aws?: ObjectMap<StringMap>; | ||
@@ -569,0 +578,0 @@ azure?: ObjectMap<StringMap>; |
+3
-8
| type Undef<T> = T | undefined; | ||
| type Null<T> = T | null; | ||
| type Void<T> = T | void; | ||
| type Constructor<T> = new(...args: any[]) => T; | ||
| type FunctionType<T> = (...args: unknown[]) => T; | ||
| type FunctionType<T, U = unknown> = (...args: U[]) => T; | ||
| type NumString = number | string; | ||
| type StringMap = Record<string, Undef<string>>; | ||
| type StandardMap = Record<string, any>; | ||
| type PlainObject = Record<string | number | symbol, unknown>; | ||
| type StringMap = Record<string, Undef<string>>; | ||
| type ObjectMap<T> = Record<string, T>; | ||
@@ -23,7 +23,2 @@ | ||
| height: number; | ||
| } | ||
| interface KeyValue<T, U> { | ||
| key: T; | ||
| value: U; | ||
| } |
+1
-1
| { | ||
| "name": "@squared-functions/types", | ||
| "version": "0.9.2", | ||
| "version": "0.9.3", | ||
| "description": "Type definitions for squared-functions", | ||
@@ -5,0 +5,0 @@ "types": "lib/index.d.ts", |
25846
1.59%547
0.74%